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 | void FreeInputData (PECInputCtx pECCtx) { | 26 | void FreeInputData (PECInputCtx pECCtx) { |
| 27 | if (pECCtx != NULL) { | 27 | if (pECCtx != NULL) { |
| 28 | if (pECCtx->pCtx != NULL) { | 28 | if (pECCtx->pCtx != NULL) { |
| 29 | WELS_SAFE_FREE (pECCtx->pCtx->pParam, "pECCtx->pCtx->pParam"); | ||
| 29 | WELS_SAFE_FREE (pECCtx->pCtx->pSps, "pECCtx->pCtx->pSps"); | 30 | WELS_SAFE_FREE (pECCtx->pCtx->pSps, "pECCtx->pCtx->pSps"); |
| 30 | WELS_SAFE_FREE (pECCtx->pCtx, "pECCtx->pCtx"); | 31 | WELS_SAFE_FREE (pECCtx->pCtx, "pECCtx->pCtx"); |
| 31 | } | 32 | } |
| @@ -95,6 +96,9 @@ int32_t InitAndAllocInputData (PECInputCtx& pECCtx) { · 63 unmodified lines | |||
| 95 | return 1; | 96 | return 1; |
| 96 | pECCtx->pCtx->pSps->iMbWidth = pECCtx->iMbWidth; | 97 | pECCtx->pCtx->pSps->iMbWidth = pECCtx->iMbWidth; |
| 97 | pECCtx->pCtx->pSps->iMbHeight = pECCtx->iMbHeight; | 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 | return 0; | 103 | return 0; |
| 100 | } | 104 | } |
| @@ -121,7 +125,7 @@ void DoAncErrorConSliceCopy (PECInputCtx pECCtx) { · 20 unmodified lines | |||
| 121 | int32_t iMbHeight = (int32_t) pECCtx->iMbHeight; | 125 | int32_t iMbHeight = (int32_t) pECCtx->iMbHeight; |
| 122 | PPicture pDstPic = &pECCtx->sAncPic; | 126 | PPicture pDstPic = &pECCtx->sAncPic; |
| 123 | PPicture pSrcPic = pECCtx->pCtx->pPreviousDecodedPictureInDpb; | 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 | && (pECCtx->pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag)) | 129 | && (pECCtx->pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag)) |
| 126 | pSrcPic = NULL; | 130 | pSrcPic = NULL; |
| 127 | 131 | ||
| @@ -235,7 +239,7 @@ TEST (ErrorConTest, DoErrorConFrameCopy) { · 107 unmodified lines | |||
| 235 | } | 239 | } |
| 236 | 240 | ||
| 237 | for (int iEC = 0; iEC < 2; ++ iEC) { //ERROR_CON_FRAME_COPY, ERROR_CON_FRAME_COPY_CROSS_IDR | 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 | InitECCopyData (pECCtx); | 243 | InitECCopyData (pECCtx); |
| 240 | int32_t iLumaSize = pECCtx->iMbWidth * pECCtx->iMbHeight * 256; | 244 | int32_t iLumaSize = pECCtx->iMbWidth * pECCtx->iMbHeight * 256; |
| 241 | 245 | ||
| @@ -246,7 +250,7 @@ TEST (ErrorConTest, DoErrorConFrameCopy) { · 4 unmodified lines | |||
| 246 | //Do reference code method | 250 | //Do reference code method |
| 247 | DoErrorConFrameCopy (pECCtx->pCtx); | 251 | DoErrorConFrameCopy (pECCtx->pCtx); |
| 248 | //Do anchor method | 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 | && (pECCtx->pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag))) | 254 | && (pECCtx->pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag))) |
| 251 | memcpy (pECCtx->sAncPic.pData[0], pECCtx->sSrcPic.pData[0], iLumaSize * 3 / 2); | 255 | memcpy (pECCtx->sAncPic.pData[0], pECCtx->sSrcPic.pData[0], iLumaSize * 3 / 2); |
| 252 | else | 256 | else |
| @@ -272,7 +276,7 @@ TEST (ErrorConTest, DoErrorConSliceCopy) { · 19 unmodified lines | |||
| 272 | } | 276 | } |
| 273 | 277 | ||
| 274 | for (int iEC = 0; iEC < 2; ++ iEC) { //ERROR_CON_SLICE_COPY, ERROR_CON_SLICE_COPY_CROSS_IDR | 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 | InitECCopyData (pECCtx); | 280 | InitECCopyData (pECCtx); |
| 277 | for (int iRef = 0; iRef < 2; ++ iRef) { //no ref, with ref | 281 | for (int iRef = 0; iRef < 2; ++ iRef) { //no ref, with ref |
| 278 | pECCtx->pCtx->pPreviousDecodedPictureInDpb = iRef ? &pECCtx->sSrcPic : NULL; | 282 | pECCtx->pCtx->pPreviousDecodedPictureInDpb = iRef ? &pECCtx->sSrcPic : NULL; |