Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 4 files). Show all
Unified · Split
| @@ -72,6 +72,19 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 71 unmodified lines | ||
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | + const int32_t kiActualWidth = kiWidth - (pCtx->sFrameCrop.iLeftOffset + pCtx->sFrameCrop.iRightOffset) * 2; | |
| 76 | + const int32_t kiActualHeight = kiHeight - (pCtx->sFrameCrop.iTopOffset + pCtx->sFrameCrop.iBottomOffset) * 2; | |
| 77 | + | |
| 78 | + | |
| 79 | + if (pCtx->pParam->eEcActiveIdc == ERROR_CON_DISABLE) { | |
| 80 | + if ((pCtx->sDecoderStatistics.uiWidth != (unsigned int) kiActualWidth) || (pCtx->sDecoderStatistics.uiHeight != (unsigned int) kiActualHeight)) { | |
| 81 | + pCtx->sDecoderStatistics.uiResolutionChangeTimes++; | |
| 82 | + pCtx->sDecoderStatistics.uiWidth = kiActualWidth; | |
| 83 | + pCtx->sDecoderStatistics.uiHeight = kiActualHeight; | |
| 84 | + } | |
| 85 | + UpdateDecStatNoFreezingInfo (pCtx); | |
| 86 | + } | |
| 87 | + | |
| 75 | 88 | if (pCtx->pParam->bParseOnly) { //should exit for parse only to prevent access NULL pDstInfo |
| 76 | 89 | PAccessUnit pCurAu = pCtx->pAccessUnitList; |
| 77 | 90 | if (dsErrorFree == pCtx->iErrorCode) { //correct decoding, add to data buffer |
| @@ -198,8 +211,8 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 120 unmodified lines | ||
| 198 | 211 | |
| 199 | 212 | pDstInfo->UsrData.sSystemBuffer.iFormat = videoFormatI420; |
| 200 | 213 | |
| 201 | − pDstInfo->UsrData.sSystemBuffer.iWidth = kiWidth - (pCtx->sFrameCrop.iLeftOffset + pCtx->sFrameCrop.iRightOffset) * 2; | |
| 202 | − pDstInfo->UsrData.sSystemBuffer.iHeight = kiHeight - (pCtx->sFrameCrop.iTopOffset + pCtx->sFrameCrop.iBottomOffset) * 2; | |
| 214 | + pDstInfo->UsrData.sSystemBuffer.iWidth = kiActualWidth; | |
| 215 | + pDstInfo->UsrData.sSystemBuffer.iHeight = kiActualHeight; | |
| 203 | 216 | pDstInfo->UsrData.sSystemBuffer.iStride[0] = pPic->iLinesize[0]; |
| 204 | 217 | pDstInfo->UsrData.sSystemBuffer.iStride[1] = pPic->iLinesize[1]; |
| 205 | 218 | ppDst[0] = ppDst[0] + pCtx->sFrameCrop.iTopOffset * 2 * pPic->iLinesize[0] + pCtx->sFrameCrop.iLeftOffset * 2; |
| @@ -235,8 +248,15 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 29 unmodified lines | ||
| 235 | 248 | pCtx->iMbEcedNum = pPic->iMbEcedNum; |
| 236 | 249 | pCtx->iMbNum = pPic->iMbNum; |
| 237 | 250 | pCtx->iMbEcedPropNum = pPic->iMbEcedPropNum; |
| 238 | − UpdateDecStat (pCtx, pDstInfo->iBufferStatus != 0); | |
| 239 | − | |
| 251 | + if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) { | |
| 252 | + if (pDstInfo->iBufferStatus && ((pCtx->sDecoderStatistics.uiWidth != (unsigned int) kiActualWidth) | |
| 253 | + || (pCtx->sDecoderStatistics.uiHeight != (unsigned int) kiActualHeight))) { | |
| 254 | + pCtx->sDecoderStatistics.uiResolutionChangeTimes++; | |
| 255 | + pCtx->sDecoderStatistics.uiWidth = kiActualWidth; | |
| 256 | + pCtx->sDecoderStatistics.uiHeight = kiActualHeight; | |
| 257 | + } | |
| 258 | + UpdateDecStat (pCtx, pDstInfo->iBufferStatus != 0); | |
| 259 | + } | |
| 240 | 260 | return ERR_NONE; |
| 241 | 261 | } |
| 242 | 262 | |