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

Function TEST

test/decoder/DecUT_ErrorConcealment.cpp:232–266  ·  view source on GitHub ↗

TEST cases followed

Source from the content-addressed store, hash-verified

230
231//TEST cases followed
232TEST (ErrorConTest, DoErrorConFrameCopy) {
233 bool bOK = true;
234 PECInputCtx pECCtx = NULL;
235 if (InitAndAllocInputData (pECCtx)) {
236 FreeInputData (pECCtx);
237 return;
238 }
239
240 for (int iEC = 0; iEC < 2; ++ iEC) { //ERROR_CON_FRAME_COPY, ERROR_CON_FRAME_COPY_CROSS_IDR
241 pECCtx->pCtx->pParam->eEcActiveIdc = iEC > 0 ? ERROR_CON_FRAME_COPY_CROSS_IDR : ERROR_CON_FRAME_COPY;
242 InitECCopyData (pECCtx);
243 int32_t iLumaSize = pECCtx->iMbWidth * pECCtx->iMbHeight * 256;
244
245 for (int iRef = 0; iRef < 2; ++ iRef) { //no ref, with ref
246 pECCtx->pCtx->pLastDecPicInfo->pPreviousDecodedPictureInDpb = iRef ? &pECCtx->sSrcPic : NULL;
247 for (int iIDR = 0; iIDR < 2; ++ iIDR) { //non IDR, IDR
248 pECCtx->pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag = (iIDR > 0);
249 //Do reference code method
250 DoErrorConFrameCopy (pECCtx->pCtx);
251 //Do anchor method
252 if (iRef && ! ((pECCtx->pCtx->pParam->eEcActiveIdc == ERROR_CON_FRAME_COPY)
253 && (pECCtx->pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag)))
254 memcpy (pECCtx->sAncPic.pData[0], pECCtx->sSrcPic.pData[0], iLumaSize * 3 / 2);
255 else
256 memset (pECCtx->sAncPic.pData[0], 128, iLumaSize * 3 / 2); //should be the same as known EC method, here all 128
257 //Compare results
258 bOK = ComparePictureDataI420 (pECCtx->sAncPic.pData[0], pECCtx->sWelsPic.pData[0], pECCtx->iLinesize[0],
259 pECCtx->iMbHeight * 16);
260 EXPECT_EQ (bOK, true);
261 } //non IDR, IDR
262 } // no ref, with ref
263 } //FRAME_COPY methods
264
265 FreeInputData (pECCtx);
266}
267
268//TEST cases followed
269TEST (ErrorConTest, DoErrorConSliceCopy) {

Callers

nothing calls this directly

Calls 7

InitAndAllocInputDataFunction · 0.85
FreeInputDataFunction · 0.85
InitECCopyDataFunction · 0.85
DoErrorConFrameCopyFunction · 0.85
ComparePictureDataI420Function · 0.85
DoErrorConSliceCopyFunction · 0.85
DoAncErrorConSliceCopyFunction · 0.85

Tested by

no test coverage detected