History

enable the case for IDR loss

huili2 committed 12 years ago

Commit 31400541 parent 9d5bc6f4 files · +44 −17Browse files

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

Unified · Split

codec/decoder/core/src/decoder_core.cpp+18−13
@@ -134,11 +134,13 @@ inline void HandleReferenceLostL0 (PWelsDecoderContext pCtx, PNalUnit pCurNal · 133 unmodified lines
134 if (0 == pCurNal->sNalHeaderExt.uiTemporalId) {134 if (0 == pCurNal->sNalHeaderExt.uiTemporalId) {
135 pCtx->bReferenceLostAtT0Flag = true;135 pCtx->bReferenceLostAtT0Flag = true;
136 }136 }
137 if (pCtx->iErrorConMethod == ERROR_CON_DISABLE) {
137#ifndef LONG_TERM_REF138#ifndef LONG_TERM_REF
138 if (pCtx->bReferenceLostAtT0Flag) {139 if (pCtx->bReferenceLostAtT0Flag) {
139 ResetParameterSetsState (pCtx);140 ResetParameterSetsState (pCtx);
140 }141 }
141#endif142#endif
143 }
142 pCtx->iErrorCode |= dsBitstreamError;144 pCtx->iErrorCode |= dsBitstreamError;
143}145}
144 146
@@ -146,11 +148,13 @@ inline void HandleReferenceLost (PWelsDecoderContext pCtx, PNalUnit pCurNal) · 1 unmodified line
146 if ((0 == pCurNal->sNalHeaderExt.uiTemporalId) || (1 == pCurNal->sNalHeaderExt.uiTemporalId)) {148 if ((0 == pCurNal->sNalHeaderExt.uiTemporalId) || (1 == pCurNal->sNalHeaderExt.uiTemporalId)) {
147 pCtx->bReferenceLostAtT0Flag = true;149 pCtx->bReferenceLostAtT0Flag = true;
148 }150 }
151 if (pCtx->iErrorConMethod == ERROR_CON_DISABLE) {
149#ifndef LONG_TERM_REF152#ifndef LONG_TERM_REF
150 if (pCtx->bReferenceLostAtT0Flag) {153 if (pCtx->bReferenceLostAtT0Flag) {
151 ResetParameterSetsState (pCtx);154 ResetParameterSetsState (pCtx);
152 }155 }
153#endif156#endif
157 }
154 pCtx->iErrorCode |= dsRefLost;158 pCtx->iErrorCode |= dsRefLost;
155}159}
156 160
@@ -901,13 +905,15 @@ int32_t UpdateAccessUnit (PWelsDecoderContext pCtx) { · 744 unmodified lines
901 if (uiActualIdx ==905 if (uiActualIdx ==
902 pCurAu->uiActualUnitsNum) { // no found IDR nal within incoming AU, need exit to avoid mosaic issue, 11/19/2009906 pCurAu->uiActualUnitsNum) { // no found IDR nal within incoming AU, need exit to avoid mosaic issue, 11/19/2009
903 WelsLog (pCtx, WELS_LOG_WARNING, "UpdateAccessUnit():::::Key frame lost.....CAN NOT find IDR from current AU.\n");907 WelsLog (pCtx, WELS_LOG_WARNING, "UpdateAccessUnit():::::Key frame lost.....CAN NOT find IDR from current AU.\n");
908 if (pCtx->iErrorCode == ERROR_CON_DISABLE) {
904#ifdef LONG_TERM_REF909#ifdef LONG_TERM_REF
905 pCtx->iErrorCode |= dsNoParamSets;910 pCtx->iErrorCode |= dsNoParamSets;
906 return dsNoParamSets;911 return dsNoParamSets;
907#else912#else
908 pCtx->iErrorCode |= dsRefLost;913 pCtx->iErrorCode |= dsRefLost;
909 return ERR_INFO_REFERENCE_PIC_LOST;914 return ERR_INFO_REFERENCE_PIC_LOST;
910#endif915#endif
916 }
911 }917 }
912 }918 }
913 919
@@ -1580,9 +1586,8 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 666 unmodified lines
1580 pCtx->pSps = pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps;1586 pCtx->pSps = pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps;
1581 pCtx->pPps = pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pPps;1587 pCtx->pPps = pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pPps;
1582 1588
1583 //try to allocate or relocate DPB memory only when IDR arrival.1589 //try to allocate or relocate DPB memory only when new sequence is coming.
1584 if (NAL_UNIT_CODED_SLICE_IDR == pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalHeaderExt.sNalUnitHeader.eNalUnitType ||1590 if (pCtx->bNewSeqBegin) {
1585 pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalHeaderExt.bIdrFlag) {
1586 WelsResetRefPic (pCtx); //clear ref pPic when IDR NAL1591 WelsResetRefPic (pCtx); //clear ref pPic when IDR NAL
1587 iErr = SyncPictureResolutionExt (pCtx, pCtx->pSps->iMbWidth, pCtx->pSps->iMbHeight);1592 iErr = SyncPictureResolutionExt (pCtx, pCtx->pSps->iMbWidth, pCtx->pSps->iMbHeight);
1588 1593

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