diff --git a/codec/decoder/core/src/decoder.cpp b/codec/decoder/core/src/decoder.cpp index f81022a1..5b33a2e0 100644 --- a/codec/decoder/core/src/decoder.cpp +++ b/codec/decoder/core/src/decoder.cpp @@ -459,7 +459,6 @@ int32_t WelsOpenDecoder (PWelsDecoderContext pCtx) { //initial MC function pointer-- int iRet = ERR_NONE; InitMcFunc (& (pCtx->sMcFunc), pCtx->uiCpuFlag); - InitErrorCon (pCtx); InitExpandPictureFunc (& (pCtx->sExpandPicFunc), pCtx->uiCpuFlag); AssignFuncPointerForRec (pCtx); @@ -525,6 +524,7 @@ int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const SDecodingParam* kpPa if (pCtx->bParseOnly) //parse only, disable EC method pCtx->eErrorConMethod = ERROR_CON_DISABLE; + InitErrorCon (pCtx); if (VIDEO_BITSTREAM_SVC == pCtx->pParam->sVideoProperty.eVideoBsType || VIDEO_BITSTREAM_AVC == pCtx->pParam->sVideoProperty.eVideoBsType) { diff --git a/test/decoder/DecUT_DecExt.cpp b/test/decoder/DecUT_DecExt.cpp index bd5d88c6..7367999f 100644 --- a/test/decoder/DecUT_DecExt.cpp +++ b/test/decoder/DecUT_DecExt.cpp @@ -81,7 +81,7 @@ void DecoderInterfaceTest::Init() { m_sDecParam.eOutputColorFormat = (EVideoFormatType) (rand() % 100); m_sDecParam.uiCpuLoad = rand() % 100; m_sDecParam.uiTargetDqLayer = rand() % 100; - m_sDecParam.eEcActiveIdc = (ERROR_CON_IDC) (rand() & 3); + m_sDecParam.eEcActiveIdc = (ERROR_CON_IDC) (rand() & 7); m_sDecParam.sVideoProperty.size = sizeof (SVideoProperty); m_sDecParam.sVideoProperty.eVideoBsType = (VIDEO_BITSTREAM_TYPE) (rand() % 3); @@ -379,7 +379,33 @@ void DecoderInterfaceTest::TestLtrMarkedFrameNum() { //DECODER_OPTION_ERROR_CON_IDC void DecoderInterfaceTest::TestErrorConIdc() { - //TODO + int iTmp, iOut; + CM_RETURN eRet; + + Init(); + + //Test GetOption + //invalid input + eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_ERROR_CON_IDC, NULL); + EXPECT_EQ (eRet, cmInitParaError); + + //Test GetOption + //valid input + eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_ERROR_CON_IDC, &iOut); + EXPECT_EQ (eRet, cmResultSuccess); + + //Test SetOption + iTmp = rand() & 7; + eRet = (CM_RETURN) m_pDec->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iTmp); + EXPECT_EQ (eRet, cmResultSuccess); + + //Test GetOption + eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_ERROR_CON_IDC, &iOut); + EXPECT_EQ (eRet, cmResultSuccess); + EXPECT_EQ (iTmp, iOut); + + Uninit(); + } //DECODER_OPTION_TRACE_LEVEL