diff --git a/codec/encoder/core/inc/svc_motion_estimate.h b/codec/encoder/core/inc/svc_motion_estimate.h index 1d339477..c9289757 100644 --- a/codec/encoder/core/inc/svc_motion_estimate.h +++ b/codec/encoder/core/inc/svc_motion_estimate.h @@ -147,11 +147,16 @@ bool CheckDirectionalMvFalse(PSampleSadSatdCostFunc pSad, void * vpMe, const SMVUnitXY ksMinMv, const SMVUnitXY ksMaxMv, const int32_t kiEncStride, const int32_t kiRefStride, int32_t& iBestSadCost); -void LineFullSearch_c( PSampleSadSatdCostFunc pSad, void *vpMe, +void LineFullSearch_c( void *pFunc, void *vpMe, 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 VerticalFullSearchUsingSSE41( void *pFunc, void *vpMe, + 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 WelsMotionCrossSearch(SWelsFuncPtrList *pFuncList, SDqLayer* pCurLayer, SWelsME * pMe, const SSlice* pSlice); inline void SetMvWithinIntegerMvRange( const int32_t kiMbWidth, const int32_t kiMbHeight, const int32_t kiMbX, const int32_t kiMbY, diff --git a/codec/encoder/core/src/svc_motion_estimate.cpp b/codec/encoder/core/src/svc_motion_estimate.cpp index a11af6c3..68781a81 100644 --- a/codec/encoder/core/src/svc_motion_estimate.cpp +++ b/codec/encoder/core/src/svc_motion_estimate.cpp @@ -278,13 +278,24 @@ bool CheckDirectionalMvFalse(PSampleSadSatdCostFunc pSad, void * vpMe, return false; } -void LineFullSearch_c( PSampleSadSatdCostFunc pSad, void *vpMe, +void VerticalFullSearchUsingSSE41( void *pFunc, void *vpMe, + 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(pFunc); + SWelsME *pMe = static_cast(vpMe); +} +void LineFullSearch_c( void *pFunc, void *vpMe, 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(pFunc); SWelsME *pMe = static_cast(vpMe); + PSampleSadSatdCostFunc pSad = pFuncList->sSampleDealingFuncs.pfSampleSad[pMe->uiBlockSize]; const int32_t kiCurMeBlockPix = bVerticalSearch?pMe->iCurMeBlockPixY:pMe->iCurMeBlockPixX; const int32_t kiStride = bVerticalSearch?kiRefStride:1; uint8_t* pRef = &pMe->pColoRefMb[(kiMinPos - kiCurMeBlockPix)*kiStride]; @@ -328,7 +339,7 @@ void WelsMotionCrossSearch(SWelsFuncPtrList *pFuncList, SDqLayer* pCurLayer, SW uint16_t* pMvdCostY = pMe->pMvdCost - iCurMeBlockQpelPixY - pMe->sMvp.iMvY;//do the offset here instead of in the search //vertical search - LineFullSearch_c( pFuncList->sSampleDealingFuncs.pfSampleSad[pMe->uiBlockSize], pMe, + LineFullSearch_c( pFuncList, pMe, pMvdCostY, pMvdCostX[ iCurMeBlockQpelPixX ], kiEncStride, kiRefStride, iCurMeBlockPixY + pSlice->sMvStartMin.iMvY, @@ -336,7 +347,7 @@ void WelsMotionCrossSearch(SWelsFuncPtrList *pFuncList, SDqLayer* pCurLayer, SW //horizontal search if (pMe->uiSadCost >= pMe->uiSadCostThreshold) { - LineFullSearch_c( pFuncList->sSampleDealingFuncs.pfSampleSad[pMe->uiBlockSize], pMe, + LineFullSearch_c( pFuncList, pMe, pMvdCostX, pMvdCostY[ iCurMeBlockQpelPixY ], kiEncStride, kiRefStride, iCurMeBlockPixX + pSlice->sMvStartMin.iMvX, diff --git a/test/encoder/EncUT_MotionEstimate.cpp b/test/encoder/EncUT_MotionEstimate.cpp index 8c18adb2..dd388f3d 100644 --- a/test/encoder/EncUT_MotionEstimate.cpp +++ b/test/encoder/EncUT_MotionEstimate.cpp @@ -170,7 +170,7 @@ TEST_F(MotionEstimateTest, TestVerticalSearch) const int32_t iCurMeBlockQpelPixY = ((iCurMeBlockPixY)<<2); uint16_t* pMvdCostX = sMe.pMvdCost - iCurMeBlockQpelPixX - sMe.sMvp.iMvX; //do the offset here uint16_t* pMvdCostY = sMe.pMvdCost - iCurMeBlockQpelPixY - sMe.sMvp.iMvY; - LineFullSearch_c ( sFuncList.sSampleDealingFuncs.pfSampleSad[sMe.uiBlockSize], &sMe, + LineFullSearch_c ( &sFuncList, &sMe, pMvdCostY, pMvdCostX[ iCurMeBlockQpelPixX ], m_iMaxSearchBlock, m_iWidth, INTPEL_NEEDED_MARGIN, @@ -232,7 +232,7 @@ TEST_F(MotionEstimateTest, TestHorizontalSearch) const int32_t iCurMeBlockQpelPixY = ((iCurMeBlockPixY)<<2); uint16_t* pMvdCostX = sMe.pMvdCost - iCurMeBlockQpelPixX - sMe.sMvp.iMvX; //do the offset here uint16_t* pMvdCostY = sMe.pMvdCost - iCurMeBlockQpelPixY - sMe.sMvp.iMvY; - LineFullSearch_c ( sFuncList.sSampleDealingFuncs.pfSampleSad[sMe.uiBlockSize], &sMe, + LineFullSearch_c ( &sFuncList, &sMe, pMvdCostX, pMvdCostY[ iCurMeBlockQpelPixY ], m_iMaxSearchBlock, m_iWidth, INTPEL_NEEDED_MARGIN,