Merge pull request #587 from sijchen/me_merge83

[Encoder ME] Adjust function interface
This commit is contained in:
Licai Guo 2014-03-26 17:18:37 +08:00
commit 12b5dcff02
3 changed files with 22 additions and 6 deletions

View File

@ -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,

View File

@ -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<SWelsFuncPtrList *>(pFunc);
SWelsME *pMe = static_cast<SWelsME *>(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<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;
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,

View File

@ -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,