Showing the changes to codec/decoder/core/src/error_concealment.cpp (1 of 6 files). Show all
Unified · Split
| @@ -41,7 +41,7 @@ · 40 unmodified lines | ||
| 41 | 41 | namespace WelsDec { |
| 42 | 42 | //Init |
| 43 | 43 | void InitErrorCon (PWelsDecoderContext pCtx) { |
| 44 | − if (pCtx->eErrorConMethod == ERROR_CON_SLICE_COPY) { | |
| 44 | + if ((pCtx->eErrorConMethod == ERROR_CON_SLICE_COPY) || (pCtx->eErrorConMethod == ERROR_CON_SLICE_COPY_CROSS_IDR)) { | |
| 45 | 45 | pCtx->sCopyFunc.pCopyLumaFunc = WelsCopy16x16_c; |
| 46 | 46 | pCtx->sCopyFunc.pCopyChromaFunc = WelsCopy8x8_c; |
| 47 | 47 | |
| @@ -79,6 +79,8 @@ void DoErrorConFrameCopy (PWelsDecoderContext pCtx) { · 31 unmodified lines | ||
| 79 | 79 | uint32_t uiHeightInPixelY = (pCtx->pSps->iMbHeight) << 4; |
| 80 | 80 | int32_t iStrideY = pDstPic->iLinesize[0]; |
| 81 | 81 | int32_t iStrideUV = pDstPic->iLinesize[1]; |
| 82 | + if ((pCtx->eErrorConMethod == ERROR_CON_FRAME_COPY) && (pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag)) | |
| 83 | + pSrcPic = NULL; //no cross IDR method, should fill in data instead of copy | |
| 82 | 84 | if (pSrcPic == NULL) { //no ref pic, assign specific data to picture |
| 83 | 85 | memset (pDstPic->pData[0], 128, uiHeightInPixelY * iStrideY); |
| 84 | 86 | memset (pDstPic->pData[1], 128, (uiHeightInPixelY >> 1) * iStrideUV); |
| @@ -97,6 +99,8 @@ void DoErrorConSliceCopy (PWelsDecoderContext pCtx) { · 12 unmodified lines | ||
| 97 | 99 | int32_t iMbHeight = (int32_t) pCtx->pSps->iMbHeight; |
| 98 | 100 | PPicture pDstPic = pCtx->pDec; |
| 99 | 101 | PPicture pSrcPic = pCtx->pPreviousDecodedPictureInDpb; |
| 102 | + if ((pCtx->eErrorConMethod == ERROR_CON_SLICE_COPY) && (pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag)) | |
| 103 | + pSrcPic = NULL; //no cross IDR method, should fill in data instead of copy | |
| 100 | 104 | |
| 101 | 105 | //uint8_t *pDstData[3], *pSrcData[3]; |
| 102 | 106 | bool* pMbCorrectlyDecodedFlag = pCtx->pCurDqLayer->pMbCorrectlyDecodedFlag; |
| @@ -183,9 +187,11 @@ void ImplementErrorCon (PWelsDecoderContext pCtx) { · 80 unmodified lines | ||
| 183 | 187 | if (ERROR_CON_DISABLE == pCtx->eErrorConMethod) { |
| 184 | 188 | pCtx->iErrorCode |= dsBitstreamError; |
| 185 | 189 | return; |
| 186 | − } else if (ERROR_CON_FRAME_COPY == pCtx->eErrorConMethod) { | |
| 190 | + } else if ((ERROR_CON_FRAME_COPY == pCtx->eErrorConMethod) | |
| 191 | + || (ERROR_CON_FRAME_COPY_CROSS_IDR == pCtx->eErrorConMethod)) { | |
| 187 | 192 | DoErrorConFrameCopy (pCtx); |
| 188 | − } else if (ERROR_CON_SLICE_COPY == pCtx->eErrorConMethod) { | |
| 193 | + } else if ((ERROR_CON_SLICE_COPY == pCtx->eErrorConMethod) | |
| 194 | + || (ERROR_CON_SLICE_COPY_CROSS_IDR == pCtx->eErrorConMethod)) { | |
| 189 | 195 | DoErrorConSliceCopy (pCtx); |
| 190 | 196 | } //TODO add other EC methods here in the future |
| 191 | 197 | pCtx->iErrorCode |= dsDataErrorConcealed; |