#ifndef WELSVP_ADAPTIVEQUANTIZATION_H
#define WELSVP_ADAPTIVEQUANTIZATION_H
#include "util.h"
#include "memory.h"
#include "WelsFrameWork.h"
#include "IWelsVP.h"
#include "cpu.h"
WELSVP_NAMESPACE_BEGIN
typedef void (VarFunc) (uint8_t* pRefY, int32_t iRefStrideY, uint8_t* pSrc, int32_t iSrcStrideY,
SMotionTextureUnit* pMotionTexture);
typedef VarFunc* PVarFunc;
VarFunc SampleVariance16x16_c;
#ifdef X86_ASM
WELSVP_EXTERN_C_BEGIN
VarFunc SampleVariance16x16_sse2;
WELSVP_EXTERN_C_END
#endif
#ifdef HAVE_NEON
WELSVP_EXTERN_C_BEGIN
VarFunc SampleVariance16x16_neon;
WELSVP_EXTERN_C_END
#endif
#if defined(HAVE_NEON_AARCH64) && defined(__aarch64__)
WELSVP_EXTERN_C_BEGIN
VarFunc SampleVariance16x16_AArch64_neon;
WELSVP_EXTERN_C_END
#endif
class CAdaptiveQuantization : public IStrategy {
public:
CAdaptiveQuantization (int32_t iCpuFlag);
~CAdaptiveQuantization();
EResult Process (int32_t iType, SPixMap* pSrc, SPixMap* pRef);
EResult Set (int32_t iType, void* pParam);
EResult Get (int32_t iType, void* pParam);
private:
void WelsInitVarFunc (PVarFunc& pfVar, int32_t iCpuFlag);
private:
PVarFunc m_pfVar;
int32_t m_CPUFlag;
SAdaptiveQuantizationParam m_sAdaptiveQuantParam;
};
WELSVP_NAMESPACE_END
#endif