Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 5 files). Show all
Unified · Split
| @@ -114,8 +114,8 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 113 unmodified lines | |||
| 114 | pDstInfo->iBufferStatus = (int32_t) (bFrameCompleteFlag | 114 | pDstInfo->iBufferStatus = (int32_t) (bFrameCompleteFlag |
| 115 | && pPic->bIsComplete); // When EC disable, ECed picture not output | 115 | && pPic->bIsComplete); // When EC disable, ECed picture not output |
| 116 | else if ((pCtx->eErrorConMethod == ERROR_CON_SLICE_COPY_CROSS_IDR_FREEZE_RES_CHANGE | 116 | else if ((pCtx->eErrorConMethod == ERROR_CON_SLICE_COPY_CROSS_IDR_FREEZE_RES_CHANGE |
| 117 | || pCtx->eErrorConMethod == ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE) | 117 | || pCtx->eErrorConMethod == ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE) |
| 118 | && pCtx->iErrorCode && bOutResChange) | 118 | && pCtx->iErrorCode && bOutResChange) |
| 119 | pCtx->bFreezeOutput = true; | 119 | pCtx->bFreezeOutput = true; |
| 120 | 120 | ||
| 121 | if ((pDstInfo->iBufferStatus == 1) && (pCurDq->sLayerInfo.sNalHeaderExt.bIdrFlag)) { | 121 | if ((pDstInfo->iBufferStatus == 1) && (pCurDq->sLayerInfo.sNalHeaderExt.bIdrFlag)) { |
| @@ -151,13 +151,6 @@ inline void HandleReferenceLostL0 (PWelsDecoderContext pCtx, PNalUnit pCurNal · 29 unmodified lines | |||
| 151 | if (0 == pCurNal->sNalHeaderExt.uiTemporalId) { | 151 | if (0 == pCurNal->sNalHeaderExt.uiTemporalId) { |
| 152 | pCtx->bReferenceLostAtT0Flag = true; | 152 | pCtx->bReferenceLostAtT0Flag = true; |
| 153 | } | 153 | } |
| 154 | if (pCtx->eErrorConMethod == ERROR_CON_DISABLE) { | ||
| 155 | #ifndef LONG_TERM_REF | ||
| 156 | if (pCtx->bReferenceLostAtT0Flag) { | ||
| 157 | ResetParameterSetsState (pCtx); | ||
| 158 | } | ||
| 159 | #endif | ||
| 160 | } | ||
| 161 | pCtx->iErrorCode |= dsBitstreamError; | 154 | pCtx->iErrorCode |= dsBitstreamError; |
| 162 | } | 155 | } |
| 163 | 156 | ||
| @@ -165,13 +158,6 @@ inline void HandleReferenceLost (PWelsDecoderContext pCtx, PNalUnit pCurNal) · 1 unmodified line | |||
| 165 | if ((0 == pCurNal->sNalHeaderExt.uiTemporalId) || (1 == pCurNal->sNalHeaderExt.uiTemporalId)) { | 158 | if ((0 == pCurNal->sNalHeaderExt.uiTemporalId) || (1 == pCurNal->sNalHeaderExt.uiTemporalId)) { |
| 166 | pCtx->bReferenceLostAtT0Flag = true; | 159 | pCtx->bReferenceLostAtT0Flag = true; |
| 167 | } | 160 | } |
| 168 | if (pCtx->eErrorConMethod == ERROR_CON_DISABLE) { | ||
| 169 | #ifndef LONG_TERM_REF | ||
| 170 | if (pCtx->bReferenceLostAtT0Flag) { | ||
| 171 | ResetParameterSetsState (pCtx); | ||
| 172 | } | ||
| 173 | #endif | ||
| 174 | } | ||
| 175 | pCtx->iErrorCode |= dsRefLost; | 161 | pCtx->iErrorCode |= dsRefLost; |
| 176 | } | 162 | } |
| 177 | 163 | ||
| @@ -1877,14 +1863,6 @@ void InitCurDqLayerData (PWelsDecoderContext pCtx, PDqLayer pCurDq) { · 1699 unmodified lines | |||
| 1877 | } | 1863 | } |
| 1878 | } | 1864 | } |
| 1879 | 1865 | ||
| 1880 | // added to reset state of parameter sets to waiting successive incoming IDR, 6/4/2010 | ||
| 1881 | // It will be called in case packets lost/ broken and decoded failed at temporal level 0 | ||
| 1882 | void ResetParameterSetsState (PWelsDecoderContext pCtx) { | ||
| 1883 | pCtx->bSpsExistAheadFlag = false; | ||
| 1884 | pCtx->bSubspsExistAheadFlag = false; | ||
| 1885 | pCtx->bPpsExistAheadFlag = false; | ||
| 1886 | } | ||
| 1887 | |||
| 1888 | /* | 1866 | /* |
| 1889 | * DecodeCurrentAccessUnit | 1867 | * DecodeCurrentAccessUnit |
| 1890 | * Decode current access unit when current AU is completed. | 1868 | * Decode current access unit when current AU is completed. |
| @@ -2021,7 +1999,6 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 130 unmodified lines | |||
| 2021 | #else | 1999 | #else |
| 2022 | pCtx->bReferenceLostAtT0Flag = true; | 2000 | pCtx->bReferenceLostAtT0Flag = true; |
| 2023 | #endif | 2001 | #endif |
| 2024 | ResetParameterSetsState (pCtx); | ||
| 2025 | return ERR_INFO_REFERENCE_PIC_LOST; | 2002 | return ERR_INFO_REFERENCE_PIC_LOST; |
| 2026 | } | 2003 | } |
| 2027 | } | 2004 | } |
| @@ -2131,7 +2108,8 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 103 unmodified lines | |||
| 2131 | pCtx->pDec->iLinesize, | 2108 | pCtx->pDec->iLinesize, |
| 2132 | pCtx->sExpandPicFunc.pfExpandLumaPicture, pCtx->sExpandPicFunc.pfExpandChromaPicture); | 2109 | pCtx->sExpandPicFunc.pfExpandLumaPicture, pCtx->sExpandPicFunc.pfExpandChromaPicture); |
| 2133 | pCtx->pDec = NULL; | 2110 | pCtx->pDec = NULL; |
| 2134 | } else if (pCtx->eErrorConMethod == ERROR_CON_SLICE_MV_COPY_CROSS_IDR || pCtx->eErrorConMethod == ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE) { | 2111 | } else if (pCtx->eErrorConMethod == ERROR_CON_SLICE_MV_COPY_CROSS_IDR |
| 2112 | || pCtx->eErrorConMethod == ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE) { | ||
| 2135 | pCtx->pPreviousDecodedPictureInDpb = pCtx->pDec; //store latest decoded picture for MV Copy EC | 2113 | pCtx->pPreviousDecodedPictureInDpb = pCtx->pDec; //store latest decoded picture for MV Copy EC |
| 2136 | pCtx->pDec = NULL; | 2114 | pCtx->pDec = NULL; |
| 2137 | } | 2115 | } |
| @@ -2164,7 +2142,8 @@ bool CheckAndFinishLastPic (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferIn · 26 unmodified lines | |||
| 2164 | if (pCtx->sLastNalHdrExt.sNalUnitHeader.uiNalRefIdc > 0) { | 2142 | if (pCtx->sLastNalHdrExt.sNalUnitHeader.uiNalRefIdc > 0) { |
| 2165 | pCtx->pPreviousDecodedPictureInDpb = pCtx->pDec; //save ECed pic for future use | 2143 | pCtx->pPreviousDecodedPictureInDpb = pCtx->pDec; //save ECed pic for future use |
| 2166 | MarkECFrameAsRef (pCtx); | 2144 | MarkECFrameAsRef (pCtx); |
| 2167 | } else if (pCtx->eErrorConMethod == ERROR_CON_SLICE_MV_COPY_CROSS_IDR || pCtx->eErrorConMethod == ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE) { | 2145 | } else if (pCtx->eErrorConMethod == ERROR_CON_SLICE_MV_COPY_CROSS_IDR |
| 2146 | || pCtx->eErrorConMethod == ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE) { | ||
| 2168 | pCtx->pPreviousDecodedPictureInDpb = pCtx->pDec; //save ECed pic for future MV Copy use | 2147 | pCtx->pPreviousDecodedPictureInDpb = pCtx->pDec; //save ECed pic for future MV Copy use |
| 2169 | } | 2148 | } |
| 2170 | } else { | 2149 | } else { |