Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 8 files). Show all
Unified · Split
| @@ -44,7 +44,6 @@ · 43 unmodified lines | |||
| 44 | #include "error_concealment.h" | 44 | #include "error_concealment.h" |
| 45 | 45 | ||
| 46 | namespace WelsDec { | 46 | namespace WelsDec { |
| 47 | |||
| 48 | static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferInfo* pDstInfo) { | 47 | static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferInfo* pDstInfo) { |
| 49 | PDqLayer pCurDq = pCtx->pCurDqLayer; | 48 | PDqLayer pCurDq = pCtx->pCurDqLayer; |
| 50 | PPicture pPic = pCtx->pDec; | 49 | PPicture pPic = pCtx->pDec; |
| @@ -88,24 +87,22 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 37 unmodified lines | |||
| 88 | 87 | ||
| 89 | pCtx->iTotalNumMbRec = 0; | 88 | pCtx->iTotalNumMbRec = 0; |
| 90 | 89 | ||
| 91 | if (!pCtx->bParseOnly) { | 90 | //////output:::normal path |
| 92 | //////output:::normal path | 91 | pDstInfo->uiOutYuvTimeStamp = pPic->uiTimeStamp; |
| 93 | pDstInfo->uiOutYuvTimeStamp = pPic->uiTimeStamp; | 92 | ppDst[0] = pPic->pData[0]; |
| 94 | ppDst[0] = pPic->pData[0]; | 93 | ppDst[1] = pPic->pData[1]; |
| 95 | ppDst[1] = pPic->pData[1]; | 94 | ppDst[2] = pPic->pData[2]; |
| 96 | ppDst[2] = pPic->pData[2]; | ||
| 97 | 95 | ||
| 98 | pDstInfo->UsrData.sSystemBuffer.iFormat = videoFormatI420; | 96 | pDstInfo->UsrData.sSystemBuffer.iFormat = videoFormatI420; |
| 99 | 97 | ||
| 100 | pDstInfo->UsrData.sSystemBuffer.iWidth = kiWidth - (pCtx->sFrameCrop.iLeftOffset + pCtx->sFrameCrop.iRightOffset) * 2; | 98 | pDstInfo->UsrData.sSystemBuffer.iWidth = kiWidth - (pCtx->sFrameCrop.iLeftOffset + pCtx->sFrameCrop.iRightOffset) * 2; |
| 101 | pDstInfo->UsrData.sSystemBuffer.iHeight = kiHeight - (pCtx->sFrameCrop.iTopOffset + pCtx->sFrameCrop.iBottomOffset) * 2; | 99 | pDstInfo->UsrData.sSystemBuffer.iHeight = kiHeight - (pCtx->sFrameCrop.iTopOffset + pCtx->sFrameCrop.iBottomOffset) * 2; |
| 102 | pDstInfo->UsrData.sSystemBuffer.iStride[0] = pPic->iLinesize[0]; | 100 | pDstInfo->UsrData.sSystemBuffer.iStride[0] = pPic->iLinesize[0]; |
| 103 | pDstInfo->UsrData.sSystemBuffer.iStride[1] = pPic->iLinesize[1]; | 101 | pDstInfo->UsrData.sSystemBuffer.iStride[1] = pPic->iLinesize[1]; |
| 104 | ppDst[0] = ppDst[0] + pCtx->sFrameCrop.iTopOffset * 2 * pPic->iLinesize[0] + pCtx->sFrameCrop.iLeftOffset * 2; | 102 | ppDst[0] = ppDst[0] + pCtx->sFrameCrop.iTopOffset * 2 * pPic->iLinesize[0] + pCtx->sFrameCrop.iLeftOffset * 2; |
| 105 | ppDst[1] = ppDst[1] + pCtx->sFrameCrop.iTopOffset * pPic->iLinesize[1] + pCtx->sFrameCrop.iLeftOffset; | 103 | ppDst[1] = ppDst[1] + pCtx->sFrameCrop.iTopOffset * pPic->iLinesize[1] + pCtx->sFrameCrop.iLeftOffset; |
| 106 | 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; |
| 107 | pDstInfo->iBufferStatus = 1; | 105 | pDstInfo->iBufferStatus = 1; |
| 108 | } | ||
| 109 | 106 | ||
| 110 | bool bOutResChange = (pCtx->iLastImgWidthInPixel != pDstInfo->UsrData.sSystemBuffer.iWidth) | 107 | bool bOutResChange = (pCtx->iLastImgWidthInPixel != pDstInfo->UsrData.sSystemBuffer.iWidth) |
| 111 | || (pCtx->iLastImgHeightInPixel != pDstInfo->UsrData.sSystemBuffer.iHeight); | 108 | || (pCtx->iLastImgHeightInPixel != pDstInfo->UsrData.sSystemBuffer.iHeight); |
| @@ -119,13 +116,6 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 7 unmodified lines | |||
| 119 | && pCtx->iErrorCode && bOutResChange) | 116 | && pCtx->iErrorCode && bOutResChange) |
| 120 | pCtx->bFreezeOutput = true; | 117 | pCtx->bFreezeOutput = true; |
| 121 | 118 | ||
| 122 | if ((pDstInfo->iBufferStatus == 1) && (pCurDq->sLayerInfo.sNalHeaderExt.bIdrFlag)) { | ||
| 123 | if (pPic->bIsComplete) | ||
| 124 | pCtx->sDecoderStatistics.uiIDRRecvNum++; | ||
| 125 | else | ||
| 126 | pCtx->sDecoderStatistics.uiEcIDRNum++; | ||
| 127 | } | ||
| 128 | |||
| 129 | if (pDstInfo->iBufferStatus == 0) { | 119 | if (pDstInfo->iBufferStatus == 0) { |
| 130 | if (!bFrameCompleteFlag) | 120 | if (!bFrameCompleteFlag) |
| 131 | pCtx->iErrorCode |= dsBitstreamError; | 121 | pCtx->iErrorCode |= dsBitstreamError; |
| @@ -137,6 +127,7 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 5 unmodified lines | |||
| 137 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO, "DecodeFrameConstruction():New sequence detected, but freezed."); | 127 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO, "DecodeFrameConstruction():New sequence detected, but freezed."); |
| 138 | } | 128 | } |
| 139 | } | 129 | } |
| 130 | UpdateDecStat (pCtx, pDstInfo->iBufferStatus); | ||
| 140 | 131 | ||
| 141 | return 0; | 132 | return 0; |
| 142 | } | 133 | } |