Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 4 files). Show all
Unified · Split
| @@ -134,11 +134,13 @@ inline void HandleReferenceLostL0 (PWelsDecoderContext pCtx, PNalUnit pCurNal · 133 unmodified lines | ||
| 134 | 134 | if (0 == pCurNal->sNalHeaderExt.uiTemporalId) { |
| 135 | 135 | pCtx->bReferenceLostAtT0Flag = true; |
| 136 | 136 | } |
| 137 | + if (pCtx->iErrorConMethod == ERROR_CON_DISABLE) { | |
| 137 | 138 | #ifndef LONG_TERM_REF |
| 138 | − if (pCtx->bReferenceLostAtT0Flag) { | |
| 139 | − ResetParameterSetsState (pCtx); | |
| 140 | − } | |
| 139 | + if (pCtx->bReferenceLostAtT0Flag) { | |
| 140 | + ResetParameterSetsState (pCtx); | |
| 141 | + } | |
| 141 | 142 | #endif |
| 143 | + } | |
| 142 | 144 | pCtx->iErrorCode |= dsBitstreamError; |
| 143 | 145 | } |
| 144 | 146 | |
| @@ -146,11 +148,13 @@ inline void HandleReferenceLost (PWelsDecoderContext pCtx, PNalUnit pCurNal) · 1 unmodified line | ||
| 146 | 148 | if ((0 == pCurNal->sNalHeaderExt.uiTemporalId) || (1 == pCurNal->sNalHeaderExt.uiTemporalId)) { |
| 147 | 149 | pCtx->bReferenceLostAtT0Flag = true; |
| 148 | 150 | } |
| 151 | + if (pCtx->iErrorConMethod == ERROR_CON_DISABLE) { | |
| 149 | 152 | #ifndef LONG_TERM_REF |
| 150 | − if (pCtx->bReferenceLostAtT0Flag) { | |
| 151 | − ResetParameterSetsState (pCtx); | |
| 152 | − } | |
| 153 | + if (pCtx->bReferenceLostAtT0Flag) { | |
| 154 | + ResetParameterSetsState (pCtx); | |
| 155 | + } | |
| 153 | 156 | #endif |
| 157 | + } | |
| 154 | 158 | pCtx->iErrorCode |= dsRefLost; |
| 155 | 159 | } |
| 156 | 160 | |
| @@ -901,13 +905,15 @@ int32_t UpdateAccessUnit (PWelsDecoderContext pCtx) { · 744 unmodified lines | ||
| 901 | 905 | if (uiActualIdx == |
| 902 | 906 | pCurAu->uiActualUnitsNum) { // no found IDR nal within incoming AU, need exit to avoid mosaic issue, 11/19/2009 |
| 903 | 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 | 909 | #ifdef LONG_TERM_REF |
| 905 | − pCtx->iErrorCode |= dsNoParamSets; | |
| 906 | − return dsNoParamSets; | |
| 910 | + pCtx->iErrorCode |= dsNoParamSets; | |
| 911 | + return dsNoParamSets; | |
| 907 | 912 | #else |
| 908 | − pCtx->iErrorCode |= dsRefLost; | |
| 909 | − return ERR_INFO_REFERENCE_PIC_LOST; | |
| 913 | + pCtx->iErrorCode |= dsRefLost; | |
| 914 | + return ERR_INFO_REFERENCE_PIC_LOST; | |
| 910 | 915 | #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 | 1586 | pCtx->pSps = pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps; |
| 1581 | 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. | |
| 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) { | |
| 1586 | 1591 | WelsResetRefPic (pCtx); //clear ref pPic when IDR NAL |
| 1587 | 1592 | iErr = SyncPictureResolutionExt (pCtx, pCtx->pSps->iMbWidth, pCtx->pSps->iMbHeight); |
| 1588 | 1593 | |