History

enable cross IDR EC method

huili2 committed 12 years ago

Commit 103fa5b1 parent c5029ef6 files · +77 −50Browse files

Showing the changes to test/decoder/DecUT_ErrorConcealment.cpp (1 of 6 files). Show all

Unified · Split

test/decoder/DecUT_ErrorConcealment.cpp+46−39
@@ -121,6 +121,9 @@ void DoAncErrorConSliceCopy (PECInputCtx pECCtx) { · 120 unmodified lines
121 int32_t iMbHeight = (int32_t) pECCtx->iMbHeight;121 int32_t iMbHeight = (int32_t) pECCtx->iMbHeight;
122 PPicture pDstPic = &pECCtx->sAncPic;122 PPicture pDstPic = &pECCtx->sAncPic;
123 PPicture pSrcPic = pECCtx->pCtx->pPreviousDecodedPictureInDpb;123 PPicture pSrcPic = pECCtx->pCtx->pPreviousDecodedPictureInDpb;
124 if ((pECCtx->pCtx->eErrorConMethod == ERROR_CON_SLICE_COPY)
125 && (pECCtx->pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag))
126 pSrcPic = NULL;
124 127
125 //uint8_t *pDstData[3], *pSrcData[3];128 //uint8_t *pDstData[3], *pSrcData[3];
126 bool* pMbCorrectlyDecodedFlag = pECCtx->pMbCorrectlyDecodedFlag;129 bool* pMbCorrectlyDecodedFlag = pECCtx->pMbCorrectlyDecodedFlag;
@@ -231,26 +234,30 @@ TEST (ErrorConTest, DoErrorConFrameCopy) { · 104 unmodified lines
231 return;234 return;
232 }235 }
233 236
234 pECCtx->pCtx->eErrorConMethod = ERROR_CON_FRAME_COPY;237 for (int iEC = 0; iEC < 2; ++ iEC) { //ERROR_CON_FRAME_COPY, ERROR_CON_FRAME_COPY_CROSS_IDR
235 InitECCopyData (pECCtx);238 pECCtx->pCtx->eErrorConMethod = iEC > 0 ? ERROR_CON_FRAME_COPY_CROSS_IDR : ERROR_CON_FRAME_COPY;
236 //case 1: no reference picture239 InitECCopyData (pECCtx);
237 pECCtx->pCtx->pPreviousDecodedPictureInDpb = NULL;240 int32_t iLumaSize = pECCtx->iMbWidth * pECCtx->iMbHeight * 256;
238 DoErrorConFrameCopy (pECCtx->pCtx);241
239 242 for (int iRef = 0; iRef < 2; ++ iRef) { //no ref, with ref
240 int32_t iLumaSize = pECCtx->iMbWidth * pECCtx->iMbHeight * 256;243 pECCtx->pCtx->pPreviousDecodedPictureInDpb = iRef ? &pECCtx->sSrcPic : NULL;
241 memset (pECCtx->sAncPic.pData[0], 128, iLumaSize * 3 / 2); //should be the same as known EC method, here all 128244 for (int iIDR = 0; iIDR < 2; ++ iIDR) { //non IDR, IDR
242 bOK = ComparePictureDataI420 (pECCtx->sAncPic.pData[0], pECCtx->sWelsPic.pData[0], pECCtx->iLinesize[0],245 pECCtx->pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag = (iIDR > 0);
243 pECCtx->iMbHeight * 16);246 //Do reference code method
244 EXPECT_EQ (bOK, true);247 DoErrorConFrameCopy (pECCtx->pCtx);
245 248 //Do anchor method
246 //case 2: with reference picture249 if (iRef && ! ((pECCtx->pCtx->eErrorConMethod == ERROR_CON_FRAME_COPY)
247 pECCtx->pCtx->pPreviousDecodedPictureInDpb = &pECCtx->sSrcPic;250 && (pECCtx->pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag)))
248 DoErrorConFrameCopy (pECCtx->pCtx);251 memcpy (pECCtx->sAncPic.pData[0], pECCtx->sSrcPic.pData[0], iLumaSize * 3 / 2);
249 252 else
250 memcpy (pECCtx->sAncPic.pData[0], pECCtx->sSrcPic.pData[0], iLumaSize * 3 / 2);253 memset (pECCtx->sAncPic.pData[0], 128, iLumaSize * 3 / 2); //should be the same as known EC method, here all 128
251 bOK = ComparePictureDataI420 (pECCtx->sAncPic.pData[0], pECCtx->sWelsPic.pData[0], pECCtx->iLinesize[0],254 //Compare results
252 pECCtx->iMbHeight * 16);255 bOK = ComparePictureDataI420 (pECCtx->sAncPic.pData[0], pECCtx->sWelsPic.pData[0], pECCtx->iLinesize[0],
253 EXPECT_EQ (bOK, true);256 pECCtx->iMbHeight * 16);
257 EXPECT_EQ (bOK, true);
258 } //non IDR, IDR
259 } // no ref, with ref
260 } //FRAME_COPY methods
254 261
255 FreeInputData (pECCtx);262 FreeInputData (pECCtx);
256}263}
@@ -263,25 +270,25 @@ TEST (ErrorConTest, DoErrorConSliceCopy) { · 6 unmodified lines
263 FreeInputData (pECCtx);270 FreeInputData (pECCtx);
264 return;271 return;
265 }272 }
266 pECCtx->pCtx->eErrorConMethod = ERROR_CON_SLICE_COPY;273
267 InitECCopyData (pECCtx);274 for (int iEC = 0; iEC < 2; ++ iEC) { //ERROR_CON_SLICE_COPY, ERROR_CON_SLICE_COPY_CROSS_IDR
268 //case 1: no reference picture275 pECCtx->pCtx->eErrorConMethod = iEC > 0 ? ERROR_CON_SLICE_COPY_CROSS_IDR : ERROR_CON_SLICE_COPY;
269 pECCtx->pCtx->pPreviousDecodedPictureInDpb = NULL;276 InitECCopyData (pECCtx);
270 DoAncErrorConSliceCopy (pECCtx);277 for (int iRef = 0; iRef < 2; ++ iRef) { //no ref, with ref
271 DoErrorConSliceCopy (pECCtx->pCtx);278 pECCtx->pCtx->pPreviousDecodedPictureInDpb = iRef ? &pECCtx->sSrcPic : NULL;
272 279 for (int iIDR = 0; iIDR < 2; ++ iIDR) { //non IDR, IDR
273 bOK = ComparePictureDataI420 (pECCtx->sAncPic.pData[0], pECCtx->sWelsPic.pData[0], pECCtx->iLinesize[0],280 pECCtx->pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag = (iIDR > 0);
274 pECCtx->iMbHeight * 16);281 //Do reference code method
275 EXPECT_EQ (bOK, true);282 DoErrorConSliceCopy (pECCtx->pCtx);
276 283 //Do anchor method
277 //case 2: with reference picture284 DoAncErrorConSliceCopy (pECCtx);
278 pECCtx->pCtx->pPreviousDecodedPictureInDpb = &pECCtx->sSrcPic;285 //Compare results
279 DoAncErrorConSliceCopy (pECCtx);286 bOK = ComparePictureDataI420 (pECCtx->sAncPic.pData[0], pECCtx->sWelsPic.pData[0], pECCtx->iLinesize[0],
280 DoErrorConSliceCopy (pECCtx->pCtx);287 pECCtx->iMbHeight * 16);
281 288 EXPECT_EQ (bOK, true);
282 bOK = ComparePictureDataI420 (pECCtx->sAncPic.pData[0], pECCtx->sWelsPic.pData[0], pECCtx->iLinesize[0],289 } //non IDR, IDR
283 pECCtx->iMbHeight * 16);290 } // no ref, with ref
284 EXPECT_EQ (bOK, true);291 } //FRAME_COPY methods
285 292
286 FreeInputData (pECCtx);293 FreeInputData (pECCtx);
287}294}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t