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 | } else if (pCurDq->sLayerInfo.sNalHeaderExt.bIdrFlag | 83 | } else if (pCurDq->sLayerInfo.sNalHeaderExt.bIdrFlag |
| 84 | && (pCtx->iErrorCode == dsErrorFree)) { //complete non-ECed IDR frame done | 84 | && (pCtx->iErrorCode == dsErrorFree)) { //complete non-ECed IDR frame done |
| 85 | pCtx->pDec->bIsComplete = true; | 85 | pCtx->pDec->bIsComplete = true; |
| 86 | pCtx->bFreezeOutput = false; | ||
| 86 | } | 87 | } |
| 87 | 88 | ||
| 88 | pCtx->iTotalNumMbRec = 0; | 89 | pCtx->iTotalNumMbRec = 0; |
| @@ -103,9 +104,15 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 14 unmodified lines | |||
| 103 | ppDst[2] = ppDst[2] + pCtx->sFrameCrop.iTopOffset * pPic->iLinesize[1] + pCtx->sFrameCrop.iLeftOffset; | 104 | ppDst[2] = ppDst[2] + pCtx->sFrameCrop.iTopOffset * pPic->iLinesize[1] + pCtx->sFrameCrop.iLeftOffset; |
| 104 | pDstInfo->iBufferStatus = 1; | 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 | if (pCtx->eErrorConMethod == ERROR_CON_DISABLE) //no buffer output if EC is disabled and frame incomplete | 111 | if (pCtx->eErrorConMethod == ERROR_CON_DISABLE) //no buffer output if EC is disabled and frame incomplete |
| 107 | pDstInfo->iBufferStatus = (int32_t) (bFrameCompleteFlag | 112 | pDstInfo->iBufferStatus = (int32_t) (bFrameCompleteFlag |
| 108 | && pPic->bIsComplete); // When EC disable, ECed picture not output | 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 | if ((pDstInfo->iBufferStatus == 1) && (pCurDq->sLayerInfo.sNalHeaderExt.bIdrFlag)) { | 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 | pCtx->iErrorCode |= dsBitstreamError; | 127 | pCtx->iErrorCode |= dsBitstreamError; |
| 121 | return -1; | 128 | return -1; |
| 122 | } | 129 | } |
| 130 | if (pCtx->bFreezeOutput) | ||
| 131 | pDstInfo->iBufferStatus = 0; | ||
| 123 | 132 | ||
| 124 | return 0; | 133 | return 0; |
| 125 | } | 134 | } |
| @@ -394,6 +403,9 @@ int32_t WelsInitMemory (PWelsDecoderContext pCtx) { · 268 unmodified lines | |||
| 394 | pCtx->bEndOfStreamFlag = false; | 403 | pCtx->bEndOfStreamFlag = false; |
| 395 | pCtx->iImgWidthInPixel = 0; | 404 | pCtx->iImgWidthInPixel = 0; |
| 396 | pCtx->iImgHeightInPixel = 0; | 405 | pCtx->iImgHeightInPixel = 0; |
| 406 | pCtx->iLastImgWidthInPixel = 0; | ||
| 407 | pCtx->iLastImgHeightInPixel = 0; | ||
| 408 | pCtx->bFreezeOutput = false; | ||
| 397 | 409 | ||
| 398 | return ERR_NONE; | 410 | return ERR_NONE; |
| 399 | } | 411 | } |