shithub: openh264

Download patch

ref: dc833e19f42eb3d6ddce673cb34a628dea2032d6
parent: 186f4c0d29708590af145d8dfdff87b32b88a5b2
author: zhiliang wang <[email protected]>
date: Thu Aug 14 10:20:07 EDT 2014

Add function define and init for SCC hash function

--- a/codec/encoder/core/inc/svc_motion_estimate.h
+++ b/codec/encoder/core/inc/svc_motion_estimate.h
@@ -236,6 +236,10 @@
 #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,
--- a/codec/encoder/core/inc/wels_func_ptr_def.h
+++ b/codec/encoder/core/inc/wels_func_ptr_def.h
@@ -159,6 +159,10 @@
                                      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 @@
   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;
--- a/codec/encoder/core/src/svc_motion_estimate.cpp
+++ b/codec/encoder/core/src/svc_motion_estimate.cpp
@@ -97,6 +97,8 @@
 #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 @@
       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;
 }