replace conditional judgements with function pointer for acceleration
This commit is contained in:
parent
2da0ce6451
commit
303bf77e42
@ -122,6 +122,7 @@ uint8_t* pHalfPixHV;
|
||||
uint8_t* pQuarPixBest;
|
||||
uint8_t* pQuarPixTmp;
|
||||
|
||||
PCopyFunc pfCopyBlockByMode;
|
||||
} SMeRefinePointer;
|
||||
|
||||
void FillNeighborCacheIntra (SMbCache* pMbCache, SMB* pCurMb, int32_t iMbWidth/*, bool constrained_intra_pred_flag*/);
|
||||
|
@ -765,17 +765,8 @@ void MeRefineFracPixel (sWelsEncCtx* pEncCtx, uint8_t* pMemPredInterMb, SWelsME*
|
||||
pBestPredInter = pRef;
|
||||
iInterBlk4Stride = kiStrideRef;
|
||||
}
|
||||
if (MB_WIDTH_LUMA == iWidth && MB_HEIGHT_LUMA == iHeight) { //P16x16
|
||||
pFunc->pfCopy16x16NotAligned (pMemPredInterMb, MB_WIDTH_LUMA, pBestPredInter,
|
||||
iInterBlk4Stride); // dst can be align with 16 bytes, but not sure at pSrc, 12/29/2011
|
||||
} else if (MB_WIDTH_LUMA == iWidth && MB_HEIGHT_CHROMA == iHeight) { //P16x8
|
||||
pFunc->pfCopy16x8NotAligned (pMemPredInterMb, MB_WIDTH_LUMA, pBestPredInter,
|
||||
iInterBlk4Stride); // dst can be align with 16 bytes, but not sure at pSrc, 12/29/2011
|
||||
} else if (MB_WIDTH_CHROMA == iWidth && MB_HEIGHT_LUMA == iHeight) { //P8x16
|
||||
pFunc->pfCopy8x16Aligned (pMemPredInterMb, MB_WIDTH_LUMA, pBestPredInter, iInterBlk4Stride);
|
||||
} else { //P8x8
|
||||
pFunc->pfCopy8x8Aligned (pMemPredInterMb, MB_WIDTH_LUMA, pBestPredInter, iInterBlk4Stride);
|
||||
}
|
||||
pMeRefine->pfCopyBlockByMode(pMemPredInterMb, MB_WIDTH_LUMA, pBestPredInter,
|
||||
iInterBlk4Stride);
|
||||
}
|
||||
|
||||
void InitBlkStrideWithRef (int32_t* pBlkStride, const int32_t kiStrideRef) {
|
||||
|
@ -1448,6 +1448,7 @@ void WelsMdInterMbRefinement (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SMB* pCurM
|
||||
case MB_TYPE_16x16:
|
||||
//luma
|
||||
InitMeRefinePointer (&sMeRefine, pMbCache, 0);
|
||||
sMeRefine.pfCopyBlockByMode = pEncCtx->pFuncList->pfCopy16x16NotAligned; // dst can be align with 16 bytes, but not sure at pSrc, 12/29/2011
|
||||
MeRefineFracPixel (pEncCtx, pDstLuma, &pWelsMd->sMe.sMe16x16, &sMeRefine, 16, 16);
|
||||
UpdateP16x16MotionInfo (pMbCache, pCurMb, pWelsMd->uiRef, &pWelsMd->sMe.sMe16x16.sMv);
|
||||
|
||||
@ -1474,6 +1475,7 @@ void WelsMdInterMbRefinement (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SMB* pCurM
|
||||
|
||||
case MB_TYPE_16x8:
|
||||
iPixStride = 0;
|
||||
sMeRefine.pfCopyBlockByMode = pEncCtx->pFuncList->pfCopy16x8NotAligned; // dst can be align with 16 bytes, but not sure at pSrc, 12/29/2011
|
||||
for (i = 0; i < 2; i++) {
|
||||
//luma
|
||||
iIdx = i << 3;
|
||||
@ -1503,6 +1505,7 @@ void WelsMdInterMbRefinement (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SMB* pCurM
|
||||
|
||||
case MB_TYPE_8x16:
|
||||
iPixStride = 0;
|
||||
sMeRefine.pfCopyBlockByMode = pEncCtx->pFuncList->pfCopy8x16Aligned;
|
||||
for (i = 0; i < 2; i++) {
|
||||
//luma
|
||||
iIdx = i << 2;
|
||||
@ -1528,8 +1531,8 @@ void WelsMdInterMbRefinement (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SMB* pCurM
|
||||
pEncCtx->pFuncList->sMcFuncs.pMcChromaFunc (pTmpRefCr, iLineSizeRefUV, pTmpDstCr, 8, pMv->iMvX, pMv->iMvY, 4, 8); //Cr
|
||||
}
|
||||
break;
|
||||
|
||||
case MB_TYPE_8x8:
|
||||
sMeRefine.pfCopyBlockByMode = pEncCtx->pFuncList->pfCopy8x8Aligned;
|
||||
for (i = 0; i < 4; i++) {
|
||||
int32_t iBlk8Idx = i << 2; //0, 4, 8, 12
|
||||
int32_t iBlk4X, iBlk4Y;
|
||||
|
Loading…
x
Reference in New Issue
Block a user