History

fix one more Bug-1485134 from Bugzilla reported. Add WELS_B_MB_REC_VERIFY to verify if ref picture is lost

xiaotiansf committed 8 years ago

Commit 18d360b1 parent e89f8a53 files · +26 −15Browse files

Showing the changes to codec/decoder/core/src/rec_mb.cpp (1 of 3 files). Show all

Unified · Split

codec/decoder/core/src/rec_mb.cpp+17−13
@@ -214,8 +214,8 @@ int32_t RecI16x16Mb (int32_t iMBXY, PWelsDecoderContext pCtx, int16_t* pScoeffLe · 213 unmodified lines
214214
215215
216216 //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) {
219219 PPicture pRefPic;
220220
221221 int8_t iRefIdx = pRefIdxList[iIndex];
@@ -229,8 +229,11 @@ static inline void GetRefPic (sMCRefMember* pMCRefMem, PWelsDecoderContext pCtx, · 7 unmodified lines
229229 pMCRefMem->pSrcY = pRefPic->pData[0];
230230 pMCRefMem->pSrcU = pRefPic->pData[1];
231231 pMCRefMem->pSrcV = pRefPic->pData[2];
232+
233+ return ERR_NONE;
232234 }
233235 }
236+ return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_DATA, ERR_INFO_REFERENCE_PIC_LOST);
234237 }
235238
236239
@@ -635,7 +638,7 @@ void GetInterPred (uint8_t* pPredY, uint8_t* pPredCb, uint8_t* pPredCr, PWelsDec · 398 unmodified lines
635638 }
636639 }
637640
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) {
639642 sMCRefMember pMCRefMem;
640643 sMCRefMember pTempMCRefMem;
641644
@@ -680,12 +683,12 @@ void GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDec · 38 unmodified lines
680683 if (IS_TYPE_L0 (iMBType) && IS_TYPE_L1 (iMBType)) {
681684 iMVs[0] = pCurDqLayer->pMv[LIST_0][iMBXY][0][0];
682685 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));
684687 BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs);
685688
686689 iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][0][0];
687690 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));
689692 BaseMC (&pTempMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs);
690693 iRefIndex1 = pCurDqLayer->pRefIndex[LIST_0][iMBXY][0];
691694 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
698701 int32_t listIdx = (iMBType & MB_TYPE_P0L0) ? LIST_0 : LIST_1;
699702 iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][0][0];
700703 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));
702705 BaseMC (&pMCRefMem, iMBOffsetX, iMBOffsetY, pMCFunc, 16, 16, iMVs);
703706 if (bWeightedBipredIdcIs1) {
704707 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
715718 lastListIdx = listIdx;
716719 iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][iPartIdx][0];
717720 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));
719722 if (i) {
720723 pMCRefMem.pDstY += (iDstLineLuma << 3);
721724 pMCRefMem.pDstU += (iDstLineChroma << 2);
@@ -725,7 +728,7 @@ void GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDec · 3 unmodified lines
725728 if (++listCount == 2) {
726729 iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][iPartIdx][0];
727730 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));
729732 if (i) {
730733 pTempMCRefMem.pDstY += (iDstLineLuma << 3);
731734 pTempMCRefMem.pDstU += (iDstLineChroma << 2);
@@ -758,7 +761,7 @@ void GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDec · 26 unmodified lines
758761 lastListIdx = listIdx;
759762 iMVs[0] = pCurDqLayer->pMv[listIdx][iMBXY][i << 1][0];
760763 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));
762765 if (i) {
763766 pMCRefMem.pDstY += 8;
764767 pMCRefMem.pDstU += 4;
@@ -768,7 +771,7 @@ void GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDec · 3 unmodified lines
768771 if (++listCount == 2) {
769772 iMVs[0] = pCurDqLayer->pMv[LIST_1][iMBXY][i << 1][0];
770773 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));
772775 if (i) {
773776 pTempMCRefMem.pDstY += 8;
774777 pTempMCRefMem.pDstU += 4;
@@ -825,14 +828,14 @@ void GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDec · 50 unmodified lines
825828
826829 if ((IS_TYPE_L0 (iSubMBType) && IS_TYPE_L1 (iSubMBType))) {
827830 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));
829832
830833 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));
832835 } else {
833836 int32_t listIdx = IS_TYPE_L0 (iSubMBType) ? LIST_0 : LIST_1;
834837 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));
836839 }
837840
838841 if (IS_SUB_8x8 (iSubMBType)) {
@@ -1018,6 +1021,7 @@ void GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDec · 179 unmodified lines
10181021 }
10191022 }
10201023 }
1024+ return ERR_NONE;
10211025 }
10221026
10231027 int32_t RecChroma (int32_t iMBXY, PWelsDecoderContext pCtx, int16_t* pScoeffLevel, PDqLayer pDqLayer) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t