Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 7 files). Show all
Unified · Split
| @@ -83,6 +83,7 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 82 unmodified lines | ||
| 83 | 83 | } else if (pCurDq->sLayerInfo.sNalHeaderExt.bIdrFlag |
| 84 | 84 | && (pCtx->iErrorCode == dsErrorFree)) { //complete non-ECed IDR frame done |
| 85 | 85 | pCtx->pDec->bIsComplete = true; |
| 86 | + pCtx->bFreezeOutput = false; | |
| 86 | 87 | } |
| 87 | 88 | |
| 88 | 89 | pCtx->iTotalNumMbRec = 0; |
| @@ -103,9 +104,15 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 14 unmodified lines | ||
| 103 | 104 | ppDst[2] = ppDst[2] + pCtx->sFrameCrop.iTopOffset * pPic->iLinesize[1] + pCtx->sFrameCrop.iLeftOffset; |
| 104 | 105 | pDstInfo->iBufferStatus = 1; |
| 105 | 106 | |
| 107 | + bool bOutResChange = (pCtx->iLastImgWidthInPixel != pDstInfo->UsrData.sSystemBuffer.iWidth) | |
| 108 | + || (pCtx->iLastImgHeightInPixel != pDstInfo->UsrData.sSystemBuffer.iHeight); | |
| 109 | + pCtx->iLastImgWidthInPixel = pDstInfo->UsrData.sSystemBuffer.iWidth; | |
| 110 | + pCtx->iLastImgHeightInPixel = pDstInfo->UsrData.sSystemBuffer.iHeight; | |
| 106 | 111 | if (pCtx->eErrorConMethod == ERROR_CON_DISABLE) //no buffer output if EC is disabled and frame incomplete |
| 107 | 112 | pDstInfo->iBufferStatus = (int32_t) (bFrameCompleteFlag |
| 108 | 113 | && pPic->bIsComplete); // When EC disable, ECed picture not output |
| 114 | + else if (pCtx->eErrorConMethod == ERROR_CON_SLICE_COPY_CROSS_IDR_FREEZE_RES_CHANGE && pCtx->iErrorCode && bOutResChange) | |
| 115 | + pCtx->bFreezeOutput = true; | |
| 109 | 116 | |
| 110 | 117 | |
| 111 | 118 | if ((pDstInfo->iBufferStatus == 1) && (pCurDq->sLayerInfo.sNalHeaderExt.bIdrFlag)) { |
| @@ -120,6 +127,8 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 8 unmodified lines | ||
| 120 | 127 | pCtx->iErrorCode |= dsBitstreamError; |
| 121 | 128 | return -1; |
| 122 | 129 | } |
| 130 | + if (pCtx->bFreezeOutput) | |
| 131 | + pDstInfo->iBufferStatus = 0; | |
| 123 | 132 | |
| 124 | 133 | return 0; |
| 125 | 134 | } |
| @@ -394,6 +403,9 @@ int32_t WelsInitMemory (PWelsDecoderContext pCtx) { · 268 unmodified lines | ||
| 394 | 403 | pCtx->bEndOfStreamFlag = false; |
| 395 | 404 | pCtx->iImgWidthInPixel = 0; |
| 396 | 405 | pCtx->iImgHeightInPixel = 0; |
| 406 | + pCtx->iLastImgWidthInPixel = 0; | |
| 407 | + pCtx->iLastImgHeightInPixel = 0; | |
| 408 | + pCtx->bFreezeOutput = false; | |
| 397 | 409 | |
| 398 | 410 | return ERR_NONE; |
| 399 | 411 | } |