Showing the changes to codec/decoder/core/src/rec_mb.cpp (1 of 29 files). Show all
Unified · Split
| @@ -44,20 +44,20 @@ · 43 unmodified lines | |||
| 44 | 44 | ||
| 45 | namespace WelsDec { | 45 | namespace WelsDec { |
| 46 | 46 | ||
| 47 | void WelsFillRecNeededMbInfo (PWelsDecoderContext pCtx, bool bOutput, PDqLayer pCurLayer) { | 47 | void WelsFillRecNeededMbInfo (PWelsDecoderContext pCtx, bool bOutput, PDqLayer pCurDqLayer) { |
| 48 | PPicture pCurPic = pCtx->pDec; | 48 | PPicture pCurPic = pCtx->pDec; |
| 49 | int32_t iLumaStride = pCurPic->iLinesize[0]; | 49 | int32_t iLumaStride = pCurPic->iLinesize[0]; |
| 50 | int32_t iChromaStride = pCurPic->iLinesize[1]; | 50 | int32_t iChromaStride = pCurPic->iLinesize[1]; |
| 51 | int32_t iMbX = pCurLayer->iMbX; | 51 | int32_t iMbX = pCurDqLayer->iMbX; |
| 52 | int32_t iMbY = pCurLayer->iMbY; | 52 | int32_t iMbY = pCurDqLayer->iMbY; |
| 53 | 53 | ||
| 54 | pCurLayer->iLumaStride = iLumaStride; | 54 | pCurDqLayer->iLumaStride = iLumaStride; |
| 55 | pCurLayer->iChromaStride = iChromaStride; | 55 | pCurDqLayer->iChromaStride = iChromaStride; |
| 56 | 56 | ||
| 57 | if (bOutput) { | 57 | if (bOutput) { |
| 58 | pCurLayer->pPred[0] = pCurPic->pData[0] + ((iMbY * iLumaStride + iMbX) << 4); | 58 | pCurDqLayer->pPred[0] = pCurPic->pData[0] + ((iMbY * iLumaStride + iMbX) << 4); |
| 59 | pCurLayer->pPred[1] = pCurPic->pData[1] + ((iMbY * iChromaStride + iMbX) << 3); | 59 | pCurDqLayer->pPred[1] = pCurPic->pData[1] + ((iMbY * iChromaStride + iMbX) << 3); |
| 60 | pCurLayer->pPred[2] = pCurPic->pData[2] + ((iMbY * iChromaStride + iMbX) << 3); | 60 | pCurDqLayer->pPred[2] = pCurPic->pData[2] + ((iMbY * iChromaStride + iMbX) << 3); |
| 61 | } | 61 | } |
| 62 | } | 62 | } |
| 63 | 63 | ||
| @@ -446,7 +446,7 @@ int32_t GetInterPred (uint8_t* pPredY, uint8_t* pPredCb, uint8_t* pPredCr, PWels · 382 unmodified lines | |||
| 446 | 446 | ||
| 447 | int16_t iMVs[2] = {0}; | 447 | int16_t iMVs[2] = {0}; |
| 448 | 448 | ||
| 449 | uint32_t iMBType = pCurDqLayer->pMbType[iMBXY]; | 449 | uint32_t iMBType = pCurDqLayer->pDec->pMbType[iMBXY]; |
| 450 | 450 | ||
| 451 | int32_t iMBOffsetX = pCurDqLayer->iMbX << 4; | 451 | int32_t iMBOffsetX = pCurDqLayer->iMbX << 4; |
| 452 | int32_t iMBOffsetY = pCurDqLayer->iMbY << 4; | 452 | int32_t iMBOffsetY = pCurDqLayer->iMbY << 4; |
| @@ -471,60 +471,60 @@ int32_t GetInterPred (uint8_t* pPredY, uint8_t* pPredCb, uint8_t* pPredCr, PWels · 18 unmodified lines | |||
| 471 | switch (iMBType) { | 471 | switch (iMBType) { |
| 472 | case MB_TYPE_SKIP: | 472 | case MB_TYPE_SKIP: |
| 473 | case MB_TYPE_16x16: | 473 | case MB_TYPE_16x16: |
| 474 | iMVs[0] = pCurDqLayer->pMv[0][iMBXY][0][0]; | 474 | iMVs[0] = pCurDqLayer->pDec->pMv[0][iMBXY][0][0]; |
| 475 | iMVs[1] = pCurDqLayer->pMv[0][iMBXY][0][1]; | 475 | iMVs[1] = pCurDqLayer->pDec->pMv[0][iMBXY][0][1]; |
| 476 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[0][iMBXY], 0, LIST_0)); | 476 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pDec->pRefIndex[0][iMBXY], 0, LIST_0)); |
| 477 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs); | 477 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs); |
| 478 | 478 | ||
| 479 | if (pCurDqLayer->bUseWeightPredictionFlag) { | 479 | if (pCurDqLayer->bUseWeightPredictionFlag) { |
| 480 | iRefIndex = pCurDqLayer->pRefIndex[0][iMBXY][0]; | 480 | iRefIndex = pCurDqLayer->pDec->pRefIndex[0][iMBXY][0]; |
| 481 | WeightPrediction (pCurDqLayer, &pMCRefMem, LIST_0, iRefIndex, 16, 16); | 481 | WeightPrediction (pCurDqLayer, &pMCRefMem, LIST_0, iRefIndex, 16, 16); |
| 482 | } | 482 | } |
| 483 | break; | 483 | break; |
| 484 | case MB_TYPE_16x8: | 484 | case MB_TYPE_16x8: |
| 485 | iMVs[0] = pCurDqLayer->pMv[0][iMBXY][0][0]; | 485 | iMVs[0] = pCurDqLayer->pDec->pMv[0][iMBXY][0][0]; |
| 486 | iMVs[1] = pCurDqLayer->pMv[0][iMBXY][0][1]; | 486 | iMVs[1] = pCurDqLayer->pDec->pMv[0][iMBXY][0][1]; |
| 487 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[0][iMBXY], 0, LIST_0)); | 487 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pDec->pRefIndex[0][iMBXY], 0, LIST_0)); |
| 488 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 8, iMVs); | 488 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 8, iMVs); |
| 489 | 489 | ||
| 490 | if (pCurDqLayer->bUseWeightPredictionFlag) { | 490 | if (pCurDqLayer->bUseWeightPredictionFlag) { |
| 491 | iRefIndex = pCurDqLayer->pRefIndex[0][iMBXY][0]; | 491 | iRefIndex = pCurDqLayer->pDec->pRefIndex[0][iMBXY][0]; |
| 492 | WeightPrediction (pCurDqLayer, &pMCRefMem, LIST_0, iRefIndex, 16, 8); | 492 | WeightPrediction (pCurDqLayer, &pMCRefMem, LIST_0, iRefIndex, 16, 8); |
| 493 | } | 493 | } |
| 494 | 494 | ||
| 495 | iMVs[0] = pCurDqLayer->pMv[0][iMBXY][8][0]; | 495 | iMVs[0] = pCurDqLayer->pDec->pMv[0][iMBXY][8][0]; |
| 496 | iMVs[1] = pCurDqLayer->pMv[0][iMBXY][8][1]; | 496 | iMVs[1] = pCurDqLayer->pDec->pMv[0][iMBXY][8][1]; |
| 497 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[0][iMBXY], 8, LIST_0)); | 497 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pDec->pRefIndex[0][iMBXY], 8, LIST_0)); |
| 498 | pMCRefMem.pDstY = pPredY + (iDstLineLuma << 3); | 498 | pMCRefMem.pDstY = pPredY + (iDstLineLuma << 3); |
| 499 | pMCRefMem.pDstU = pPredCb + (iDstLineChroma << 2); | 499 | pMCRefMem.pDstU = pPredCb + (iDstLineChroma << 2); |
| 500 | pMCRefMem.pDstV = pPredCr + (iDstLineChroma << 2); | 500 | pMCRefMem.pDstV = pPredCr + (iDstLineChroma << 2); |
| 501 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY + 8, pMCFunc, 16, 8, iMVs); | 501 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY + 8, pMCFunc, 16, 8, iMVs); |
| 502 | 502 | ||
| 503 | if (pCurDqLayer->bUseWeightPredictionFlag) { | 503 | if (pCurDqLayer->bUseWeightPredictionFlag) { |
| 504 | iRefIndex = pCurDqLayer->pRefIndex[0][iMBXY][8]; | 504 | iRefIndex = pCurDqLayer->pDec->pRefIndex[0][iMBXY][8]; |
| 505 | WeightPrediction (pCurDqLayer, &pMCRefMem, LIST_0, iRefIndex, 16, 8); | 505 | WeightPrediction (pCurDqLayer, &pMCRefMem, LIST_0, iRefIndex, 16, 8); |
| 506 | } | 506 | } |
| 507 | break; | 507 | break; |
| 508 | case MB_TYPE_8x16: | 508 | case MB_TYPE_8x16: |
| 509 | iMVs[0] = pCurDqLayer->pMv[0][iMBXY][0][0]; | 509 | iMVs[0] = pCurDqLayer->pDec->pMv[0][iMBXY][0][0]; |
| 510 | iMVs[1] = pCurDqLayer->pMv[0][iMBXY][0][1]; | 510 | iMVs[1] = pCurDqLayer->pDec->pMv[0][iMBXY][0][1]; |
| 511 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[0][iMBXY], 0, LIST_0)); | 511 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pDec->pRefIndex[0][iMBXY], 0, LIST_0)); |
| 512 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 8, 16, iMVs); | 512 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 8, 16, iMVs); |
| 513 | if (pCurDqLayer->bUseWeightPredictionFlag) { | 513 | if (pCurDqLayer->bUseWeightPredictionFlag) { |
| 514 | iRefIndex = pCurDqLayer->pRefIndex[0][iMBXY][0]; | 514 | iRefIndex = pCurDqLayer->pDec->pRefIndex[0][iMBXY][0]; |
| 515 | WeightPrediction (pCurDqLayer, &pMCRefMem, LIST_0, iRefIndex, 8, 16); | 515 | WeightPrediction (pCurDqLayer, &pMCRefMem, LIST_0, iRefIndex, 8, 16); |
| 516 | } | 516 | } |
| 517 | 517 | ||
| 518 | iMVs[0] = pCurDqLayer->pMv[0][iMBXY][2][0]; | 518 | iMVs[0] = pCurDqLayer->pDec->pMv[0][iMBXY][2][0]; |
| 519 | iMVs[1] = pCurDqLayer->pMv[0][iMBXY][2][1]; | 519 | iMVs[1] = pCurDqLayer->pDec->pMv[0][iMBXY][2][1]; |
| 520 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[0][iMBXY], 2, LIST_0)); | 520 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pDec->pRefIndex[0][iMBXY], 2, LIST_0)); |
| 521 | pMCRefMem.pDstY = pPredY + 8; | 521 | pMCRefMem.pDstY = pPredY + 8; |
| 522 | pMCRefMem.pDstU = pPredCb + 4; | 522 | pMCRefMem.pDstU = pPredCb + 4; |
| 523 | pMCRefMem.pDstV = pPredCr + 4; | 523 | pMCRefMem.pDstV = pPredCr + 4; |
| 524 | BaseMC (&pMCRefMem, iMBOffsetX + 8, iMBOffsetY, pMCFunc, 8, 16, iMVs); | 524 | BaseMC (&pMCRefMem, iMBOffsetX + 8, iMBOffsetY, pMCFunc, 8, 16, iMVs); |
| 525 | 525 | ||
| 526 | if (pCurDqLayer->bUseWeightPredictionFlag) { | 526 | if (pCurDqLayer->bUseWeightPredictionFlag) { |
| 527 | iRefIndex = pCurDqLayer->pRefIndex[0][iMBXY][2]; | 527 | iRefIndex = pCurDqLayer->pDec->pRefIndex[0][iMBXY][2]; |
| 528 | WeightPrediction (pCurDqLayer, &pMCRefMem, LIST_0, iRefIndex, 8, 16); | 528 | WeightPrediction (pCurDqLayer, &pMCRefMem, LIST_0, iRefIndex, 8, 16); |
| 529 | } | 529 | } |
| 530 | break; | 530 | break; |
| @@ -541,8 +541,8 @@ int32_t GetInterPred (uint8_t* pPredY, uint8_t* pPredCb, uint8_t* pPredCr, PWels · 10 unmodified lines | |||
| 541 | iYOffset = iMBOffsetY + iBlk8Y; | 541 | iYOffset = iMBOffsetY + iBlk8Y; |
| 542 | 542 | ||
| 543 | iIIdx = ((i >> 1) << 3) + ((i & 1) << 1); | 543 | iIIdx = ((i >> 1) << 3) + ((i & 1) << 1); |
| 544 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[0][iMBXY], iIIdx, LIST_0)); | 544 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pDec->pRefIndex[0][iMBXY], iIIdx, LIST_0)); |
| 545 | iRefIndex = pCurDqLayer->bUseWeightPredictionFlag ? pCurDqLayer->pRefIndex[0][iMBXY][iIIdx] : 0; | 545 | iRefIndex = pCurDqLayer->bUseWeightPredictionFlag ? pCurDqLayer->pDec->pRefIndex[0][iMBXY][iIIdx] : 0; |
| 546 | 546 | ||
| 547 | pDstY = pPredY + iBlk8X + iBlk8Y * iDstLineLuma; | 547 | pDstY = pPredY + iBlk8X + iBlk8Y * iDstLineLuma; |
| 548 | pDstU = pPredCb + (iBlk8X >> 1) + (iBlk8Y >> 1) * iDstLineChroma; | 548 | pDstU = pPredCb + (iBlk8X >> 1) + (iBlk8Y >> 1) * iDstLineChroma; |
| @@ -552,8 +552,8 @@ int32_t GetInterPred (uint8_t* pPredY, uint8_t* pPredCb, uint8_t* pPredCr, PWels · 3 unmodified lines | |||
| 552 | pMCRefMem.pDstV = pDstV; | 552 | pMCRefMem.pDstV = pDstV; |
| 553 | switch (iSubMBType) { | 553 | switch (iSubMBType) { |
| 554 | case SUB_MB_TYPE_8x8: | 554 | case SUB_MB_TYPE_8x8: |
| 555 | iMVs[0] = pCurDqLayer->pMv[0][iMBXY][iIIdx][0]; | 555 | iMVs[0] = pCurDqLayer->pDec->pMv[0][iMBXY][iIIdx][0]; |
| 556 | iMVs[1] = pCurDqLayer->pMv[0][iMBXY][iIIdx][1]; | 556 | iMVs[1] = pCurDqLayer->pDec->pMv[0][iMBXY][iIIdx][1]; |
| 557 | BaseMC (&pMCRefMem, iXOffset, iYOffset, pMCFunc, 8, 8, iMVs); | 557 | BaseMC (&pMCRefMem, iXOffset, iYOffset, pMCFunc, 8, 8, iMVs); |
| 558 | if (pCurDqLayer->bUseWeightPredictionFlag) { | 558 | if (pCurDqLayer->bUseWeightPredictionFlag) { |
| 559 | 559 | ||
| @@ -562,8 +562,8 @@ int32_t GetInterPred (uint8_t* pPredY, uint8_t* pPredCb, uint8_t* pPredCr, PWels · 2 unmodified lines | |||
| 562 | 562 | ||
| 563 | break; | 563 | break; |
| 564 | case SUB_MB_TYPE_8x4: | 564 | case SUB_MB_TYPE_8x4: |
| 565 | iMVs[0] = pCurDqLayer->pMv[0][iMBXY][iIIdx][0]; | 565 | iMVs[0] = pCurDqLayer->pDec->pMv[0][iMBXY][iIIdx][0]; |
| 566 | iMVs[1] = pCurDqLayer->pMv[0][iMBXY][iIIdx][1]; | 566 | iMVs[1] = pCurDqLayer->pDec->pMv[0][iMBXY][iIIdx][1]; |
| 567 | BaseMC (&pMCRefMem, iXOffset, iYOffset, pMCFunc, 8, 4, iMVs); | 567 | BaseMC (&pMCRefMem, iXOffset, iYOffset, pMCFunc, 8, 4, iMVs); |
| 568 | if (pCurDqLayer->bUseWeightPredictionFlag) { | 568 | if (pCurDqLayer->bUseWeightPredictionFlag) { |
| 569 | 569 | ||
| @@ -571,8 +571,8 @@ int32_t GetInterPred (uint8_t* pPredY, uint8_t* pPredCb, uint8_t* pPredCr, PWels · 1 unmodified line | |||
| 571 | } | 571 | } |
| 572 | 572 | ||
| 573 | 573 | ||
| 574 | iMVs[0] = pCurDqLayer->pMv[0][iMBXY][iIIdx + 4][0]; | 574 | iMVs[0] = pCurDqLayer->pDec->pMv[0][iMBXY][iIIdx + 4][0]; |
| 575 | iMVs[1] = pCurDqLayer->pMv[0][iMBXY][iIIdx + 4][1]; | 575 | iMVs[1] = pCurDqLayer->pDec->pMv[0][iMBXY][iIIdx + 4][1]; |
| 576 | pMCRefMem.pDstY += (iDstLineLuma << 2); | 576 | pMCRefMem.pDstY += (iDstLineLuma << 2); |
| 577 | pMCRefMem.pDstU += (iDstLineChroma << 1); | 577 | pMCRefMem.pDstU += (iDstLineChroma << 1); |
| 578 | pMCRefMem.pDstV += (iDstLineChroma << 1); | 578 | pMCRefMem.pDstV += (iDstLineChroma << 1); |
| @@ -584,8 +584,8 @@ int32_t GetInterPred (uint8_t* pPredY, uint8_t* pPredCb, uint8_t* pPredCr, PWels · 5 unmodified lines | |||
| 584 | 584 | ||
| 585 | break; | 585 | break; |
| 586 | case SUB_MB_TYPE_4x8: | 586 | case SUB_MB_TYPE_4x8: |
| 587 | iMVs[0] = pCurDqLayer->pMv[0][iMBXY][iIIdx][0]; | 587 | iMVs[0] = pCurDqLayer->pDec->pMv[0][iMBXY][iIIdx][0]; |
| 588 | iMVs[1] = pCurDqLayer->pMv[0][iMBXY][iIIdx][1]; | 588 | iMVs[1] = pCurDqLayer->pDec->pMv[0][iMBXY][iIIdx][1]; |
| 589 | BaseMC (&pMCRefMem, iXOffset, iYOffset, pMCFunc, 4, 8, iMVs); | 589 | BaseMC (&pMCRefMem, iXOffset, iYOffset, pMCFunc, 4, 8, iMVs); |
| 590 | if (pCurDqLayer->bUseWeightPredictionFlag) { | 590 | if (pCurDqLayer->bUseWeightPredictionFlag) { |
| 591 | 591 | ||
| @@ -593,8 +593,8 @@ int32_t GetInterPred (uint8_t* pPredY, uint8_t* pPredCb, uint8_t* pPredCr, PWels · 1 unmodified line | |||
| 593 | } | 593 | } |
| 594 | 594 | ||
| 595 | 595 | ||
| 596 | iMVs[0] = pCurDqLayer->pMv[0][iMBXY][iIIdx + 1][0]; | 596 | iMVs[0] = pCurDqLayer->pDec->pMv[0][iMBXY][iIIdx + 1][0]; |
| 597 | iMVs[1] = pCurDqLayer->pMv[0][iMBXY][iIIdx + 1][1]; | 597 | iMVs[1] = pCurDqLayer->pDec->pMv[0][iMBXY][iIIdx + 1][1]; |
| 598 | pMCRefMem.pDstY += 4; | 598 | pMCRefMem.pDstY += 4; |
| 599 | pMCRefMem.pDstU += 2; | 599 | pMCRefMem.pDstU += 2; |
| 600 | pMCRefMem.pDstV += 2; | 600 | pMCRefMem.pDstV += 2; |
| @@ -618,8 +618,8 @@ int32_t GetInterPred (uint8_t* pPredY, uint8_t* pPredCb, uint8_t* pPredCr, PWels · 17 unmodified lines | |||
| 618 | pMCRefMem.pDstU = pDstU + iUVLineStride; | 618 | pMCRefMem.pDstU = pDstU + iUVLineStride; |
| 619 | pMCRefMem.pDstV = pDstV + iUVLineStride; | 619 | pMCRefMem.pDstV = pDstV + iUVLineStride; |
| 620 | 620 | ||
| 621 | iMVs[0] = pCurDqLayer->pMv[0][iMBXY][iIIdx + iJIdx][0]; | 621 | iMVs[0] = pCurDqLayer->pDec->pMv[0][iMBXY][iIIdx + iJIdx][0]; |
| 622 | iMVs[1] = pCurDqLayer->pMv[0][iMBXY][iIIdx + iJIdx][1]; | 622 | iMVs[1] = pCurDqLayer->pDec->pMv[0][iMBXY][iIIdx + iJIdx][1]; |
| 623 | BaseMC (&pMCRefMem, iXOffset + iBlk4X, iYOffset + iBlk4Y, pMCFunc, 4, 4, iMVs); | 623 | BaseMC (&pMCRefMem, iXOffset + iBlk4X, iYOffset + iBlk4Y, pMCFunc, 4, 4, iMVs); |
| 624 | if (pCurDqLayer->bUseWeightPredictionFlag) { | 624 | if (pCurDqLayer->bUseWeightPredictionFlag) { |
| 625 | 625 | ||
| @@ -652,7 +652,7 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 26 unmodified lines | |||
| 652 | 652 | ||
| 653 | int16_t iMVs[2] = { 0 }; | 653 | int16_t iMVs[2] = { 0 }; |
| 654 | 654 | ||
| 655 | uint32_t iMBType = pCurDqLayer->pMbType[iMBXY]; | 655 | uint32_t iMBType = pCurDqLayer->pDec->pMbType[iMBXY]; |
| 656 | 656 | ||
| 657 | int32_t iMBOffsetX = pCurDqLayer->iMbX << 4; | 657 | int32_t iMBOffsetX = pCurDqLayer->iMbX << 4; |
| 658 | int32_t iMBOffsetY = pCurDqLayer->iMbY << 4; | 658 | int32_t iMBOffsetY = pCurDqLayer->iMbY << 4; |
| @@ -684,17 +684,17 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 25 unmodified lines | |||
| 684 | 684 | ||
| 685 | if (IS_INTER_16x16 (iMBType)) { | 685 | if (IS_INTER_16x16 (iMBType)) { |
| 686 | if (IS_TYPE_L0 (iMBType) && IS_TYPE_L1 (iMBType)) { | 686 | if (IS_TYPE_L0 (iMBType) && IS_TYPE_L1 (iMBType)) { |
| 687 | iMVs[0] = pCurDqLayer->pMv[LIST_0][iMBXY][0][0]; | 687 | iMVs[0] = pCurDqLayer->pDec->pMv[LIST_0][iMBXY][0][0]; |
| 688 | iMVs[1] = pCurDqLayer->pMv[LIST_0][iMBXY][0][1]; | 688 | iMVs[1] = pCurDqLayer->pDec->pMv[LIST_0][iMBXY][0][1]; |
| 689 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[LIST_0][iMBXY], 0, LIST_0)); | 689 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pDec->pRefIndex[LIST_0][iMBXY], 0, LIST_0)); |
| 690 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs); | 690 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs); |
| 691 | 691 | ||
| 692 | iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][0][0]; | 692 | iMVs[0] = pCurDqLayer->pDec->pMv[LIST_1][iMBXY][0][0]; |
| 693 | iMVs[1] = pCurDqLayer->pMv[LIST_1][iMBXY][0][1]; | 693 | iMVs[1] = pCurDqLayer->pDec->pMv[LIST_1][iMBXY][0][1]; |
| 694 | WELS_B_MB_REC_VERIFY (GetRefPic (&pTempMCRefMem, pCtx, pCurDqLayer->pRefIndex[LIST_1][iMBXY], 0, LIST_1)); | 694 | WELS_B_MB_REC_VERIFY (GetRefPic (&pTempMCRefMem, pCtx, pCurDqLayer->pDec->pRefIndex[LIST_1][iMBXY], 0, LIST_1)); |
| 695 | BaseMC (&pTempMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs); | 695 | BaseMC (&pTempMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs); |
| 696 | iRefIndex1 = pCurDqLayer->pRefIndex[LIST_0][iMBXY][0]; | 696 | iRefIndex1 = pCurDqLayer->pDec->pRefIndex[LIST_0][iMBXY][0]; |
| 697 | iRefIndex2 = pCurDqLayer->pRefIndex[LIST_1][iMBXY][0]; | 697 | iRefIndex2 = pCurDqLayer->pDec->pRefIndex[LIST_1][iMBXY][0]; |
| 698 | if (pCurDqLayer->bUseWeightedBiPredIdc) { | 698 | if (pCurDqLayer->bUseWeightedBiPredIdc) { |
| 699 | BiWeightPrediction (pCurDqLayer, &pMCRefMem, &pTempMCRefMem, iRefIndex1, iRefIndex2, bWeightedBipredIdcIs1, 16, 16); | 699 | BiWeightPrediction (pCurDqLayer, &pMCRefMem, &pTempMCRefMem, iRefIndex1, iRefIndex2, bWeightedBipredIdcIs1, 16, 16); |
| 700 | } else { | 700 | } else { |
| @@ -702,12 +702,12 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 1 unmodified line | |||
| 702 | } | 702 | } |
| 703 | } else { | 703 | } else { |
| 704 | int32_t listIdx = (iMBType & MB_TYPE_P0L0) ? LIST_0 : LIST_1; | 704 | int32_t listIdx = (iMBType & MB_TYPE_P0L0) ? LIST_0 : LIST_1; |
| 705 | iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][0][0]; | 705 | iMVs[0] = pCurDqLayer->pDec->pMv[listIdx][iMBXY][0][0]; |
| 706 | iMVs[1] = pCurDqLayer->pMv[listIdx][iMBXY][0][1]; | 706 | iMVs[1] = pCurDqLayer->pDec->pMv[listIdx][iMBXY][0][1]; |
| 707 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[listIdx][iMBXY], 0, listIdx)); | 707 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pDec->pRefIndex[listIdx][iMBXY], 0, listIdx)); |
| 708 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs); | 708 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs); |
| 709 | if (bWeightedBipredIdcIs1) { | 709 | if (bWeightedBipredIdcIs1) { |
| 710 | int32_t iRefIndex = pCurDqLayer->pRefIndex[listIdx][iMBXY][0]; | 710 | int32_t iRefIndex = pCurDqLayer->pDec->pRefIndex[listIdx][iMBXY][0]; |
| 711 | WeightPrediction (pCurDqLayer, &pMCRefMem, listIdx, iRefIndex, 16, 16); | 711 | WeightPrediction (pCurDqLayer, &pMCRefMem, listIdx, iRefIndex, 16, 16); |
| 712 | } | 712 | } |
| 713 | } | 713 | } |
| @@ -719,9 +719,9 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 5 unmodified lines | |||
| 719 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 719 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 720 | if (IS_DIR (iMBType, i, listIdx)) { | 720 | if (IS_DIR (iMBType, i, listIdx)) { |
| 721 | lastListIdx = listIdx; | 721 | lastListIdx = listIdx; |
| 722 | iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][iPartIdx][0]; | 722 | iMVs[0] = pCurDqLayer->pDec->pMv[listIdx][iMBXY][iPartIdx][0]; |
| 723 | iMVs[1] = pCurDqLayer->pMv[listIdx][iMBXY][iPartIdx][1]; | 723 | iMVs[1] = pCurDqLayer->pDec->pMv[listIdx][iMBXY][iPartIdx][1]; |
| 724 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[listIdx][iMBXY], iPartIdx, listIdx)); | 724 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pDec->pRefIndex[listIdx][iMBXY], iPartIdx, listIdx)); |
| 725 | if (i) { | 725 | if (i) { |
| 726 | pMCRefMem.pDstY += (iDstLineLuma << 3); | 726 | pMCRefMem.pDstY += (iDstLineLuma << 3); |
| 727 | pMCRefMem.pDstU += (iDstLineChroma << 2); | 727 | pMCRefMem.pDstU += (iDstLineChroma << 2); |
| @@ -729,9 +729,9 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 1 unmodified line | |||
| 729 | } | 729 | } |
| 730 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY + iPartIdx, pMCFunc, 16, 8, iMVs); | 730 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY + iPartIdx, pMCFunc, 16, 8, iMVs); |
| 731 | if (++listCount == 2) { | 731 | if (++listCount == 2) { |
| 732 | iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][iPartIdx][0]; | 732 | iMVs[0] = pCurDqLayer->pDec->pMv[LIST_1][iMBXY][iPartIdx][0]; |
| 733 | iMVs[1] = pCurDqLayer->pMv[LIST_1][iMBXY][iPartIdx][1]; | 733 | iMVs[1] = pCurDqLayer->pDec->pMv[LIST_1][iMBXY][iPartIdx][1]; |
| 734 | WELS_B_MB_REC_VERIFY (GetRefPic (&pTempMCRefMem, pCtx, pCurDqLayer->pRefIndex[LIST_1][iMBXY], iPartIdx, LIST_1)); | 734 | WELS_B_MB_REC_VERIFY (GetRefPic (&pTempMCRefMem, pCtx, pCurDqLayer->pDec->pRefIndex[LIST_1][iMBXY], iPartIdx, LIST_1)); |
| 735 | if (i) { | 735 | if (i) { |
| 736 | pTempMCRefMem.pDstY += (iDstLineLuma << 3); | 736 | pTempMCRefMem.pDstY += (iDstLineLuma << 3); |
| 737 | pTempMCRefMem.pDstU += (iDstLineChroma << 2); | 737 | pTempMCRefMem.pDstU += (iDstLineChroma << 2); |
| @@ -739,8 +739,8 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 1 unmodified line | |||
| 739 | } | 739 | } |
| 740 | BaseMC (&pTempMCRefMem, iMBOffsetX, iMBOffsetY + iPartIdx, pMCFunc, 16, 8, iMVs); | 740 | BaseMC (&pTempMCRefMem, iMBOffsetX, iMBOffsetY + iPartIdx, pMCFunc, 16, 8, iMVs); |
| 741 | if (pCurDqLayer->bUseWeightedBiPredIdc) { | 741 | if (pCurDqLayer->bUseWeightedBiPredIdc) { |
| 742 | iRefIndex1 = pCurDqLayer->pRefIndex[LIST_0][iMBXY][iPartIdx]; | 742 | iRefIndex1 = pCurDqLayer->pDec->pRefIndex[LIST_0][iMBXY][iPartIdx]; |
| 743 | iRefIndex2 = pCurDqLayer->pRefIndex[LIST_1][iMBXY][iPartIdx]; | 743 | iRefIndex2 = pCurDqLayer->pDec->pRefIndex[LIST_1][iMBXY][iPartIdx]; |
| 744 | BiWeightPrediction (pCurDqLayer, &pMCRefMem, &pTempMCRefMem, iRefIndex1, iRefIndex2, bWeightedBipredIdcIs1, 16, 8); | 744 | BiWeightPrediction (pCurDqLayer, &pMCRefMem, &pTempMCRefMem, iRefIndex1, iRefIndex2, bWeightedBipredIdcIs1, 16, 8); |
| 745 | } else { | 745 | } else { |
| 746 | BiPrediction (pCurDqLayer, &pMCRefMem, &pTempMCRefMem, 16, 8); | 746 | BiPrediction (pCurDqLayer, &pMCRefMem, &pTempMCRefMem, 16, 8); |
| @@ -750,7 +750,7 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 3 unmodified lines | |||
| 750 | } | 750 | } |
| 751 | if (listCount == 1) { | 751 | if (listCount == 1) { |
| 752 | if (bWeightedBipredIdcIs1) { | 752 | if (bWeightedBipredIdcIs1) { |
| 753 | int32_t iRefIndex = pCurDqLayer->pRefIndex[lastListIdx][iMBXY][iPartIdx]; | 753 | int32_t iRefIndex = pCurDqLayer->pDec->pRefIndex[lastListIdx][iMBXY][iPartIdx]; |
| 754 | WeightPrediction (pCurDqLayer, &pMCRefMem, lastListIdx, iRefIndex, 16, 8); | 754 | WeightPrediction (pCurDqLayer, &pMCRefMem, lastListIdx, iRefIndex, 16, 8); |
| 755 | } | 755 | } |
| 756 | } | 756 | } |
| @@ -762,9 +762,9 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 5 unmodified lines | |||
| 762 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 762 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 763 | if (IS_DIR (iMBType, i, listIdx)) { | 763 | if (IS_DIR (iMBType, i, listIdx)) { |
| 764 | lastListIdx = listIdx; | 764 | lastListIdx = listIdx; |
| 765 | iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][i << 1][0]; | 765 | iMVs[0] = pCurDqLayer->pDec->pMv[listIdx][iMBXY][i << 1][0]; |
| 766 | iMVs[1] = pCurDqLayer->pMv[listIdx][iMBXY][i << 1][1]; | 766 | iMVs[1] = pCurDqLayer->pDec->pMv[listIdx][iMBXY][i << 1][1]; |
| 767 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[listIdx][iMBXY], i << 1, listIdx)); | 767 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pDec->pRefIndex[listIdx][iMBXY], i << 1, listIdx)); |
| 768 | if (i) { | 768 | if (i) { |
| 769 | pMCRefMem.pDstY += 8; | 769 | pMCRefMem.pDstY += 8; |
| 770 | pMCRefMem.pDstU += 4; | 770 | pMCRefMem.pDstU += 4; |
| @@ -772,9 +772,9 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 1 unmodified line | |||
| 772 | } | 772 | } |
| 773 | BaseMC (&pMCRefMem, iMBOffsetX + (i ? 8 : 0), iMBOffsetY, pMCFunc, 8, 16, iMVs); | 773 | BaseMC (&pMCRefMem, iMBOffsetX + (i ? 8 : 0), iMBOffsetY, pMCFunc, 8, 16, iMVs); |
| 774 | if (++listCount == 2) { | 774 | if (++listCount == 2) { |
| 775 | iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][i << 1][0]; | 775 | iMVs[0] = pCurDqLayer->pDec->pMv[LIST_1][iMBXY][i << 1][0]; |
| 776 | iMVs[1] = pCurDqLayer->pMv[LIST_1][iMBXY][i << 1][1]; | 776 | iMVs[1] = pCurDqLayer->pDec->pMv[LIST_1][iMBXY][i << 1][1]; |
| 777 | WELS_B_MB_REC_VERIFY (GetRefPic (&pTempMCRefMem, pCtx, pCurDqLayer->pRefIndex[LIST_1][iMBXY], i << 1, LIST_1)); | 777 | WELS_B_MB_REC_VERIFY (GetRefPic (&pTempMCRefMem, pCtx, pCurDqLayer->pDec->pRefIndex[LIST_1][iMBXY], i << 1, LIST_1)); |
| 778 | if (i) { | 778 | if (i) { |
| 779 | pTempMCRefMem.pDstY += 8; | 779 | pTempMCRefMem.pDstY += 8; |
| 780 | pTempMCRefMem.pDstU += 4; | 780 | pTempMCRefMem.pDstU += 4; |
| @@ -782,8 +782,8 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 1 unmodified line | |||
| 782 | } | 782 | } |
| 783 | BaseMC (&pTempMCRefMem, iMBOffsetX + (i ? 8 : 0), iMBOffsetY, pMCFunc, 8, 16, iMVs); | 783 | BaseMC (&pTempMCRefMem, iMBOffsetX + (i ? 8 : 0), iMBOffsetY, pMCFunc, 8, 16, iMVs); |
| 784 | if (pCurDqLayer->bUseWeightedBiPredIdc) { | 784 | if (pCurDqLayer->bUseWeightedBiPredIdc) { |
| 785 | iRefIndex1 = pCurDqLayer->pRefIndex[LIST_0][iMBXY][i << 1]; | 785 | iRefIndex1 = pCurDqLayer->pDec->pRefIndex[LIST_0][iMBXY][i << 1]; |
| 786 | iRefIndex2 = pCurDqLayer->pRefIndex[LIST_1][iMBXY][i << 1]; | 786 | iRefIndex2 = pCurDqLayer->pDec->pRefIndex[LIST_1][iMBXY][i << 1]; |
| 787 | BiWeightPrediction (pCurDqLayer, &pMCRefMem, &pTempMCRefMem, iRefIndex1, iRefIndex2, bWeightedBipredIdcIs1, 8, 16); | 787 | BiWeightPrediction (pCurDqLayer, &pMCRefMem, &pTempMCRefMem, iRefIndex1, iRefIndex2, bWeightedBipredIdcIs1, 8, 16); |
| 788 | } else { | 788 | } else { |
| 789 | BiPrediction (pCurDqLayer, &pMCRefMem, &pTempMCRefMem, 8, 16); | 789 | BiPrediction (pCurDqLayer, &pMCRefMem, &pTempMCRefMem, 8, 16); |
| @@ -793,7 +793,7 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 3 unmodified lines | |||
| 793 | } | 793 | } |
| 794 | if (listCount == 1) { | 794 | if (listCount == 1) { |
| 795 | if (bWeightedBipredIdcIs1) { | 795 | if (bWeightedBipredIdcIs1) { |
| 796 | int32_t iRefIndex = pCurDqLayer->pRefIndex[lastListIdx][iMBXY][i << 1]; | 796 | int32_t iRefIndex = pCurDqLayer->pDec->pRefIndex[lastListIdx][iMBXY][i << 1]; |
| 797 | WeightPrediction (pCurDqLayer, &pMCRefMem, lastListIdx, iRefIndex, 8, 16); | 797 | WeightPrediction (pCurDqLayer, &pMCRefMem, lastListIdx, iRefIndex, 8, 16); |
| 798 | } | 798 | } |
| 799 | } | 799 | } |
| @@ -830,25 +830,25 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 30 unmodified lines | |||
| 830 | pTempMCRefMem.pDstV = pDstV2; | 830 | pTempMCRefMem.pDstV = pDstV2; |
| 831 | 831 | ||
| 832 | if ((IS_TYPE_L0 (iSubMBType) && IS_TYPE_L1 (iSubMBType))) { | 832 | if ((IS_TYPE_L0 (iSubMBType) && IS_TYPE_L1 (iSubMBType))) { |
| 833 | iRefIndex1 = pCurDqLayer->pRefIndex[LIST_0][iMBXY][iIIdx]; | 833 | iRefIndex1 = pCurDqLayer->pDec->pRefIndex[LIST_0][iMBXY][iIIdx]; |
| 834 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[LIST_0][iMBXY], iIIdx, LIST_0)); | 834 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pDec->pRefIndex[LIST_0][iMBXY], iIIdx, LIST_0)); |
| 835 | 835 | ||
| 836 | iRefIndex2 = pCurDqLayer->pRefIndex[LIST_1][iMBXY][iIIdx]; | 836 | iRefIndex2 = pCurDqLayer->pDec->pRefIndex[LIST_1][iMBXY][iIIdx]; |
| 837 | WELS_B_MB_REC_VERIFY (GetRefPic (&pTempMCRefMem, pCtx, pCurDqLayer->pRefIndex[LIST_1][iMBXY], iIIdx, LIST_1)); | 837 | WELS_B_MB_REC_VERIFY (GetRefPic (&pTempMCRefMem, pCtx, pCurDqLayer->pDec->pRefIndex[LIST_1][iMBXY], iIIdx, LIST_1)); |
| 838 | } else { | 838 | } else { |
| 839 | int32_t listIdx = IS_TYPE_L0 (iSubMBType) ? LIST_0 : LIST_1; | 839 | int32_t listIdx = IS_TYPE_L0 (iSubMBType) ? LIST_0 : LIST_1; |
| 840 | iRefIndex1 = pCurDqLayer->pRefIndex[listIdx][iMBXY][iIIdx]; | 840 | iRefIndex1 = pCurDqLayer->pDec->pRefIndex[listIdx][iMBXY][iIIdx]; |
| 841 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[listIdx][iMBXY], iIIdx, listIdx)); | 841 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pDec->pRefIndex[listIdx][iMBXY], iIIdx, listIdx)); |
| 842 | } | 842 | } |
| 843 | 843 | ||
| 844 | if (IS_SUB_8x8 (iSubMBType)) { | 844 | if (IS_SUB_8x8 (iSubMBType)) { |
| 845 | if (IS_TYPE_L0 (iSubMBType) && IS_TYPE_L1 (iSubMBType)) { | 845 | if (IS_TYPE_L0 (iSubMBType) && IS_TYPE_L1 (iSubMBType)) { |
| 846 | iMVs[0] = pCurDqLayer->pMv[LIST_0][iMBXY][iIIdx][0]; | 846 | iMVs[0] = pCurDqLayer->pDec->pMv[LIST_0][iMBXY][iIIdx][0]; |
| 847 | iMVs[1] = pCurDqLayer->pMv[LIST_0][iMBXY][iIIdx][1]; | 847 | iMVs[1] = pCurDqLayer->pDec->pMv[LIST_0][iMBXY][iIIdx][1]; |
| 848 | BaseMC (&pMCRefMem, iXOffset, iYOffset, pMCFunc, 8, 8, iMVs); | 848 | BaseMC (&pMCRefMem, iXOffset, iYOffset, pMCFunc, 8, 8, iMVs); |
| 849 | 849 | ||
| 850 | iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][iIIdx][0]; | 850 | iMVs[0] = pCurDqLayer->pDec->pMv[LIST_1][iMBXY][iIIdx][0]; |
| 851 | iMVs[1] = pCurDqLayer->pMv[LIST_1][iMBXY][iIIdx][1]; | 851 | iMVs[1] = pCurDqLayer->pDec->pMv[LIST_1][iMBXY][iIIdx][1]; |
| 852 | BaseMC (&pTempMCRefMem, iXOffset, iYOffset, pMCFunc, 8, 8, iMVs); | 852 | BaseMC (&pTempMCRefMem, iXOffset, iYOffset, pMCFunc, 8, 8, iMVs); |
| 853 | 853 | ||
| 854 | if (pCurDqLayer->bUseWeightedBiPredIdc) { | 854 | if (pCurDqLayer->bUseWeightedBiPredIdc) { |
| @@ -858,21 +858,21 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 3 unmodified lines | |||
| 858 | } | 858 | } |
| 859 | } else { | 859 | } else { |
| 860 | int32_t listIdx = IS_TYPE_L0 (iSubMBType) ? LIST_0 : LIST_1; | 860 | int32_t listIdx = IS_TYPE_L0 (iSubMBType) ? LIST_0 : LIST_1; |
| 861 | iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][iIIdx][0]; | 861 | iMVs[0] = pCurDqLayer->pDec->pMv[listIdx][iMBXY][iIIdx][0]; |
| 862 | iMVs[1] = pCurDqLayer->pMv[listIdx][iMBXY][iIIdx][1]; | 862 | iMVs[1] = pCurDqLayer->pDec->pMv[listIdx][iMBXY][iIIdx][1]; |
| 863 | BaseMC (&pMCRefMem, iXOffset, iYOffset, pMCFunc, 8, 8, iMVs); | 863 | BaseMC (&pMCRefMem, iXOffset, iYOffset, pMCFunc, 8, 8, iMVs); |
| 864 | if (bWeightedBipredIdcIs1) { | 864 | if (bWeightedBipredIdcIs1) { |
| 865 | int32_t iRefIndex = pCurDqLayer->pRefIndex[listIdx][iMBXY][iIIdx]; | 865 | int32_t iRefIndex = pCurDqLayer->pDec->pRefIndex[listIdx][iMBXY][iIIdx]; |
| 866 | WeightPrediction (pCurDqLayer, &pMCRefMem, listIdx, iRefIndex, 8, 8); | 866 | WeightPrediction (pCurDqLayer, &pMCRefMem, listIdx, iRefIndex, 8, 8); |
| 867 | } | 867 | } |
| 868 | } | 868 | } |
| 869 | } else if (IS_SUB_8x4 (iSubMBType)) { | 869 | } else if (IS_SUB_8x4 (iSubMBType)) { |
| 870 | if (IS_TYPE_L0 (iSubMBType) && IS_TYPE_L1 (iSubMBType)) { //B_Bi_8x4 | 870 | if (IS_TYPE_L0 (iSubMBType) && IS_TYPE_L1 (iSubMBType)) { //B_Bi_8x4 |
| 871 | iMVs[0] = pCurDqLayer->pMv[LIST_0][iMBXY][iIIdx][0]; | 871 | iMVs[0] = pCurDqLayer->pDec->pMv[LIST_0][iMBXY][iIIdx][0]; |
| 872 | iMVs[1] = pCurDqLayer->pMv[LIST_0][iMBXY][iIIdx][1]; | 872 | iMVs[1] = pCurDqLayer->pDec->pMv[LIST_0][iMBXY][iIIdx][1]; |
| 873 | BaseMC (&pMCRefMem, iXOffset, iYOffset, pMCFunc, 8, 4, iMVs); | 873 | BaseMC (&pMCRefMem, iXOffset, iYOffset, pMCFunc, 8, 4, iMVs); |
| 874 | iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][iIIdx][0]; | 874 | iMVs[0] = pCurDqLayer->pDec->pMv[LIST_1][iMBXY][iIIdx][0]; |
| 875 | iMVs[1] = pCurDqLayer->pMv[LIST_1][iMBXY][iIIdx][1]; | 875 | iMVs[1] = pCurDqLayer->pDec->pMv[LIST_1][iMBXY][iIIdx][1]; |
| 876 | BaseMC (&pTempMCRefMem, iXOffset, iYOffset, pMCFunc, 8, 4, iMVs); | 876 | BaseMC (&pTempMCRefMem, iXOffset, iYOffset, pMCFunc, 8, 4, iMVs); |
| 877 | 877 | ||
| 878 | if (pCurDqLayer->bUseWeightedBiPredIdc) { | 878 | if (pCurDqLayer->bUseWeightedBiPredIdc) { |
| @@ -884,15 +884,15 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 5 unmodified lines | |||
| 884 | pMCRefMem.pDstY += (iDstLineLuma << 2); | 884 | pMCRefMem.pDstY += (iDstLineLuma << 2); |
| 885 | pMCRefMem.pDstU += (iDstLineChroma << 1); | 885 | pMCRefMem.pDstU += (iDstLineChroma << 1); |
| 886 | pMCRefMem.pDstV += (iDstLineChroma << 1); | 886 | pMCRefMem.pDstV += (iDstLineChroma << 1); |
| 887 | iMVs[0] = pCurDqLayer->pMv[LIST_0][iMBXY][iIIdx + 4][0]; | 887 | iMVs[0] = pCurDqLayer->pDec->pMv[LIST_0][iMBXY][iIIdx + 4][0]; |
| 888 | iMVs[1] = pCurDqLayer->pMv[LIST_0][iMBXY][iIIdx + 4][1]; | 888 | iMVs[1] = pCurDqLayer->pDec->pMv[LIST_0][iMBXY][iIIdx + 4][1]; |
| 889 | BaseMC (&pMCRefMem, iXOffset, iYOffset + 4, pMCFunc, 8, 4, iMVs); | 889 | BaseMC (&pMCRefMem, iXOffset, iYOffset + 4, pMCFunc, 8, 4, iMVs); |
| 890 | 890 | ||
| 891 | pTempMCRefMem.pDstY += (iDstLineLuma << 2); | 891 | pTempMCRefMem.pDstY += (iDstLineLuma << 2); |
| 892 | pTempMCRefMem.pDstU += (iDstLineChroma << 1); | 892 | pTempMCRefMem.pDstU += (iDstLineChroma << 1); |
| 893 | pTempMCRefMem.pDstV += (iDstLineChroma << 1); | 893 | pTempMCRefMem.pDstV += (iDstLineChroma << 1); |
| 894 | iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][iIIdx + 4][0]; | 894 | iMVs[0] = pCurDqLayer->pDec->pMv[LIST_1][iMBXY][iIIdx + 4][0]; |
| 895 | iMVs[1] = pCurDqLayer->pMv[LIST_1][iMBXY][iIIdx + 4][1]; | 895 | iMVs[1] = pCurDqLayer->pDec->pMv[LIST_1][iMBXY][iIIdx + 4][1]; |
| 896 | BaseMC (&pTempMCRefMem, iXOffset, iYOffset + 4, pMCFunc, 8, 4, iMVs); | 896 | BaseMC (&pTempMCRefMem, iXOffset, iYOffset + 4, pMCFunc, 8, 4, iMVs); |
| 897 | 897 | ||
| 898 | if (pCurDqLayer->bUseWeightedBiPredIdc) { | 898 | if (pCurDqLayer->bUseWeightedBiPredIdc) { |
| @@ -902,27 +902,27 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 3 unmodified lines | |||
| 902 | } | 902 | } |
| 903 | } else { //B_L0_8x4 B_L1_8x4 | 903 | } else { //B_L0_8x4 B_L1_8x4 |
| 904 | int32_t listIdx = IS_TYPE_L0 (iSubMBType) ? LIST_0 : LIST_1; | 904 | int32_t listIdx = IS_TYPE_L0 (iSubMBType) ? LIST_0 : LIST_1; |
| 905 | iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][iIIdx][0]; | 905 | iMVs[0] = pCurDqLayer->pDec->pMv[listIdx][iMBXY][iIIdx][0]; |
| 906 | iMVs[1] = pCurDqLayer->pMv[listIdx][iMBXY][iIIdx][1]; | 906 | iMVs[1] = pCurDqLayer->pDec->pMv[listIdx][iMBXY][iIIdx][1]; |
| 907 | BaseMC (&pMCRefMem, iXOffset, iYOffset, pMCFunc, 8, 4, iMVs); | 907 | BaseMC (&pMCRefMem, iXOffset, iYOffset, pMCFunc, 8, 4, iMVs); |
| 908 | pMCRefMem.pDstY += (iDstLineLuma << 2); | 908 | pMCRefMem.pDstY += (iDstLineLuma << 2); |
| 909 | pMCRefMem.pDstU += (iDstLineChroma << 1); | 909 | pMCRefMem.pDstU += (iDstLineChroma << 1); |
| 910 | pMCRefMem.pDstV += (iDstLineChroma << 1); | 910 | pMCRefMem.pDstV += (iDstLineChroma << 1); |
| 911 | iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][iIIdx + 4][0]; | 911 | iMVs[0] = pCurDqLayer->pDec->pMv[listIdx][iMBXY][iIIdx + 4][0]; |
| 912 | iMVs[1] = pCurDqLayer->pMv[listIdx][iMBXY][iIIdx + 4][1]; | 912 | iMVs[1] = pCurDqLayer->pDec->pMv[listIdx][iMBXY][iIIdx + 4][1]; |
| 913 | BaseMC (&pMCRefMem, iXOffset, iYOffset + 4, pMCFunc, 8, 4, iMVs); | 913 | BaseMC (&pMCRefMem, iXOffset, iYOffset + 4, pMCFunc, 8, 4, iMVs); |
| 914 | if (bWeightedBipredIdcIs1) { | 914 | if (bWeightedBipredIdcIs1) { |
| 915 | int32_t iRefIndex = pCurDqLayer->pRefIndex[listIdx][iMBXY][iIIdx]; | 915 | int32_t iRefIndex = pCurDqLayer->pDec->pRefIndex[listIdx][iMBXY][iIIdx]; |
| 916 | WeightPrediction (pCurDqLayer, &pMCRefMem, listIdx, iRefIndex, 8, 4); | 916 | WeightPrediction (pCurDqLayer, &pMCRefMem, listIdx, iRefIndex, 8, 4); |
| 917 | } | 917 | } |
| 918 | } | 918 | } |
| 919 | } else if (IS_SUB_4x8 (iSubMBType)) { | 919 | } else if (IS_SUB_4x8 (iSubMBType)) { |
| 920 | if (IS_TYPE_L0 (iSubMBType) && IS_TYPE_L1 (iSubMBType)) { //B_Bi_4x8 | 920 | if (IS_TYPE_L0 (iSubMBType) && IS_TYPE_L1 (iSubMBType)) { //B_Bi_4x8 |
| 921 | iMVs[0] = pCurDqLayer->pMv[LIST_0][iMBXY][iIIdx][0]; | 921 | iMVs[0] = pCurDqLayer->pDec->pMv[LIST_0][iMBXY][iIIdx][0]; |
| 922 | iMVs[1] = pCurDqLayer->pMv[LIST_0][iMBXY][iIIdx][1]; | 922 | iMVs[1] = pCurDqLayer->pDec->pMv[LIST_0][iMBXY][iIIdx][1]; |
| 923 | BaseMC (&pMCRefMem, iXOffset, iYOffset, pMCFunc, 4, 8, iMVs); | 923 | BaseMC (&pMCRefMem, iXOffset, iYOffset, pMCFunc, 4, 8, iMVs); |
| 924 | iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][iIIdx][0]; | 924 | iMVs[0] = pCurDqLayer->pDec->pMv[LIST_1][iMBXY][iIIdx][0]; |
| 925 | iMVs[1] = pCurDqLayer->pMv[LIST_1][iMBXY][iIIdx][1]; | 925 | iMVs[1] = pCurDqLayer->pDec->pMv[LIST_1][iMBXY][iIIdx][1]; |
| 926 | BaseMC (&pTempMCRefMem, iXOffset, iYOffset, pMCFunc, 4, 8, iMVs); | 926 | BaseMC (&pTempMCRefMem, iXOffset, iYOffset, pMCFunc, 4, 8, iMVs); |
| 927 | 927 | ||
| 928 | if (pCurDqLayer->bUseWeightedBiPredIdc) { | 928 | if (pCurDqLayer->bUseWeightedBiPredIdc) { |
| @@ -934,15 +934,15 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 5 unmodified lines | |||
| 934 | pMCRefMem.pDstY += 4; | 934 | pMCRefMem.pDstY += 4; |
| 935 | pMCRefMem.pDstU += 2; | 935 | pMCRefMem.pDstU += 2; |
| 936 | pMCRefMem.pDstV += 2; | 936 | pMCRefMem.pDstV += 2; |
| 937 | iMVs[0] = pCurDqLayer->pMv[LIST_0][iMBXY][iIIdx + 1][0]; | 937 | iMVs[0] = pCurDqLayer->pDec->pMv[LIST_0][iMBXY][iIIdx + 1][0]; |
| 938 | iMVs[1] = pCurDqLayer->pMv[LIST_0][iMBXY][iIIdx + 1][1]; | 938 | iMVs[1] = pCurDqLayer->pDec->pMv[LIST_0][iMBXY][iIIdx + 1][1]; |
| 939 | BaseMC (&pMCRefMem, iXOffset + 4, iYOffset, pMCFunc, 4, 8, iMVs); | 939 | BaseMC (&pMCRefMem, iXOffset + 4, iYOffset, pMCFunc, 4, 8, iMVs); |
| 940 | 940 | ||
| 941 | pTempMCRefMem.pDstY += 4; | 941 | pTempMCRefMem.pDstY += 4; |
| 942 | pTempMCRefMem.pDstU += 2; | 942 | pTempMCRefMem.pDstU += 2; |
| 943 | pTempMCRefMem.pDstV += 2; | 943 | pTempMCRefMem.pDstV += 2; |
| 944 | iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][iIIdx + 1][0]; | 944 | iMVs[0] = pCurDqLayer->pDec->pMv[LIST_1][iMBXY][iIIdx + 1][0]; |
| 945 | iMVs[1] = pCurDqLayer->pMv[LIST_1][iMBXY][iIIdx + 1][1]; | 945 | iMVs[1] = pCurDqLayer->pDec->pMv[LIST_1][iMBXY][iIIdx + 1][1]; |
| 946 | BaseMC (&pTempMCRefMem, iXOffset + 4, iYOffset, pMCFunc, 4, 8, iMVs); | 946 | BaseMC (&pTempMCRefMem, iXOffset + 4, iYOffset, pMCFunc, 4, 8, iMVs); |
| 947 | 947 | ||
| 948 | if (pCurDqLayer->bUseWeightedBiPredIdc) { | 948 | if (pCurDqLayer->bUseWeightedBiPredIdc) { |
| @@ -952,17 +952,17 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 3 unmodified lines | |||
| 952 | } | 952 | } |
| 953 | } else { //B_L0_4x8 B_L1_4x8 | 953 | } else { //B_L0_4x8 B_L1_4x8 |
| 954 | int32_t listIdx = IS_TYPE_L0 (iSubMBType) ? LIST_0 : LIST_1; | 954 | int32_t listIdx = IS_TYPE_L0 (iSubMBType) ? LIST_0 : LIST_1; |
| 955 | iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][iIIdx][0]; | 955 | iMVs[0] = pCurDqLayer->pDec->pMv[listIdx][iMBXY][iIIdx][0]; |
| 956 | iMVs[1] = pCurDqLayer->pMv[listIdx][iMBXY][iIIdx][1]; | 956 | iMVs[1] = pCurDqLayer->pDec->pMv[listIdx][iMBXY][iIIdx][1]; |
| 957 | BaseMC (&pMCRefMem, iXOffset, iYOffset, pMCFunc, 4, 8, iMVs); | 957 | BaseMC (&pMCRefMem, iXOffset, iYOffset, pMCFunc, 4, 8, iMVs); |
| 958 | pMCRefMem.pDstY += 4; | 958 | pMCRefMem.pDstY += 4; |
| 959 | pMCRefMem.pDstU += 2; | 959 | pMCRefMem.pDstU += 2; |
| 960 | pMCRefMem.pDstV += 2; | 960 | pMCRefMem.pDstV += 2; |
| 961 | iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][iIIdx + 1][0]; | 961 | iMVs[0] = pCurDqLayer->pDec->pMv[listIdx][iMBXY][iIIdx + 1][0]; |
| 962 | iMVs[1] = pCurDqLayer->pMv[listIdx][iMBXY][iIIdx + 1][1]; | 962 | iMVs[1] = pCurDqLayer->pDec->pMv[listIdx][iMBXY][iIIdx + 1][1]; |
| 963 | BaseMC (&pMCRefMem, iXOffset + 4, iYOffset, pMCFunc, 4, 8, iMVs); | 963 | BaseMC (&pMCRefMem, iXOffset + 4, iYOffset, pMCFunc, 4, 8, iMVs); |
| 964 | if (bWeightedBipredIdcIs1) { | 964 | if (bWeightedBipredIdcIs1) { |
| 965 | int32_t iRefIndex = pCurDqLayer->pRefIndex[listIdx][iMBXY][iIIdx]; | 965 | int32_t iRefIndex = pCurDqLayer->pDec->pRefIndex[listIdx][iMBXY][iIIdx]; |
| 966 | WeightPrediction (pCurDqLayer, &pMCRefMem, listIdx, iRefIndex, 4, 8); | 966 | WeightPrediction (pCurDqLayer, &pMCRefMem, listIdx, iRefIndex, 4, 8); |
| 967 | } | 967 | } |
| 968 | } | 968 | } |
| @@ -980,16 +980,16 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 11 unmodified lines | |||
| 980 | pMCRefMem.pDstU = pDstU + iUVLineStride; | 980 | pMCRefMem.pDstU = pDstU + iUVLineStride; |
| 981 | pMCRefMem.pDstV = pDstV + iUVLineStride; | 981 | pMCRefMem.pDstV = pDstV + iUVLineStride; |
| 982 | 982 | ||
| 983 | iMVs[0] = pCurDqLayer->pMv[LIST_0][iMBXY][iIIdx + iJIdx][0]; | 983 | iMVs[0] = pCurDqLayer->pDec->pMv[LIST_0][iMBXY][iIIdx + iJIdx][0]; |
| 984 | iMVs[1] = pCurDqLayer->pMv[LIST_0][iMBXY][iIIdx + iJIdx][1]; | 984 | iMVs[1] = pCurDqLayer->pDec->pMv[LIST_0][iMBXY][iIIdx + iJIdx][1]; |
| 985 | BaseMC (&pMCRefMem, iXOffset + iBlk4X, iYOffset + iBlk4Y, pMCFunc, 4, 4, iMVs); | 985 | BaseMC (&pMCRefMem, iXOffset + iBlk4X, iYOffset + iBlk4Y, pMCFunc, 4, 4, iMVs); |
| 986 | 986 | ||
| 987 | pTempMCRefMem.pDstY = pDstY2 + iBlk8X + iBlk8Y * iDstLineLuma; | 987 | pTempMCRefMem.pDstY = pDstY2 + iBlk8X + iBlk8Y * iDstLineLuma; |
| 988 | pTempMCRefMem.pDstU = pDstU2 + iUVLineStride; | 988 | pTempMCRefMem.pDstU = pDstU2 + iUVLineStride; |
| 989 | pTempMCRefMem.pDstV = pDstV2 + iUVLineStride;; | 989 | pTempMCRefMem.pDstV = pDstV2 + iUVLineStride;; |
| 990 | 990 | ||
| 991 | iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][iIIdx + iJIdx][0]; | 991 | iMVs[0] = pCurDqLayer->pDec->pMv[LIST_1][iMBXY][iIIdx + iJIdx][0]; |
| 992 | iMVs[1] = pCurDqLayer->pMv[LIST_1][iMBXY][iIIdx + iJIdx][1]; | 992 | iMVs[1] = pCurDqLayer->pDec->pMv[LIST_1][iMBXY][iIIdx + iJIdx][1]; |
| 993 | BaseMC (&pTempMCRefMem, iXOffset + iBlk4X, iYOffset + iBlk4Y, pMCFunc, 4, 4, iMVs); | 993 | BaseMC (&pTempMCRefMem, iXOffset + iBlk4X, iYOffset + iBlk4Y, pMCFunc, 4, 4, iMVs); |
| 994 | 994 | ||
| 995 | if (pCurDqLayer->bUseWeightedBiPredIdc) { | 995 | if (pCurDqLayer->bUseWeightedBiPredIdc) { |
| @@ -1000,7 +1000,7 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 4 unmodified lines | |||
| 1000 | } | 1000 | } |
| 1001 | } else { | 1001 | } else { |
| 1002 | int32_t listIdx = IS_TYPE_L0 (iSubMBType) ? LIST_0 : LIST_1; | 1002 | int32_t listIdx = IS_TYPE_L0 (iSubMBType) ? LIST_0 : LIST_1; |
| 1003 | int32_t iRefIndex = pCurDqLayer->pRefIndex[listIdx][iMBXY][iIIdx]; | 1003 | int32_t iRefIndex = pCurDqLayer->pDec->pRefIndex[listIdx][iMBXY][iIIdx]; |
| 1004 | for (int32_t j = 0; j < 4; j++) { | 1004 | for (int32_t j = 0; j < 4; j++) { |
| 1005 | int32_t iUVLineStride; | 1005 | int32_t iUVLineStride; |
| 1006 | iJIdx = ((j >> 1) << 2) + (j & 1); | 1006 | iJIdx = ((j >> 1) << 2) + (j & 1); |
| @@ -1013,8 +1013,8 @@ int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWels · 6 unmodified lines | |||
| 1013 | pMCRefMem.pDstU = pDstU + iUVLineStride; | 1013 | pMCRefMem.pDstU = pDstU + iUVLineStride; |
| 1014 | pMCRefMem.pDstV = pDstV + iUVLineStride; | 1014 | pMCRefMem.pDstV = pDstV + iUVLineStride; |
| 1015 | 1015 | ||
| 1016 | iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][iIIdx + iJIdx][0]; | 1016 | iMVs[0] = pCurDqLayer->pDec->pMv[listIdx][iMBXY][iIIdx + iJIdx][0]; |
| 1017 | iMVs[1] = pCurDqLayer->pMv[listIdx][iMBXY][iIIdx + iJIdx][1]; | 1017 | iMVs[1] = pCurDqLayer->pDec->pMv[listIdx][iMBXY][iIIdx + iJIdx][1]; |
| 1018 | BaseMC (&pMCRefMem, iXOffset + iBlk4X, iYOffset + iBlk4Y, pMCFunc, 4, 4, iMVs); | 1018 | BaseMC (&pMCRefMem, iXOffset + iBlk4X, iYOffset + iBlk4Y, pMCFunc, 4, 4, iMVs); |
| 1019 | if (bWeightedBipredIdcIs1) { | 1019 | if (bWeightedBipredIdcIs1) { |
| 1020 | WeightPrediction (pCurDqLayer, &pMCRefMem, listIdx, iRefIndex, 4, 4); | 1020 | WeightPrediction (pCurDqLayer, &pMCRefMem, listIdx, iRefIndex, 4, 4); |