Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 1 file). Show all
Unified · Split
| @@ -66,7 +66,7 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 65 unmodified lines | |||
| 66 | if (pCtx->iTotalNumMbRec == kiTotalNumMbInCurLayer) { | 66 | if (pCtx->iTotalNumMbRec == kiTotalNumMbInCurLayer) { |
| 67 | pCtx->bPrintFrameErrorTraceFlag = true; | 67 | pCtx->bPrintFrameErrorTraceFlag = true; |
| 68 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO, | 68 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO, |
| 69 | "DecodeFrameConstruction()::::output first frame of new sequence, %d x %d, crop_left:%d, crop_right:%d, crop_top:%d, crop_bottom:%d, ignored error packet:%d.", | 69 | "DecodeFrameConstruction(): will output first frame of new sequence, %d x %d, crop_left:%d, crop_right:%d, crop_top:%d, crop_bottom:%d, ignored error packet:%d.", |
| 70 | kiWidth, kiHeight, pCtx->sFrameCrop.iLeftOffset, pCtx->sFrameCrop.iRightOffset, pCtx->sFrameCrop.iTopOffset, | 70 | kiWidth, kiHeight, pCtx->sFrameCrop.iLeftOffset, pCtx->sFrameCrop.iRightOffset, pCtx->sFrameCrop.iTopOffset, |
| 71 | pCtx->sFrameCrop.iBottomOffset, pCtx->iIgnoredErrorInfoPacketCount); | 71 | pCtx->sFrameCrop.iBottomOffset, pCtx->iIgnoredErrorInfoPacketCount); |
| 72 | pCtx->iIgnoredErrorInfoPacketCount = 0; | 72 | pCtx->iIgnoredErrorInfoPacketCount = 0; |
| @@ -75,7 +75,7 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 2 unmodified lines | |||
| 75 | 75 | ||
| 76 | if (pCtx->iTotalNumMbRec != kiTotalNumMbInCurLayer) { | 76 | if (pCtx->iTotalNumMbRec != kiTotalNumMbInCurLayer) { |
| 77 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, | 77 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, |
| 78 | "DecodeFrameConstruction():::iTotalNumMbRec:%d, total_num_mb_sps:%d, cur_layer_mb_width:%d, cur_layer_mb_height:%d ", | 78 | "DecodeFrameConstruction(): iTotalNumMbRec:%d, total_num_mb_sps:%d, cur_layer_mb_width:%d, cur_layer_mb_height:%d ", |
| 79 | pCtx->iTotalNumMbRec, kiTotalNumMbInCurLayer, pCurDq->iMbWidth, pCurDq->iMbHeight); | 79 | pCtx->iTotalNumMbRec, kiTotalNumMbInCurLayer, pCurDq->iMbWidth, pCurDq->iMbHeight); |
| 80 | bFrameCompleteFlag = false; //return later after output buffer is done | 80 | bFrameCompleteFlag = false; //return later after output buffer is done |
| 81 | if (pCtx->bInstantDecFlag) //no-delay decoding, wait for new slice | 81 | if (pCtx->bInstantDecFlag) //no-delay decoding, wait for new slice |
| @@ -114,8 +114,8 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 32 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)) { |
| @@ -130,8 +130,12 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 8 unmodified lines | |||
| 130 | pCtx->iErrorCode |= dsBitstreamError; | 130 | pCtx->iErrorCode |= dsBitstreamError; |
| 131 | return -1; | 131 | return -1; |
| 132 | } | 132 | } |
| 133 | if (pCtx->bFreezeOutput) | 133 | if (pCtx->bFreezeOutput) { |
| 134 | pDstInfo->iBufferStatus = 0; | 134 | pDstInfo->iBufferStatus = 0; |
| 135 | if (pCtx->bNewSeqBegin) { | ||
| 136 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO, "DecodeFrameConstruction():New sequence detected, but freezed."); | ||
| 137 | } | ||
| 138 | } | ||
| 135 | 139 | ||
| 136 | return 0; | 140 | return 0; |
| 137 | } | 141 | } |
| @@ -2131,7 +2135,8 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 1993 unmodified lines | |||
| 2131 | pCtx->pDec->iLinesize, | 2135 | pCtx->pDec->iLinesize, |
| 2132 | pCtx->sExpandPicFunc.pfExpandLumaPicture, pCtx->sExpandPicFunc.pfExpandChromaPicture); | 2136 | pCtx->sExpandPicFunc.pfExpandLumaPicture, pCtx->sExpandPicFunc.pfExpandChromaPicture); |
| 2133 | pCtx->pDec = NULL; | 2137 | 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) { | 2138 | } else if (pCtx->eErrorConMethod == ERROR_CON_SLICE_MV_COPY_CROSS_IDR |
| 2139 | || 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 | 2140 | pCtx->pPreviousDecodedPictureInDpb = pCtx->pDec; //store latest decoded picture for MV Copy EC |
| 2136 | pCtx->pDec = NULL; | 2141 | pCtx->pDec = NULL; |
| 2137 | } | 2142 | } |
| @@ -2164,7 +2169,8 @@ bool CheckAndFinishLastPic (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferIn · 26 unmodified lines | |||
| 2164 | if (pCtx->sLastNalHdrExt.sNalUnitHeader.uiNalRefIdc > 0) { | 2169 | if (pCtx->sLastNalHdrExt.sNalUnitHeader.uiNalRefIdc > 0) { |
| 2165 | pCtx->pPreviousDecodedPictureInDpb = pCtx->pDec; //save ECed pic for future use | 2170 | pCtx->pPreviousDecodedPictureInDpb = pCtx->pDec; //save ECed pic for future use |
| 2166 | MarkECFrameAsRef (pCtx); | 2171 | 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) { | 2172 | } else if (pCtx->eErrorConMethod == ERROR_CON_SLICE_MV_COPY_CROSS_IDR |
| 2173 | || 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 | 2174 | pCtx->pPreviousDecodedPictureInDpb = pCtx->pDec; //save ECed pic for future MV Copy use |
| 2169 | } | 2175 | } |
| 2170 | } else { | 2176 | } else { |