shithub: openh264

Download patch

ref: 8bef6bc94295d795d9585438c9ffd48260930b27
parent: 2df01852524dea6e967bca320470db2525b6edc7
parent: 50ce93e31ce25edbe17a56661d61b2cf56abe351
author: sijchen <[email protected]>
date: Mon Jan 19 11:36:29 EST 2015

Merge pull request #1738 from huili2/init_EC_modify

modify EC init position

--- a/codec/decoder/core/src/decoder.cpp
+++ b/codec/decoder/core/src/decoder.cpp
@@ -459,7 +459,6 @@
   //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 @@
 
   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) {
--- a/test/decoder/DecUT_DecExt.cpp
+++ b/test/decoder/DecUT_DecExt.cpp
@@ -81,7 +81,7 @@
   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 @@
 
 //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