History

add flag to count EC Mbs due to ref error add UT

dong zhang committed 11 years ago

Commit 2c468b91 parent ecc8ae611 files · +69 −25Browse files

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

Unified · Split

codec/decoder/core/src/decoder_core.cpp+19−4
@@ -127,6 +127,9 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 126 unmodified lines
127127 WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO, "DecodeFrameConstruction():New sequence detected, but freezed.");
128128 }
129129 }
130+ pCtx->iMbEcedNum = pPic->iMbEcedNum;
131+ pCtx->iMbNum = pPic->iMbNum;
132+ pCtx->iMbEcedPropNum = pPic->iMbEcedPropNum;
130133 UpdateDecStat (pCtx, pDstInfo->iBufferStatus != 0);
131134
132135 return 0;
@@ -1079,6 +1082,8 @@ int32_t InitialDqLayersContext (PWelsDecoderContext pCtx, const int32_t kiMaxWid · 946 unmodified lines
10791082
10801083 pCtx->sMb.pMbCorrectlyDecodedFlag[i] = (bool*) WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (bool),
10811084 "pCtx->sMb.pMbCorrectlyDecodedFlag[]");
1085+ pCtx->sMb.pMbRefConcealedFlag[i] = (bool*) WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (bool),
1086+ "pCtx->pMbRefConcealedFlag[]");
10821087
10831088 // check memory block valid due above allocated..
10841089 WELS_VERIFY_RETURN_IF (ERR_INFO_OUT_OF_MEMORY,
@@ -1100,6 +1105,7 @@ int32_t InitialDqLayersContext (PWelsDecoderContext pCtx, const int32_t kiMaxWid · 15 unmodified lines
11001105 (NULL == pCtx->sMb.pSliceIdc[i]) ||
11011106 (NULL == pCtx->sMb.pResidualPredFlag[i]) ||
11021107 (NULL == pCtx->sMb.pInterPredictionDoneFlag[i]) ||
1108+ (NULL == pCtx->sMb.pMbRefConcealedFlag[i]) ||
11031109 (NULL == pCtx->sMb.pMbCorrectlyDecodedFlag[i])
11041110 )
11051111 )
@@ -1243,6 +1249,10 @@ void UninitialDqLayersContext (PWelsDecoderContext pCtx) { · 137 unmodified lines
12431249 pCtx->sMb.pMbCorrectlyDecodedFlag[i] = NULL;
12441250 }
12451251
1252+ if (pCtx->sMb.pMbRefConcealedFlag[i]) {
1253+ WelsFree (pCtx->sMb.pMbRefConcealedFlag[i], "pCtx->sMb.pMbRefConcealedFlag[]");
1254+ pCtx->sMb.pMbRefConcealedFlag[i] = NULL;
1255+ }
12461256 WelsFree (pDq, "pDq");
12471257
12481258 pDq = NULL;
@@ -1683,8 +1693,6 @@ static void WriteBackActiveParameters (PWelsDecoderContext pCtx) { · 434 unmodified lines
16831693 int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferInfo* pDstInfo) {
16841694 int32_t iErr;
16851695 PAccessUnit pCurAu = pCtx->pAccessUnitList;
1686− pCtx->iMbEcedNum = 0;
1687− pCtx->iMbNum = 0;
16881696 pCtx->bAuReadyFlag = false;
16891697 pCtx->bLastHasMmco5 = false;
16901698 bool bTmpNewSeqBegin = CheckNewSeqBeginAndUpdateActiveLayerSps (pCtx);
@@ -1858,6 +1866,7 @@ void InitCurDqLayerData (PWelsDecoderContext pCtx, PDqLayer pCurDq) { · 167 unmodified lines
18581866 pCurDq->pInterPredictionDoneFlag = pCtx->sMb.pInterPredictionDoneFlag[0];
18591867 pCurDq->pResidualPredFlag = pCtx->sMb.pResidualPredFlag[0];
18601868 pCurDq->pMbCorrectlyDecodedFlag = pCtx->sMb.pMbCorrectlyDecodedFlag[0];
1869+ pCurDq->pMbRefConcealedFlag = pCtx->sMb.pMbRefConcealedFlag[0];
18611870 }
18621871 }
18631872
@@ -1916,8 +1925,13 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 52 unmodified lines
19161925 if (pCtx->iTotalNumMbRec == 0) { //Picture start to decode
19171926 for (int32_t i = 0; i < LAYER_NUM_EXCHANGEABLE; ++ i)
19181927 memset (pCtx->sMb.pSliceIdc[i], 0xff, (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int32_t)));
1919− memset (pCtx->pCurDqLayer->pMbCorrectlyDecodedFlag, 0, pCtx->pSps->iMbWidth * pCtx->pSps->iMbHeight);
1928+ memset (pCtx->pCurDqLayer->pMbCorrectlyDecodedFlag, 0, pCtx->pSps->iMbWidth * pCtx->pSps->iMbHeight * sizeof (bool));
1929+ memset (pCtx->pCurDqLayer->pMbRefConcealedFlag, 0, pCtx->pSps->iMbWidth * pCtx->pSps->iMbHeight * sizeof (bool));
1930+ pCtx->pDec->iMbNum = pCtx->pSps->iMbWidth * pCtx->pSps->iMbHeight;
1931+ pCtx->pDec->iMbEcedNum = 0;
1932+ pCtx->pDec->iMbEcedPropNum = 0;
19201933 }
1934+ pCtx->bRPLRError = false;
19211935 GetI4LumaIChromaAddrTable (pCtx->iDecBlockOffsetArray, pCtx->pDec->iLinesize[0], pCtx->pDec->iLinesize[1]);
19221936
19231937 if (pNalCur->sNalHeaderExt.uiLayerDqId > kuiTargetLayerDqId) { // confirmed pNalCur will never be NULL
@@ -1935,7 +1949,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 11 unmodified lines
19351949 iCurrIdD = pNalCur->sNalHeaderExt.uiDependencyId;
19361950 pSh = &pNalCur->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader;
19371951 pShExt = &pNalCur->sNalData.sVclNal.sSliceHeaderExt;
1938−
1952+ pCtx->bRPLRError = false;
19391953 bReconstructSlice = CheckSliceNeedReconstruct (pNalCur->sNalHeaderExt.uiLayerDqId, kuiTargetLayerDqId);
19401954
19411955 memcpy (&pLayerInfo.sNalHeaderExt, &pNalCur->sNalHeaderExt, sizeof (SNalUnitHeaderExt)); //confirmed_safe_unsafe_usage
@@ -2006,6 +2020,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 64 unmodified lines
20062020 if (iCurrIdD == kuiDependencyIdMax && iCurrIdQ == BASE_QUALITY_ID) {
20072021 iRet = InitRefPicList (pCtx, uiNalRefIdc, pSh->iPicOrderCntLsb);
20082022 if (iRet) {
2023+ pCtx->bRPLRError = true;
20092024 bAllRefComplete = false; // RPLR error, set ref pictures complete flag false
20102025 HandleReferenceLost (pCtx, pNalCur);
20112026 WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,

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