Showing the changes to test/decoder/DecUT_ErrorConcealment.cpp (1 of 10 files). Show all
Unified · Split
| @@ -26,6 +26,7 @@ typedef struct TagECInputCtx { · 25 unmodified lines | ||
| 26 | 26 | void FreeInputData (PECInputCtx pECCtx) { |
| 27 | 27 | if (pECCtx != NULL) { |
| 28 | 28 | if (pECCtx->pCtx != NULL) { |
| 29 | + WELS_SAFE_FREE (pECCtx->pCtx->pParam, "pECCtx->pCtx->pParam"); | |
| 29 | 30 | WELS_SAFE_FREE (pECCtx->pCtx->pSps, "pECCtx->pCtx->pSps"); |
| 30 | 31 | WELS_SAFE_FREE (pECCtx->pCtx, "pECCtx->pCtx"); |
| 31 | 32 | } |
| @@ -95,6 +96,9 @@ int32_t InitAndAllocInputData (PECInputCtx& pECCtx) { · 63 unmodified lines | ||
| 95 | 96 | return 1; |
| 96 | 97 | pECCtx->pCtx->pSps->iMbWidth = pECCtx->iMbWidth; |
| 97 | 98 | pECCtx->pCtx->pSps->iMbHeight = pECCtx->iMbHeight; |
| 99 | + pECCtx->pCtx->pParam = (PDecodingParam) WelsMallocz (sizeof (SDecodingParam), "pECCtx->pCtx->pParam"); | |
| 100 | + if (pECCtx->pCtx->pParam == NULL) | |
| 101 | + return 1; | |
| 98 | 102 | |
| 99 | 103 | return 0; |
| 100 | 104 | } |
| @@ -121,7 +125,7 @@ void DoAncErrorConSliceCopy (PECInputCtx pECCtx) { · 20 unmodified lines | ||
| 121 | 125 | int32_t iMbHeight = (int32_t) pECCtx->iMbHeight; |
| 122 | 126 | PPicture pDstPic = &pECCtx->sAncPic; |
| 123 | 127 | PPicture pSrcPic = pECCtx->pCtx->pPreviousDecodedPictureInDpb; |
| 124 | − if ((pECCtx->pCtx->eErrorConMethod == ERROR_CON_SLICE_COPY) | |
| 128 | + if ((pECCtx->pCtx->pParam->eEcActiveIdc == ERROR_CON_SLICE_COPY) | |
| 125 | 129 | && (pECCtx->pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag)) |
| 126 | 130 | pSrcPic = NULL; |
| 127 | 131 | |
| @@ -235,7 +239,7 @@ TEST (ErrorConTest, DoErrorConFrameCopy) { · 107 unmodified lines | ||
| 235 | 239 | } |
| 236 | 240 | |
| 237 | 241 | for (int iEC = 0; iEC < 2; ++ iEC) { //ERROR_CON_FRAME_COPY, ERROR_CON_FRAME_COPY_CROSS_IDR |
| 238 | − pECCtx->pCtx->eErrorConMethod = iEC > 0 ? ERROR_CON_FRAME_COPY_CROSS_IDR : ERROR_CON_FRAME_COPY; | |
| 242 | + pECCtx->pCtx->pParam->eEcActiveIdc = iEC > 0 ? ERROR_CON_FRAME_COPY_CROSS_IDR : ERROR_CON_FRAME_COPY; | |
| 239 | 243 | InitECCopyData (pECCtx); |
| 240 | 244 | int32_t iLumaSize = pECCtx->iMbWidth * pECCtx->iMbHeight * 256; |
| 241 | 245 | |
| @@ -246,7 +250,7 @@ TEST (ErrorConTest, DoErrorConFrameCopy) { · 4 unmodified lines | ||
| 246 | 250 | //Do reference code method |
| 247 | 251 | DoErrorConFrameCopy (pECCtx->pCtx); |
| 248 | 252 | //Do anchor method |
| 249 | − if (iRef && ! ((pECCtx->pCtx->eErrorConMethod == ERROR_CON_FRAME_COPY) | |
| 253 | + if (iRef && ! ((pECCtx->pCtx->pParam->eEcActiveIdc == ERROR_CON_FRAME_COPY) | |
| 250 | 254 | && (pECCtx->pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag))) |
| 251 | 255 | memcpy (pECCtx->sAncPic.pData[0], pECCtx->sSrcPic.pData[0], iLumaSize * 3 / 2); |
| 252 | 256 | else |
| @@ -272,7 +276,7 @@ TEST (ErrorConTest, DoErrorConSliceCopy) { · 19 unmodified lines | ||
| 272 | 276 | } |
| 273 | 277 | |
| 274 | 278 | for (int iEC = 0; iEC < 2; ++ iEC) { //ERROR_CON_SLICE_COPY, ERROR_CON_SLICE_COPY_CROSS_IDR |
| 275 | − pECCtx->pCtx->eErrorConMethod = iEC > 0 ? ERROR_CON_SLICE_COPY_CROSS_IDR : ERROR_CON_SLICE_COPY; | |
| 279 | + pECCtx->pCtx->pParam->eEcActiveIdc = iEC > 0 ? ERROR_CON_SLICE_COPY_CROSS_IDR : ERROR_CON_SLICE_COPY; | |
| 276 | 280 | InitECCopyData (pECCtx); |
| 277 | 281 | for (int iRef = 0; iRef < 2; ++ iRef) { //no ref, with ref |
| 278 | 282 | pECCtx->pCtx->pPreviousDecodedPictureInDpb = iRef ? &pECCtx->sSrcPic : NULL; |