Do error concealment using frame copy method
| 89 | |
| 90 | //Do error concealment using frame copy method |
| 91 | void DoErrorConFrameCopy (PWelsDecoderContext pCtx) { |
| 92 | PPicture pDstPic = pCtx->pDec; |
| 93 | PPicture pSrcPic = pCtx->pLastDecPicInfo->pPreviousDecodedPictureInDpb; |
| 94 | uint32_t uiHeightInPixelY = (pCtx->pSps->iMbHeight) << 4; |
| 95 | int32_t iStrideY = pDstPic->iLinesize[0]; |
| 96 | int32_t iStrideUV = pDstPic->iLinesize[1]; |
| 97 | pCtx->pDec->iMbEcedNum = pCtx->pSps->iMbWidth * pCtx->pSps->iMbHeight; |
| 98 | if ((pCtx->pParam->eEcActiveIdc == ERROR_CON_FRAME_COPY) && (pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag)) |
| 99 | pSrcPic = NULL; //no cross IDR method, should fill in data instead of copy |
| 100 | if (pSrcPic == NULL) { //no ref pic, assign specific data to picture |
| 101 | memset (pDstPic->pData[0], 128, uiHeightInPixelY * iStrideY); |
| 102 | memset (pDstPic->pData[1], 128, (uiHeightInPixelY >> 1) * iStrideUV); |
| 103 | memset (pDstPic->pData[2], 128, (uiHeightInPixelY >> 1) * iStrideUV); |
| 104 | } else if (pSrcPic == pDstPic) { |
| 105 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "DoErrorConFrameCopy()::EC memcpy overlap."); |
| 106 | } else { //has ref pic here |
| 107 | memcpy (pDstPic->pData[0], pSrcPic->pData[0], uiHeightInPixelY * iStrideY); |
| 108 | memcpy (pDstPic->pData[1], pSrcPic->pData[1], (uiHeightInPixelY >> 1) * iStrideUV); |
| 109 | memcpy (pDstPic->pData[2], pSrcPic->pData[2], (uiHeightInPixelY >> 1) * iStrideUV); |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | |
| 114 | //Do error concealment using slice copy method |
no test coverage detected