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
134134 if (0 == pCurNal->sNalHeaderExt.uiTemporalId) {
135135 pCtx->bReferenceLostAtT0Flag = true;
136136 }
137+ if (pCtx->iErrorConMethod == ERROR_CON_DISABLE) {
137138 #ifndef LONG_TERM_REF
138− if (pCtx->bReferenceLostAtT0Flag) {
139− ResetParameterSetsState (pCtx);
140− }
139+ if (pCtx->bReferenceLostAtT0Flag) {
140+ ResetParameterSetsState (pCtx);
141+ }
141142 #endif
143+ }
142144 pCtx->iErrorCode |= dsBitstreamError;
143145 }
144146
@@ -146,11 +148,13 @@ inline void HandleReferenceLost (PWelsDecoderContext pCtx, PNalUnit pCurNal) · 1 unmodified line
146148 if ((0 == pCurNal->sNalHeaderExt.uiTemporalId) || (1 == pCurNal->sNalHeaderExt.uiTemporalId)) {
147149 pCtx->bReferenceLostAtT0Flag = true;
148150 }
151+ if (pCtx->iErrorConMethod == ERROR_CON_DISABLE) {
149152 #ifndef LONG_TERM_REF
150− if (pCtx->bReferenceLostAtT0Flag) {
151− ResetParameterSetsState (pCtx);
152− }
153+ if (pCtx->bReferenceLostAtT0Flag) {
154+ ResetParameterSetsState (pCtx);
155+ }
153156 #endif
157+ }
154158 pCtx->iErrorCode |= dsRefLost;
155159 }
156160
@@ -901,13 +905,15 @@ int32_t UpdateAccessUnit (PWelsDecoderContext pCtx) { · 744 unmodified lines
901905 if (uiActualIdx ==
902906 pCurAu->uiActualUnitsNum) { // no found IDR nal within incoming AU, need exit to avoid mosaic issue, 11/19/2009
903907 WelsLog (pCtx, WELS_LOG_WARNING, "UpdateAccessUnit():::::Key frame lost.....CAN NOT find IDR from current AU.\n");
908+ if (pCtx->iErrorCode == ERROR_CON_DISABLE) {
904909 #ifdef LONG_TERM_REF
905− pCtx->iErrorCode |= dsNoParamSets;
906− return dsNoParamSets;
910+ pCtx->iErrorCode |= dsNoParamSets;
911+ return dsNoParamSets;
907912 #else
908− pCtx->iErrorCode |= dsRefLost;
909− return ERR_INFO_REFERENCE_PIC_LOST;
913+ pCtx->iErrorCode |= dsRefLost;
914+ return ERR_INFO_REFERENCE_PIC_LOST;
910915 #endif
916+ }
911917 }
912918 }
913919
@@ -1580,9 +1586,8 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 666 unmodified lines
15801586 pCtx->pSps = pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps;
15811587 pCtx->pPps = pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pPps;
15821588
1583− //try to allocate or relocate DPB memory only when IDR arrival.
1584− if (NAL_UNIT_CODED_SLICE_IDR == pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalHeaderExt.sNalUnitHeader.eNalUnitType ||
1585− pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalHeaderExt.bIdrFlag) {
1589+ //try to allocate or relocate DPB memory only when new sequence is coming.
1590+ if (pCtx->bNewSeqBegin) {
15861591 WelsResetRefPic (pCtx); //clear ref pPic when IDR NAL
15871592 iErr = SyncPictureResolutionExt (pCtx, pCtx->pSps->iMbWidth, pCtx->pSps->iMbHeight);
15881593

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