shithub: openh264

Download patch

ref: 26624bbfdb03c876ab78b2b5dd0e5921c7d484e8
parent: e4a9c7f8e41b1ffd2fefe6f91b65e4f74b316349
author: Martin Storsjö <[email protected]>
date: Sun May 4 14:00:36 EDT 2014

Use the proper type in function parameters instead of void pointers

--- a/codec/encoder/core/inc/svc_motion_estimate.h
+++ b/codec/encoder/core/inc/svc_motion_estimate.h
@@ -193,7 +193,7 @@
                       int32_t& iBestSadCost);
 
 // Cross Search Basics
-void LineFullSearch_c(  void *pFunc, void *vpMe,
+void LineFullSearch_c(  SWelsFuncPtrList *pFuncList, SWelsME *pMe,
                         uint16_t* pMvdTable, const int32_t kiFixedMvd,
                         const int32_t kiEncStride, const int32_t kiRefStride,
                         const int32_t kiMinPos, const int32_t kiMaxPos,
@@ -205,12 +205,12 @@
 uint32_t SampleSad16x16Hor8_sse41 (uint8_t*, int32_t, uint8_t*, int32_t, uint16_t*, int32_t*);
 }
 
-void VerticalFullSearchUsingSSE41( void *pFunc, void *vpMe,
+void VerticalFullSearchUsingSSE41( SWelsFuncPtrList *pFuncList, SWelsME *pMe,
                             uint16_t* pMvdTable, const int32_t kiFixedMvd,
                             const int32_t kiEncStride, const int32_t kiRefStride,
                           const int32_t kiMinPos, const int32_t kiMaxPos,
                           const bool bVerticalSearch );
-void HorizontalFullSearchUsingSSE41( void *pFunc, void *vpMe,
+void HorizontalFullSearchUsingSSE41( SWelsFuncPtrList *pFuncList, SWelsME *pMe,
                                       uint16_t* pMvdTable, const int32_t kiFixedMvd,
                                       const int32_t kiEncStride, const int32_t kiRefStride,
                                       const int32_t kiMinPos, const int32_t kiMaxPos,
--- a/codec/encoder/core/inc/wels_func_ptr_def.h
+++ b/codec/encoder/core/inc/wels_func_ptr_def.h
@@ -49,6 +49,8 @@
 
 typedef struct TagWelsFuncPointerList SWelsFuncPtrList;
 
+typedef struct TagWelsME SWelsME;
+
 typedef void (*PSetMemoryZero) (void* pDst, int32_t iSize);
 typedef void (*PDctFunc) (int16_t* pDct, uint8_t* pSample1, int32_t iStride1, uint8_t* pSample2, int32_t iStride2);
 
@@ -148,7 +150,7 @@
 typedef bool (*PCheckDirectionalMv) (PSampleSadSatdCostFunc pSad, void * vpMe,
                       const SMVUnitXY ksMinMv, const SMVUnitXY ksMaxMv, const int32_t kiEncStride, const int32_t kiRefStride,
                       int32_t& iBestSadCost);
-typedef void (*PLineFullSearchFunc) (	void *pFunc, void *vpMe,
+typedef void (*PLineFullSearchFunc) (	SWelsFuncPtrList *pFuncList, SWelsME *pMe,
 													uint16_t* pMvdTable, const int32_t kiFixedMvd,
 													const int32_t kiEncStride, const int32_t kiRefStride,
 													const int32_t kiMinPos, const int32_t kiMaxPos,
--- a/codec/encoder/core/src/svc_motion_estimate.cpp
+++ b/codec/encoder/core/src/svc_motion_estimate.cpp
@@ -339,13 +339,11 @@
     pMvd += 4;
   }
 }
-void VerticalFullSearchUsingSSE41( void *pFunc, void *vpMe,
+void VerticalFullSearchUsingSSE41( SWelsFuncPtrList *pFuncList, SWelsME *pMe,
                             uint16_t* pMvdTable, const int32_t kiFixedMvd,
                             const int32_t kiEncStride, const int32_t kiRefStride,
                           const int32_t kiMinPos, const int32_t kiMaxPos,
                           const bool bVerticalSearch ) {
-  SWelsFuncPtrList *pFuncList      = static_cast<SWelsFuncPtrList *>(pFunc);
-  SWelsME *pMe                        = static_cast<SWelsME *>(vpMe);
   uint8_t*  kpEncMb = pMe->pEncMb;
   const int32_t kiCurMeBlockPix = pMe->iCurMeBlockPixY;
   uint8_t* pRef         = &pMe->pColoRefMb[(kiMinPos - kiCurMeBlockPix)*kiRefStride];
@@ -410,14 +408,12 @@
   }
 }
 
-void HorizontalFullSearchUsingSSE41( void *pFunc, void *vpMe,
+void HorizontalFullSearchUsingSSE41( SWelsFuncPtrList *pFuncList, SWelsME *pMe,
                                       uint16_t* pMvdTable, const int32_t kiFixedMvd,
                                       const int32_t kiEncStride, const int32_t kiRefStride,
                                       const int32_t kiMinPos, const int32_t kiMaxPos,
                                       const bool bVerticalSearch )
 {
-  SWelsFuncPtrList *pFuncList      = static_cast<SWelsFuncPtrList *>(pFunc);
-  SWelsME *pMe                        = static_cast<SWelsME *>(vpMe);
   uint8_t *kpEncMb = pMe->pEncMb;
   const int32_t kiCurMeBlockPix = pMe->iCurMeBlockPixX;
   uint8_t *pRef         = &pMe->pColoRefMb[kiMinPos - kiCurMeBlockPix];
@@ -465,13 +461,11 @@
   }
 }
 #endif
-void LineFullSearch_c( void *pFunc, void *vpMe,
+void LineFullSearch_c( SWelsFuncPtrList *pFuncList, SWelsME *pMe,
              uint16_t* pMvdTable, const int32_t kiFixedMvd,
              const int32_t kiEncStride, const int32_t kiRefStride,
              const int32_t kiMinPos, const int32_t kiMaxPos,
                           const bool bVerticalSearch ) {
-  SWelsFuncPtrList *pFuncList      = static_cast<SWelsFuncPtrList *>(pFunc);
-  SWelsME *pMe                            = static_cast<SWelsME *>(vpMe);
   PSampleSadSatdCostFunc pSad = pFuncList->sSampleDealingFuncs.pfSampleSad[pMe->uiBlockSize];
   const int32_t kiCurMeBlockPix  = bVerticalSearch?pMe->iCurMeBlockPixY:pMe->iCurMeBlockPixX;
   const int32_t kiStride = bVerticalSearch?kiRefStride:1;