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 | if (pCtx->pParam->bParseOnly) { //should exit for parse only to prevent access NULL pDstInfo | 88 | if (pCtx->pParam->bParseOnly) { //should exit for parse only to prevent access NULL pDstInfo |
| 76 | PAccessUnit pCurAu = pCtx->pAccessUnitList; | 89 | PAccessUnit pCurAu = pCtx->pAccessUnitList; |
| 77 | if (dsErrorFree == pCtx->iErrorCode) { //correct decoding, add to data buffer | 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 | pDstInfo->UsrData.sSystemBuffer.iFormat = videoFormatI420; | 212 | pDstInfo->UsrData.sSystemBuffer.iFormat = videoFormatI420; |
| 200 | 213 | ||
| 201 | pDstInfo->UsrData.sSystemBuffer.iWidth = kiWidth - (pCtx->sFrameCrop.iLeftOffset + pCtx->sFrameCrop.iRightOffset) * 2; | 214 | pDstInfo->UsrData.sSystemBuffer.iWidth = kiActualWidth; |
| 202 | pDstInfo->UsrData.sSystemBuffer.iHeight = kiHeight - (pCtx->sFrameCrop.iTopOffset + pCtx->sFrameCrop.iBottomOffset) * 2; | 215 | pDstInfo->UsrData.sSystemBuffer.iHeight = kiActualHeight; |
| 203 | pDstInfo->UsrData.sSystemBuffer.iStride[0] = pPic->iLinesize[0]; | 216 | pDstInfo->UsrData.sSystemBuffer.iStride[0] = pPic->iLinesize[0]; |
| 204 | pDstInfo->UsrData.sSystemBuffer.iStride[1] = pPic->iLinesize[1]; | 217 | pDstInfo->UsrData.sSystemBuffer.iStride[1] = pPic->iLinesize[1]; |
| 205 | ppDst[0] = ppDst[0] + pCtx->sFrameCrop.iTopOffset * 2 * pPic->iLinesize[0] + pCtx->sFrameCrop.iLeftOffset * 2; | 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 | pCtx->iMbEcedNum = pPic->iMbEcedNum; | 248 | pCtx->iMbEcedNum = pPic->iMbEcedNum; |
| 236 | pCtx->iMbNum = pPic->iMbNum; | 249 | pCtx->iMbNum = pPic->iMbNum; |
| 237 | pCtx->iMbEcedPropNum = pPic->iMbEcedPropNum; | 250 | pCtx->iMbEcedPropNum = pPic->iMbEcedPropNum; |
| 238 | UpdateDecStat (pCtx, pDstInfo->iBufferStatus != 0); | 251 | if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) { |
| 239 | 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 | return ERR_NONE; | 260 | return ERR_NONE; |
| 241 | } | 261 | } |
| 242 | 262 | ||