diff --git a/codec/decoder/core/src/decoder_core.cpp b/codec/decoder/core/src/decoder_core.cpp index 6332f83d..1a8765d7 100644 --- a/codec/decoder/core/src/decoder_core.cpp +++ b/codec/decoder/core/src/decoder_core.cpp @@ -397,11 +397,6 @@ int32_t WelsInitMemory (PWelsDecoderContext pCtx) { pCtx->uiTargetDqId = (uint8_t) - 1; pCtx->bEndOfStreamFlag = false; - pCtx->iImgWidthInPixel = 0; - pCtx->iImgHeightInPixel = 0; - pCtx->iLastImgWidthInPixel = 0; - pCtx->iLastImgHeightInPixel = 0; - pCtx->bFreezeOutput = false; return ERR_NONE; } @@ -1083,7 +1078,7 @@ int32_t InitialDqLayersContext (PWelsDecoderContext pCtx, const int32_t kiMaxWid pCtx->sMb.pMbCorrectlyDecodedFlag[i] = (bool*) WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (bool), "pCtx->sMb.pMbCorrectlyDecodedFlag[]"); pCtx->sMb.pMbRefConcealedFlag[i] = (bool*) WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (bool), - "pCtx->pMbRefConcealedFlag[]"); + "pCtx->pMbRefConcealedFlag[]"); // check memory block valid due above allocated.. WELS_VERIFY_RETURN_IF (ERR_INFO_OUT_OF_MEMORY, diff --git a/codec/decoder/core/src/error_concealment.cpp b/codec/decoder/core/src/error_concealment.cpp index 11aa58ef..96442e0e 100644 --- a/codec/decoder/core/src/error_concealment.cpp +++ b/codec/decoder/core/src/error_concealment.cpp @@ -45,6 +45,10 @@ void InitErrorCon (PWelsDecoderContext pCtx) { || (pCtx->eErrorConMethod == ERROR_CON_SLICE_MV_COPY_CROSS_IDR) || (pCtx->eErrorConMethod == ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE) || (pCtx->eErrorConMethod == ERROR_CON_SLICE_COPY_CROSS_IDR_FREEZE_RES_CHANGE)) { + if ((pCtx->eErrorConMethod != ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE) + && (pCtx->eErrorConMethod != ERROR_CON_SLICE_COPY_CROSS_IDR_FREEZE_RES_CHANGE)) { + pCtx->bFreezeOutput = false; + } pCtx->sCopyFunc.pCopyLumaFunc = WelsCopy16x16_c; pCtx->sCopyFunc.pCopyChromaFunc = WelsCopy8x8_c; diff --git a/test/api/encode_decode_api_test.cpp b/test/api/encode_decode_api_test.cpp index 5544f221..a3ddf6be 100644 --- a/test/api/encode_decode_api_test.cpp +++ b/test/api/encode_decode_api_test.cpp @@ -1039,7 +1039,7 @@ TEST_P (EncodeDecodeTestAPI, InOutTimeStamp) { encoder_->Uninitialize(); int rv = encoder_->InitializeExt (¶m_); ASSERT_TRUE (rv == cmResultSuccess); - + InitialEncDec (p.width, p.height); int32_t iTraceLevel = WELS_LOG_QUIET; encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel); @@ -1608,7 +1608,7 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificFrameChange) { //loss (2 slice: 1,2): 2 0 0 1 0 TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRLoss) { - uint32_t uiEcIdc; + uint32_t uiEcIdc = 2; //default set as SLICE_COPY uint32_t uiGet; EncodeDecodeFileParamBase p = kFileParamArray[0]; prepareParam (1, 2, p.width, p.height, p.frameRate); @@ -1616,6 +1616,7 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRLoss) { encoder_->Uninitialize(); int rv = encoder_->InitializeExt (¶m_); ASSERT_TRUE (rv == cmResultSuccess); + decoder_->SetOption (DECODER_OPTION_ERROR_CON_IDC, &uiEcIdc); decoder_->GetOption (DECODER_OPTION_ERROR_CON_IDC, &uiGet); EXPECT_EQ (uiGet, (uint32_t) ERROR_CON_SLICE_COPY); //default value should be ERROR_CON_SLICE_COPY int32_t iTraceLevel = WELS_LOG_QUIET;