#ifndef IWELSVP_H_
#define IWELSVP_H_
#define WELSVP_MAJOR_VERSION 1
#define WELSVP_MINOR_VERSION 1
#define WELSVP_VERSION ((WELSVP_MAJOR_VERSION << 8) + WELSVP_MINOR_VERSION)
typedef enum {
RET_SUCCESS = 0,
RET_FAILED = -1,
RET_INVALIDPARAM = -2,
RET_OUTOFMEMORY = -3,
RET_NOTSUPPORTED = -4,
RET_UNEXPECTED = -5,
RET_NEEDREINIT = -6
} EResult;
typedef enum {
VIDEO_FORMAT_NULL = 0,
VIDEO_FORMAT_RGB = 1,
VIDEO_FORMAT_RGBA = 2,
VIDEO_FORMAT_RGB555 = 3,
VIDEO_FORMAT_RGB565 = 4,
VIDEO_FORMAT_BGR = 5,
VIDEO_FORMAT_BGRA = 6,
VIDEO_FORMAT_ABGR = 7,
VIDEO_FORMAT_ARGB = 8,
VIDEO_FORMAT_YUY2 = 20,
VIDEO_FORMAT_YVYU = 21,
VIDEO_FORMAT_UYVY = 22,
VIDEO_FORMAT_I420 = 23,
VIDEO_FORMAT_YV12 = 24,
VIDEO_FORMAT_INTERNAL = 25,
VIDEO_FORMAT_NV12 = 26,
VIDEO_FORMAT_I422 = 27,
VIDEO_FORMAT_I444 = 28,
VIDEO_FORMAT_YUYV = 20,
VIDEO_FORMAT_RGB24 = 1,
VIDEO_FORMAT_RGB32 = 2,
VIDEO_FORMAT_RGB24_INV = 5,
VIDEO_FORMAT_RGB32_INV = 6,
VIDEO_FORMAT_RGB555_INV = 7,
VIDEO_FORMAT_RGB565_INV = 8,
VIDEO_FORMAT_YUV2 = 21,
VIDEO_FORMAT_420 = 23,
VIDEO_FORMAT_VFlip = 0x80000000
} EVideoFormat;
typedef enum {
BUFFER_HOSTMEM = 0,
BUFFER_SURFACE
} EPixMapBufferProperty;
typedef struct {
int iRectTop;
int iRectLeft;
int iRectWidth;
int iRectHeight;
} SRect;
typedef struct {
void* pPixel[3];
int iSizeInBits;
int iStride[3];
SRect sRect;
EVideoFormat eFormat;
EPixMapBufferProperty eProperty;} SPixMap;
typedef enum {
METHOD_NULL = 0,
METHOD_COLORSPACE_CONVERT , METHOD_DENOISE ,
METHOD_SCENE_CHANGE_DETECTION_VIDEO ,
METHOD_SCENE_CHANGE_DETECTION_SCREEN ,
METHOD_DOWNSAMPLE ,
METHOD_VAA_STATISTICS ,
METHOD_BACKGROUND_DETECTION ,
METHOD_ADAPTIVE_QUANT ,
METHOD_COMPLEXITY_ANALYSIS ,
METHOD_COMPLEXITY_ANALYSIS_SCREEN,
METHOD_IMAGE_ROTATE ,
METHOD_SCROLL_DETECTION,
METHOD_MASK
} EMethods;
typedef enum {
SIMILAR_SCENE, MEDIUM_CHANGED_SCENE, LARGE_CHANGED_SCENE } ESceneChangeIdc;
typedef enum {
NO_STATIC, COLLOCATED_STATIC, SCROLLED_STATIC, BLOCK_STATIC_IDC_ALL
} EStaticBlockIdc;
typedef struct {
SRect sMaskRect;
bool bMaskInfoAvailable;
int iScrollMvX;
int iScrollMvY;
bool bScrollDetectFlag; } SScrollDetectionParam;
typedef struct {
ESceneChangeIdc eSceneChangeIdc; int iMotionBlockNum; long long iFrameComplexity; unsigned char* pStaticBlockIdc; SScrollDetectionParam sScrollResult; } SSceneChangeResult;
typedef struct {
unsigned char* pCurY; unsigned char* pRefY; int (*pSad8x8)[4]; int* pSsd16x16; int* pSum16x16; int* pSumOfSquare16x16; int (*pSumOfDiff8x8)[4];
unsigned char (*pMad8x8)[4];
int iFrameSad; } SVAACalcResult;
typedef struct {
int iCalcVar;
int iCalcBgd;
int iCalcSsd;
int iReserved;
SVAACalcResult* pCalcResult;
} SVAACalcParam;
typedef struct {
signed char* pBackgroundMbFlag;
SVAACalcResult* pCalcRes;
} SBGDInterface;
typedef enum {
AQ_QUALITY_MODE, AQ_BITRATE_MODE } EAQModes;
typedef struct {
unsigned short uiMotionIndex;
unsigned short uiTextureIndex;
} SMotionTextureUnit;
typedef struct {
int iAdaptiveQuantMode; SVAACalcResult* pCalcResult;
SMotionTextureUnit* pMotionTextureUnit;
signed char* pMotionTextureIndexToDeltaQp;
int iAverMotionTextureIndexToDeltaQp; } SAdaptiveQuantizationParam;
typedef enum {
FRAME_SAD = 0,
GOM_SAD = -1,
GOM_VAR = -2
} EComplexityAnalysisMode;
typedef struct {
int iComplexityAnalysisMode;
int iCalcBgd;
int iMbNumInGom;
long long iFrameComplexity;
int* pGomComplexity;
int* pGomForegroundBlockNum;
signed char* pBackgroundMbFlag;
unsigned int* uiRefMbType;
SVAACalcResult* pCalcResult;
} SComplexityAnalysisParam;
typedef struct {
int iMbRowInGom;
int* pGomComplexity;
int iGomNumInFrame;
long long iFrameComplexity; int iIdrFlag;
SScrollDetectionParam sScrollResult;
} SComplexityAnalysisScreenParam;
typedef struct {
void* pCtx;
EResult (*Init) (void* pCtx, int iType, void* pCfg);
EResult (*Uninit) (void* pCtx, int iType);
EResult (*Flush) (void* pCtx, int iType);
EResult (*Process) (void* pCtx, int iType, SPixMap* pSrc, SPixMap* dst);
EResult (*Get) (void* pCtx, int iType, void* pParam);
EResult (*Set) (void* pCtx, int iType, void* pParam);
EResult (*SpecialFeature) (void* pCtx, int iType, void* pIn, void* pOut);
} IWelsVPc;
#if defined(__cplusplus) && !defined(CINTERFACE)
class IWelsVP {
public:
virtual ~IWelsVP() {}
public:
virtual EResult Init (int iType, void* pCfg) = 0;
virtual EResult Uninit (int iType) = 0;
virtual EResult Flush (int iType) = 0;
virtual EResult Process (int iType, SPixMap* pSrc, SPixMap* dst) = 0;
virtual EResult Get (int iType, void* pParam) = 0;
virtual EResult Set (int iType, void* pParam) = 0;
virtual EResult SpecialFeature (int iType, void* pIn, void* pOut) = 0;
};
#define IWelsVPFunc_Init(p, a, b) (p)->Init(a, b)
#define IWelsVPFunc_Uninit(p, a) (p)->Uninit(a)
#define IWelsVPFunc_Flush(p, a) (p)->Flush(a)
#define IWelsVPFunc_Process(p, a, b, c) (p)->Process(a, b, c)
#define IWelsVPFunc_Get(p, a, b) (p)->Get(a, b)
#define IWelsVPFunc_Set(p, a, b) (p)->Set(a, b)
#define IWelsVPFunc_SpecialFeature(p, a, b, c) (p)->SpecialFeature(a, b, c)
#define WELSVP_INTERFACE_VERION (0x8000 + (WELSVP_VERSION & 0x7fff))
#define WELSVP_EXTERNC_BEGIN extern "C" {
#define WELSVP_EXTERNC_END }
#else
#define IWelsVPFunc_Init(p, a, b) (p)->Init(p->h, a, b)
#define IWelsVPFunc_Uninit(p, a) (p)->Uninit(p->h, a)
#define IWelsVPFunc_Flush(p, a) (p)->Flush(p->h, a)
#define IWelsVPFunc_Process(p, a, b, c) (p)->Process(p->h, a, b, c)
#define IWelsVPFunc_Get(p, a, b) (p)->Get(p->h, a, b)
#define IWelsVPFunc_Set(p, a, b) (p)->Set(p->h, a, b)
#define IWelsVPFunc_SpecialFeature(p, a, b, c) (p)->SpecialFeature(p->h, a, b, c)
#define WELSVP_INTERFACE_VERION (0x0001 + (WELSVP_VERSION & 0x7fff))
#define WELSVP_EXTERNC_BEGIN
#define WELSVP_EXTERNC_END
#endif
WELSVP_EXTERNC_BEGIN
EResult WelsCreateVpInterface (void** ppCtx, int iVersion );
EResult WelsDestroyVpInterface (void* pCtx , int iVersion );
WELSVP_EXTERNC_END
#endif