Showing the changes to codec/decoder/core/src/error_concealment.cpp (1 of 2 files). Show all
Unified · Split
| @@ -93,6 +93,8 @@ void DoErrorConFrameCopy (PWelsDecoderContext pCtx) { · 92 unmodified lines | ||
| 93 | 93 | memset (pDstPic->pData[0], 128, uiHeightInPixelY * iStrideY); |
| 94 | 94 | memset (pDstPic->pData[1], 128, (uiHeightInPixelY >> 1) * iStrideUV); |
| 95 | 95 | memset (pDstPic->pData[2], 128, (uiHeightInPixelY >> 1) * iStrideUV); |
| 96 | + } else if (pSrcPic == pDstPic) { | |
| 97 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "DoErrorConFrameCopy()::EC memcpy overlap."); | |
| 96 | 98 | } else { //has ref pic here |
| 97 | 99 | memcpy (pDstPic->pData[0], pSrcPic->pData[0], uiHeightInPixelY * iStrideY); |
| 98 | 100 | memcpy (pDstPic->pData[1], pSrcPic->pData[1], (uiHeightInPixelY >> 1) * iStrideUV); |
| @@ -117,6 +119,10 @@ void DoErrorConSliceCopy (PWelsDecoderContext pCtx) { · 18 unmodified lines | ||
| 117 | 119 | uint8_t* pSrcData, *pDstData; |
| 118 | 120 | uint32_t iSrcStride; // = pSrcPic->iLinesize[0]; |
| 119 | 121 | uint32_t iDstStride = pDstPic->iLinesize[0]; |
| 122 | + if (pSrcPic == pDstPic) { | |
| 123 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "DoErrorConSliceCopy()::EC memcpy overlap."); | |
| 124 | + return; | |
| 125 | + } | |
| 120 | 126 | for (int32_t iMbY = 0; iMbY < iMbHeight; ++iMbY) { |
| 121 | 127 | for (int32_t iMbX = 0; iMbX < iMbWidth; ++iMbX) { |
| 122 | 128 | iMbXyIndex = iMbY * iMbWidth + iMbX; |
| @@ -384,7 +390,8 @@ void DoErrorConSliceMVCopy (PWelsDecoderContext pCtx) { · 261 unmodified lines | ||
| 384 | 390 | sMCRefMem.iPicHeight = pDstPic->iHeightInPixel; |
| 385 | 391 | if (pDstPic == pSrcPic) { |
| 386 | 392 | // output error info, EC will be ignored in DoMbECMvCopy |
| 387 | − WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "DoErrorConSliceMVCopy()::pPreviousPic and pDec use same buffer, ignored."); | |
| 393 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "DoErrorConSliceMVCopy()::EC memcpy overlap."); | |
| 394 | + return; | |
| 388 | 395 | } |
| 389 | 396 | } |
| 390 | 397 | |