| @@ -214,8 +214,8 @@ int32_t RecI16x16Mb (int32_t iMBXY, PWelsDecoderContext pCtx, int16_t* pScoeffLe · 213 unmodified lines |
| 214 | | 214 | |
| 215 | | 215 | |
| 216 | //according to current 8*8 block ref_index to gain reference picture | 216 | //according to current 8*8 block ref_index to gain reference picture |
| 217 | static inline void GetRefPic (sMCRefMember* pMCRefMem, PWelsDecoderContext pCtx, int8_t* pRefIdxList, | 217 | static inline int32_t GetRefPic (sMCRefMember* pMCRefMem, PWelsDecoderContext pCtx, int8_t* pRefIdxList, |
| 218 | int32_t iIndex, int32_t listIdx) { | 218 | int32_t iIndex, int32_t listIdx) { |
| 219 | PPicture pRefPic; | 219 | PPicture pRefPic; |
| 220 | | 220 | |
| 221 | int8_t iRefIdx = pRefIdxList[iIndex]; | 221 | int8_t iRefIdx = pRefIdxList[iIndex]; |
| @@ -229,8 +229,11 @@ static inline void GetRefPic (sMCRefMember* pMCRefMem, PWelsDecoderContext pCtx, · 7 unmodified lines |
| 229 | pMCRefMem->pSrcY = pRefPic->pData[0]; | 229 | pMCRefMem->pSrcY = pRefPic->pData[0]; |
| 230 | pMCRefMem->pSrcU = pRefPic->pData[1]; | 230 | pMCRefMem->pSrcU = pRefPic->pData[1]; |
| 231 | pMCRefMem->pSrcV = pRefPic->pData[2]; | 231 | pMCRefMem->pSrcV = pRefPic->pData[2]; |
| | 232 | |
| | 233 | return ERR_NONE; |
| 232 | } | 234 | } |
| 233 | } | 235 | } |
| | 236 | return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_DATA, ERR_INFO_REFERENCE_PIC_LOST); |
| 234 | } | 237 | } |
| 235 | | 238 | |
| 236 | | 239 | |
| @@ -635,7 +638,7 @@ void GetInterPred (uint8_t* pPredY, uint8_t* pPredCb, uint8_t* pPredCr, PWelsDec · 398 unmodified lines |
| 635 | } | 638 | } |
| 636 | } | 639 | } |
| 637 | | 640 | |
| 638 | void GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDecoderContext pCtx) { | 641 | int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDecoderContext pCtx) { |
| 639 | sMCRefMember pMCRefMem; | 642 | sMCRefMember pMCRefMem; |
| 640 | sMCRefMember pTempMCRefMem; | 643 | sMCRefMember pTempMCRefMem; |
| 641 | | 644 | |
| @@ -680,12 +683,12 @@ void GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDec · 38 unmodified lines |
| 680 | if (IS_TYPE_L0 (iMBType) && IS_TYPE_L1 (iMBType)) { | 683 | if (IS_TYPE_L0 (iMBType) && IS_TYPE_L1 (iMBType)) { |
| 681 | iMVs[0] = pCurDqLayer->pMv[LIST_0][iMBXY][0][0]; | 684 | iMVs[0] = pCurDqLayer->pMv[LIST_0][iMBXY][0][0]; |
| 682 | iMVs[1] = pCurDqLayer->pMv[LIST_0][iMBXY][0][1]; | 685 | iMVs[1] = pCurDqLayer->pMv[LIST_0][iMBXY][0][1]; |
| 683 | GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[LIST_0][iMBXY], 0, LIST_0); | 686 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[LIST_0][iMBXY], 0, LIST_0)); |
| 684 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs); | 687 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs); |
| 685 | | 688 | |
| 686 | iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][0][0]; | 689 | iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][0][0]; |
| 687 | iMVs[1] = pCurDqLayer->pMv[LIST_1][iMBXY][0][1]; | 690 | iMVs[1] = pCurDqLayer->pMv[LIST_1][iMBXY][0][1]; |
| 688 | GetRefPic (&pTempMCRefMem, pCtx, pCurDqLayer->pRefIndex[LIST_1][iMBXY], 0, LIST_1); | 691 | WELS_B_MB_REC_VERIFY (GetRefPic (&pTempMCRefMem, pCtx, pCurDqLayer->pRefIndex[LIST_1][iMBXY], 0, LIST_1)); |
| 689 | BaseMC (&pTempMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs); | 692 | BaseMC (&pTempMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs); |
| 690 | iRefIndex1 = pCurDqLayer->pRefIndex[LIST_0][iMBXY][0]; | 693 | iRefIndex1 = pCurDqLayer->pRefIndex[LIST_0][iMBXY][0]; |
| 691 | iRefIndex2 = pCurDqLayer->pRefIndex[LIST_1][iMBXY][0]; | 694 | iRefIndex2 = pCurDqLayer->pRefIndex[LIST_1][iMBXY][0]; |
| @@ -698,7 +701,7 @@ void GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDec · 6 unmodified lines |
| 698 | int32_t listIdx = (iMBType & MB_TYPE_P0L0) ? LIST_0 : LIST_1; | 701 | int32_t listIdx = (iMBType & MB_TYPE_P0L0) ? LIST_0 : LIST_1; |
| 699 | iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][0][0]; | 702 | iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][0][0]; |
| 700 | iMVs[1] = pCurDqLayer->pMv[listIdx][iMBXY][0][1]; | 703 | iMVs[1] = pCurDqLayer->pMv[listIdx][iMBXY][0][1]; |
| 701 | GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[listIdx][iMBXY], 0, listIdx); | 704 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[listIdx][iMBXY], 0, listIdx)); |
| 702 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs); | 705 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs); |
| 703 | if (bWeightedBipredIdcIs1) { | 706 | if (bWeightedBipredIdcIs1) { |
| 704 | int32_t iRefIndex = pCurDqLayer->pRefIndex[listIdx][iMBXY][0]; | 707 | int32_t iRefIndex = pCurDqLayer->pRefIndex[listIdx][iMBXY][0]; |
| @@ -715,7 +718,7 @@ void GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDec · 10 unmodified lines |
| 715 | lastListIdx = listIdx; | 718 | lastListIdx = listIdx; |
| 716 | iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][iPartIdx][0]; | 719 | iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][iPartIdx][0]; |
| 717 | iMVs[1] = pCurDqLayer->pMv[listIdx][iMBXY][iPartIdx][1]; | 720 | iMVs[1] = pCurDqLayer->pMv[listIdx][iMBXY][iPartIdx][1]; |
| 718 | GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[listIdx][iMBXY], iPartIdx, listIdx); | 721 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[listIdx][iMBXY], iPartIdx, listIdx)); |
| 719 | if (i) { | 722 | if (i) { |
| 720 | pMCRefMem.pDstY += (iDstLineLuma << 3); | 723 | pMCRefMem.pDstY += (iDstLineLuma << 3); |
| 721 | pMCRefMem.pDstU += (iDstLineChroma << 2); | 724 | pMCRefMem.pDstU += (iDstLineChroma << 2); |
| @@ -725,7 +728,7 @@ void GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDec · 3 unmodified lines |
| 725 | if (++listCount == 2) { | 728 | if (++listCount == 2) { |
| 726 | iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][iPartIdx][0]; | 729 | iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][iPartIdx][0]; |
| 727 | iMVs[1] = pCurDqLayer->pMv[LIST_1][iMBXY][iPartIdx][1]; | 730 | iMVs[1] = pCurDqLayer->pMv[LIST_1][iMBXY][iPartIdx][1]; |
| 728 | GetRefPic (&pTempMCRefMem, pCtx, pCurDqLayer->pRefIndex[LIST_1][iMBXY], iPartIdx, LIST_1); | 731 | WELS_B_MB_REC_VERIFY (GetRefPic (&pTempMCRefMem, pCtx, pCurDqLayer->pRefIndex[LIST_1][iMBXY], iPartIdx, LIST_1)); |
| 729 | if (i) { | 732 | if (i) { |
| 730 | pTempMCRefMem.pDstY += (iDstLineLuma << 3); | 733 | pTempMCRefMem.pDstY += (iDstLineLuma << 3); |
| 731 | pTempMCRefMem.pDstU += (iDstLineChroma << 2); | 734 | pTempMCRefMem.pDstU += (iDstLineChroma << 2); |
| @@ -758,7 +761,7 @@ void GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDec · 26 unmodified lines |
| 758 | lastListIdx = listIdx; | 761 | lastListIdx = listIdx; |
| 759 | iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][i << 1][0]; | 762 | iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][i << 1][0]; |
| 760 | iMVs[1] = pCurDqLayer->pMv[listIdx][iMBXY][i << 1][1]; | 763 | iMVs[1] = pCurDqLayer->pMv[listIdx][iMBXY][i << 1][1]; |
| 761 | GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[listIdx][iMBXY], i << 1, listIdx); | 764 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[listIdx][iMBXY], i << 1, listIdx)); |
| 762 | if (i) { | 765 | if (i) { |
| 763 | pMCRefMem.pDstY += 8; | 766 | pMCRefMem.pDstY += 8; |
| 764 | pMCRefMem.pDstU += 4; | 767 | pMCRefMem.pDstU += 4; |
| @@ -768,7 +771,7 @@ void GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDec · 3 unmodified lines |
| 768 | if (++listCount == 2) { | 771 | if (++listCount == 2) { |
| 769 | iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][i << 1][0]; | 772 | iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][i << 1][0]; |
| 770 | iMVs[1] = pCurDqLayer->pMv[LIST_1][iMBXY][i << 1][1]; | 773 | iMVs[1] = pCurDqLayer->pMv[LIST_1][iMBXY][i << 1][1]; |
| 771 | GetRefPic (&pTempMCRefMem, pCtx, pCurDqLayer->pRefIndex[LIST_1][iMBXY], i << 1, LIST_1); | 774 | WELS_B_MB_REC_VERIFY (GetRefPic (&pTempMCRefMem, pCtx, pCurDqLayer->pRefIndex[LIST_1][iMBXY], i << 1, LIST_1)); |
| 772 | if (i) { | 775 | if (i) { |
| 773 | pTempMCRefMem.pDstY += 8; | 776 | pTempMCRefMem.pDstY += 8; |
| 774 | pTempMCRefMem.pDstU += 4; | 777 | pTempMCRefMem.pDstU += 4; |
| @@ -825,14 +828,14 @@ void GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDec · 50 unmodified lines |
| 825 | | 828 | |
| 826 | if ((IS_TYPE_L0 (iSubMBType) && IS_TYPE_L1 (iSubMBType))) { | 829 | if ((IS_TYPE_L0 (iSubMBType) && IS_TYPE_L1 (iSubMBType))) { |
| 827 | iRefIndex1 = pCurDqLayer->pRefIndex[LIST_0][iMBXY][iIIdx]; | 830 | iRefIndex1 = pCurDqLayer->pRefIndex[LIST_0][iMBXY][iIIdx]; |
| 828 | GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[LIST_0][iMBXY], iIIdx, LIST_0); | 831 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[LIST_0][iMBXY], iIIdx, LIST_0)); |
| 829 | | 832 | |
| 830 | iRefIndex2 = pCurDqLayer->pRefIndex[LIST_1][iMBXY][iIIdx]; | 833 | iRefIndex2 = pCurDqLayer->pRefIndex[LIST_1][iMBXY][iIIdx]; |
| 831 | GetRefPic (&pTempMCRefMem, pCtx, pCurDqLayer->pRefIndex[LIST_1][iMBXY], iIIdx, LIST_1); | 834 | WELS_B_MB_REC_VERIFY (GetRefPic (&pTempMCRefMem, pCtx, pCurDqLayer->pRefIndex[LIST_1][iMBXY], iIIdx, LIST_1)); |
| 832 | } else { | 835 | } else { |
| 833 | int32_t listIdx = IS_TYPE_L0 (iSubMBType) ? LIST_0 : LIST_1; | 836 | int32_t listIdx = IS_TYPE_L0 (iSubMBType) ? LIST_0 : LIST_1; |
| 834 | iRefIndex1 = pCurDqLayer->pRefIndex[listIdx][iMBXY][iIIdx]; | 837 | iRefIndex1 = pCurDqLayer->pRefIndex[listIdx][iMBXY][iIIdx]; |
| 835 | GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[listIdx][iMBXY], iIIdx, listIdx); | 838 | WELS_B_MB_REC_VERIFY (GetRefPic (&pMCRefMem, pCtx, pCurDqLayer->pRefIndex[listIdx][iMBXY], iIIdx, listIdx)); |
| 836 | } | 839 | } |
| 837 | | 840 | |
| 838 | if (IS_SUB_8x8 (iSubMBType)) { | 841 | if (IS_SUB_8x8 (iSubMBType)) { |
| @@ -1018,6 +1021,7 @@ void GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDec · 179 unmodified lines |
| 1018 | } | 1021 | } |
| 1019 | } | 1022 | } |
| 1020 | } | 1023 | } |
| | 1024 | return ERR_NONE; |
| 1021 | } | 1025 | } |
| 1022 | | 1026 | |
| 1023 | int32_t RecChroma (int32_t iMBXY, PWelsDecoderContext pCtx, int16_t* pScoeffLevel, PDqLayer pDqLayer) { | 1027 | int32_t RecChroma (int32_t iMBXY, PWelsDecoderContext pCtx, int16_t* pScoeffLevel, PDqLayer pDqLayer) { |