MCPcopy Create free account
hub / github.com/cisco/openh264 / DoErrorConFrameCopy

Function DoErrorConFrameCopy

codec/decoder/core/src/error_concealment.cpp:91–111  ·  view source on GitHub ↗

Do error concealment using frame copy method

Source from the content-addressed store, hash-verified

89
90//Do error concealment using frame copy method
91void 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

Callers 2

TESTFunction · 0.85
ImplementErrorConFunction · 0.85

Calls 1

WelsLogFunction · 0.85

Tested by

no test coverage detected