Add function define and init for SCC hash function

This commit is contained in:
zhiliang wang 2014-08-14 14:20:07 +08:00
parent 186f4c0d29
commit dc833e19f4
3 changed files with 14 additions and 2 deletions

View File

@ -236,6 +236,10 @@ void WelsDiamondCrossSearch (SWelsFuncPtrList* pFuncList, SWelsME* pMe, SSlice*
#define FMESWITCH_DEFAULT_GOODFRAME_NUM (2)
#define FMESWITCH_MBSAD_THRESHOLD 30 // empirically set.
void InitializeHashforFeature_c (uint32_t* pTimesOfFeatureValue, uint16_t* pBuf, const int32_t kiListSize,
uint16_t** pLocationOfFeature, uint16_t** pFeatureValuePointerList);
void FillQpelLocationByFeatureValue_c (uint16_t* pFeatureOfBlock, const int32_t kiWidth, const int32_t kiHeight,
uint16_t** pFeatureValuePointerList);
int32_t SumOf8x8SingleBlock_c (uint8_t* pRef, const int32_t kiRefStride);
int32_t SumOf16x16SingleBlock_c (uint8_t* pRef, const int32_t kiRefStride);
void SumOf8x8BlockOfFrame_c (uint8_t* pRefPicture, const int32_t kiWidth, const int32_t kiHeight,

View File

@ -159,6 +159,10 @@ typedef void (*PLineFullSearchFunc) (SWelsFuncPtrList* pFuncList, SWelsME* pMe,
const int32_t kiEncStride, const int32_t kiRefStride,
const int32_t kiMinPos, const int32_t kiMaxPos,
const bool bVerticalSearch);
typedef void (*PInitializeHashforFeatureFunc) (uint32_t* pTimesOfFeatureValue, uint16_t* pBuf, const int32_t kiListSize,
uint16_t** pLocationOfFeature, uint16_t** pFeatureValuePointerList);
typedef void (*PFillQpelLocationByFeatureValueFunc) (uint16_t* pFeatureOfBlock, const int32_t kiWidth, const int32_t kiHeight,
uint16_t** pFeatureValuePointerList);
typedef void (*PCalculateBlockFeatureOfFrame) (uint8_t* pRef, const int32_t kiWidth, const int32_t kiHeight,
const int32_t kiRefStride,
uint16_t* pFeatureOfBlock, uint32_t pTimesOfFeatureValue[]);
@ -227,6 +231,8 @@ struct TagWelsFuncPointerList {
PCalculateSatdFunc pfCalculateSatd;
PCheckDirectionalMv pfCheckDirectionalMv;
PInitializeHashforFeatureFunc pfInitializeHashforFeature;
PFillQpelLocationByFeatureValueFunc pfFillQpelLocationByFeatureValue;
PCalculateBlockFeatureOfFrame pfCalculateBlockFeatureOfFrame[2];//0 - for 8x8, 1 for 16x16
PCalculateSingleBlockFeature pfCalculateSingleBlockFeature[2];//0 - for 8x8, 1 for 16x16
PLineFullSearchFunc pfVerticalFullSearch;

View File

@ -97,6 +97,8 @@ void WelsInitMeFunc (SWelsFuncPtrList* pFuncList, uint32_t uiCpuFlag, bool bScre
#endif
//for feature search
pFuncList->pfInitializeHashforFeature = InitializeHashforFeature_c;
pFuncList->pfFillQpelLocationByFeatureValue = FillQpelLocationByFeatureValue_c;
pFuncList->pfCalculateBlockFeatureOfFrame[0] = SumOf8x8BlockOfFrame_c;
pFuncList->pfCalculateBlockFeatureOfFrame[1] = SumOf16x16BlockOfFrame_c;
//TODO: it is possible to differentiate width that is times of 8, so as to accelerate the speed when width is times of 8?
@ -812,11 +814,11 @@ bool CalculateFeatureOfBlock (SWelsFuncPtrList* pFunc, SPicture* pRef,
pTimesOfFeatureValue);
//assign pLocationOfFeature pointer
InitializeHashforFeature_c (pTimesOfFeatureValue, pBuf, kiActualListSize,
pFunc->pfInitializeHashforFeature (pTimesOfFeatureValue, pBuf, kiActualListSize,
pLocationOfFeature, pScreenBlockFeatureStorage->pFeatureValuePointerList);
//assign each pixel's pLocationOfFeature
FillQpelLocationByFeatureValue_c (pFeatureOfBlock, iWidth, kiHeight, pScreenBlockFeatureStorage->pFeatureValuePointerList);
pFunc->pfFillQpelLocationByFeatureValue (pFeatureOfBlock, iWidth, kiHeight, pScreenBlockFeatureStorage->pFeatureValuePointerList);
return true;
}