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 | 44 | #include "error_concealment.h" |
| 45 | 45 | |
| 46 | 46 | namespace WelsDec { |
| 47 | − | |
| 48 | 47 | static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferInfo* pDstInfo) { |
| 49 | 48 | PDqLayer pCurDq = pCtx->pCurDqLayer; |
| 50 | 49 | PPicture pPic = pCtx->pDec; |
| @@ -88,24 +87,22 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 37 unmodified lines | ||
| 88 | 87 | |
| 89 | 88 | pCtx->iTotalNumMbRec = 0; |
| 90 | 89 | |
| 91 | − if (!pCtx->bParseOnly) { | |
| 92 | − //////output:::normal path | |
| 93 | − pDstInfo->uiOutYuvTimeStamp = pPic->uiTimeStamp; | |
| 94 | − ppDst[0] = pPic->pData[0]; | |
| 95 | − ppDst[1] = pPic->pData[1]; | |
| 96 | − ppDst[2] = pPic->pData[2]; | |
| 90 | + //////output:::normal path | |
| 91 | + pDstInfo->uiOutYuvTimeStamp = pPic->uiTimeStamp; | |
| 92 | + ppDst[0] = pPic->pData[0]; | |
| 93 | + ppDst[1] = pPic->pData[1]; | |
| 94 | + 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; | |
| 101 | − pDstInfo->UsrData.sSystemBuffer.iHeight = kiHeight - (pCtx->sFrameCrop.iTopOffset + pCtx->sFrameCrop.iBottomOffset) * 2; | |
| 102 | − pDstInfo->UsrData.sSystemBuffer.iStride[0] = pPic->iLinesize[0]; | |
| 103 | − pDstInfo->UsrData.sSystemBuffer.iStride[1] = pPic->iLinesize[1]; | |
| 104 | − 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; | |
| 106 | − ppDst[2] = ppDst[2] + pCtx->sFrameCrop.iTopOffset * pPic->iLinesize[1] + pCtx->sFrameCrop.iLeftOffset; | |
| 107 | − pDstInfo->iBufferStatus = 1; | |
| 108 | − } | |
| 98 | + pDstInfo->UsrData.sSystemBuffer.iWidth = kiWidth - (pCtx->sFrameCrop.iLeftOffset + pCtx->sFrameCrop.iRightOffset) * 2; | |
| 99 | + pDstInfo->UsrData.sSystemBuffer.iHeight = kiHeight - (pCtx->sFrameCrop.iTopOffset + pCtx->sFrameCrop.iBottomOffset) * 2; | |
| 100 | + pDstInfo->UsrData.sSystemBuffer.iStride[0] = pPic->iLinesize[0]; | |
| 101 | + pDstInfo->UsrData.sSystemBuffer.iStride[1] = pPic->iLinesize[1]; | |
| 102 | + ppDst[0] = ppDst[0] + pCtx->sFrameCrop.iTopOffset * 2 * pPic->iLinesize[0] + pCtx->sFrameCrop.iLeftOffset * 2; | |
| 103 | + ppDst[1] = ppDst[1] + pCtx->sFrameCrop.iTopOffset * pPic->iLinesize[1] + pCtx->sFrameCrop.iLeftOffset; | |
| 104 | + ppDst[2] = ppDst[2] + pCtx->sFrameCrop.iTopOffset * pPic->iLinesize[1] + pCtx->sFrameCrop.iLeftOffset; | |
| 105 | + pDstInfo->iBufferStatus = 1; | |
| 109 | 106 | |
| 110 | 107 | bool bOutResChange = (pCtx->iLastImgWidthInPixel != pDstInfo->UsrData.sSystemBuffer.iWidth) |
| 111 | 108 | || (pCtx->iLastImgHeightInPixel != pDstInfo->UsrData.sSystemBuffer.iHeight); |
| @@ -119,13 +116,6 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 7 unmodified lines | ||
| 119 | 116 | && pCtx->iErrorCode && bOutResChange) |
| 120 | 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 | 119 | if (pDstInfo->iBufferStatus == 0) { |
| 130 | 120 | if (!bFrameCompleteFlag) |
| 131 | 121 | pCtx->iErrorCode |= dsBitstreamError; |
| @@ -137,6 +127,7 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 5 unmodified lines | ||
| 137 | 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 | 132 | return 0; |
| 142 | 133 | } |