Showing the changes to codec/decoder/core/src/rec_mb.cpp (1 of 3 files). Show all
Unified · Split
| @@ -214,8 +214,8 @@ int32_t RecI16x16Mb (int32_t iMBXY, PWelsDecoderContext pCtx, int16_t* pScoeffLe · 213 unmodified lines | ||
| 214 | 214 | |
| 215 | 215 | |
| 216 | 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, | |
| 218 | − int32_t iIndex, int32_t listIdx) { | |
| 217 | +static inline int32_t GetRefPic (sMCRefMember* pMCRefMem, PWelsDecoderContext pCtx, int8_t* pRefIdxList, | |
| 218 | + int32_t iIndex, int32_t listIdx) { | |
| 219 | 219 | PPicture pRefPic; |
| 220 | 220 | |
| 221 | 221 | int8_t iRefIdx = pRefIdxList[iIndex]; |
| @@ -229,8 +229,11 @@ static inline void GetRefPic (sMCRefMember* pMCRefMem, PWelsDecoderContext pCtx, · 7 unmodified lines | ||
| 229 | 229 | pMCRefMem->pSrcY = pRefPic->pData[0]; |
| 230 | 230 | pMCRefMem->pSrcU = pRefPic->pData[1]; |
| 231 | 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 | 642 | sMCRefMember pMCRefMem; |
| 640 | 643 | sMCRefMember pTempMCRefMem; |
| 641 | 644 | |
| @@ -680,12 +683,12 @@ void GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDec · 38 unmodified lines | ||
| 680 | 683 | if (IS_TYPE_L0 (iMBType) && IS_TYPE_L1 (iMBType)) { |
| 681 | 684 | iMVs[0] = pCurDqLayer->pMv[LIST_0][iMBXY][0][0]; |
| 682 | 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 | 687 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs); |
| 685 | 688 | |
| 686 | 689 | iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][0][0]; |
| 687 | 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 | 692 | BaseMC (&pTempMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs); |
| 690 | 693 | iRefIndex1 = pCurDqLayer->pRefIndex[LIST_0][iMBXY][0]; |
| 691 | 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 | 701 | int32_t listIdx = (iMBType & MB_TYPE_P0L0) ? LIST_0 : LIST_1; |
| 699 | 702 | iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][0][0]; |
| 700 | 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 | 705 | BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs); |
| 703 | 706 | if (bWeightedBipredIdcIs1) { |
| 704 | 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 | 718 | lastListIdx = listIdx; |
| 716 | 719 | iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][iPartIdx][0]; |
| 717 | 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 | 722 | if (i) { |
| 720 | 723 | pMCRefMem.pDstY += (iDstLineLuma << 3); |
| 721 | 724 | pMCRefMem.pDstU += (iDstLineChroma << 2); |
| @@ -725,7 +728,7 @@ void GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDec · 3 unmodified lines | ||
| 725 | 728 | if (++listCount == 2) { |
| 726 | 729 | iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][iPartIdx][0]; |
| 727 | 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 | 732 | if (i) { |
| 730 | 733 | pTempMCRefMem.pDstY += (iDstLineLuma << 3); |
| 731 | 734 | pTempMCRefMem.pDstU += (iDstLineChroma << 2); |
| @@ -758,7 +761,7 @@ void GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDec · 26 unmodified lines | ||
| 758 | 761 | lastListIdx = listIdx; |
| 759 | 762 | iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][i << 1][0]; |
| 760 | 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 | 765 | if (i) { |
| 763 | 766 | pMCRefMem.pDstY += 8; |
| 764 | 767 | pMCRefMem.pDstU += 4; |
| @@ -768,7 +771,7 @@ void GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDec · 3 unmodified lines | ||
| 768 | 771 | if (++listCount == 2) { |
| 769 | 772 | iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][i << 1][0]; |
| 770 | 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 | 775 | if (i) { |
| 773 | 776 | pTempMCRefMem.pDstY += 8; |
| 774 | 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 | 829 | if ((IS_TYPE_L0 (iSubMBType) && IS_TYPE_L1 (iSubMBType))) { |
| 827 | 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 | 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 | 835 | } else { |
| 833 | 836 | int32_t listIdx = IS_TYPE_L0 (iSubMBType) ? LIST_0 : LIST_1; |
| 834 | 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 | 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 | 1027 | int32_t RecChroma (int32_t iMBXY, PWelsDecoderContext pCtx, int16_t* pScoeffLevel, PDqLayer pDqLayer) { |