From dc833e19f42eb3d6ddce673cb34a628dea2032d6 Mon Sep 17 00:00:00 2001 From: zhiliang wang Date: Thu, 14 Aug 2014 14:20:07 +0800 Subject: [PATCH] Add function define and init for SCC hash function --- codec/encoder/core/inc/svc_motion_estimate.h | 4 ++++ codec/encoder/core/inc/wels_func_ptr_def.h | 6 ++++++ codec/encoder/core/src/svc_motion_estimate.cpp | 6 ++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/codec/encoder/core/inc/svc_motion_estimate.h b/codec/encoder/core/inc/svc_motion_estimate.h index 702251c9..23c6865a 100644 --- a/codec/encoder/core/inc/svc_motion_estimate.h +++ b/codec/encoder/core/inc/svc_motion_estimate.h @@ -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, diff --git a/codec/encoder/core/inc/wels_func_ptr_def.h b/codec/encoder/core/inc/wels_func_ptr_def.h index 6d9482e6..bf498eae 100644 --- a/codec/encoder/core/inc/wels_func_ptr_def.h +++ b/codec/encoder/core/inc/wels_func_ptr_def.h @@ -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; diff --git a/codec/encoder/core/src/svc_motion_estimate.cpp b/codec/encoder/core/src/svc_motion_estimate.cpp index 51fa9fa3..a86b07bb 100644 --- a/codec/encoder/core/src/svc_motion_estimate.cpp +++ b/codec/encoder/core/src/svc_motion_estimate.cpp @@ -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; }