History

Revert "Merge pull request #2217 from huili2/simply_dec_ctx"

This reverts commit 27172bafd7ff2cc80b08768a32a23470f3d6d3fd, reversing changes made to 24916a652ee5d3e36d931c222df20966f7c158fa.

Haibo Zhu committed 11 years ago

Commit 628befe1 parent 513a34011 files · +86 −133Browse files

Showing the changes to test/decoder (2 of 11 files). Show all

Unified · Split

2 files
  1. test/decoder/DecUT_DecExt.cpp +6 −31
  2. test/decoder/DecUT_ParseSyntax.cpp +2 −5
test/decoder/DecUT_DecExt.cpp+6−31
@@ -26,8 +26,6 @@ class DecoderInterfaceTest : public ::testing::Test { · 25 unmodified lines
2626 }
2727 //Init members
2828 void Init();
29− //Init valid members
30− void ValidInit();
3129 //Uninit members
3230 void Uninit();
3331 //Mock input data for test
@@ -99,29 +97,6 @@ void DecoderInterfaceTest::Init() { · 65 unmodified lines
9997 ASSERT_EQ (eRet, cmResultSuccess);
10098 }
10199
102−void DecoderInterfaceTest::ValidInit() {
103− memset (&m_sBufferInfo, 0, sizeof (SBufferInfo));
104− memset (&m_sDecParam, 0, sizeof (SDecodingParam));
105− m_sDecParam.pFileNameRestructed = NULL;
106− m_sDecParam.eOutputColorFormat = (EVideoFormatType) 23;
107− m_sDecParam.uiCpuLoad = 1;
108− m_sDecParam.uiTargetDqLayer = 1;
109− m_sDecParam.eEcActiveIdc = (ERROR_CON_IDC) (rand() & 7);
110− m_sDecParam.sVideoProperty.size = sizeof (SVideoProperty);
111− m_sDecParam.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_DEFAULT;
112−
113− m_pData[0] = m_pData[1] = m_pData[2] = NULL;
114− m_szBuffer[0] = m_szBuffer[1] = m_szBuffer[2] = 0;
115− m_szBuffer[3] = 1;
116− m_iBufLength = 4;
117− CM_RETURN eRet = (CM_RETURN) m_pDec->Initialize (&m_sDecParam);
118− if ((m_sDecParam.eOutputColorFormat != videoFormatI420) &&
119− (m_sDecParam.eOutputColorFormat != videoFormatInternal))
120− ASSERT_EQ (eRet, cmUnsupportedData);
121− else
122− ASSERT_EQ (eRet, cmResultSuccess);
123−}
124−
125100 void DecoderInterfaceTest::Uninit() {
126101 if (m_pDec) {
127102 CM_RETURN eRet = (CM_RETURN) m_pDec->Uninitialize();
@@ -283,7 +258,7 @@ void DecoderInterfaceTest::TestEndOfStream() { · 155 unmodified lines
283258 int iTmp, iOut;
284259 CM_RETURN eRet;
285260
286− ValidInit();
261+ Init();
287262
288263 //invalid input
289264 eRet = (CM_RETURN) m_pDec->SetOption (DECODER_OPTION_END_OF_STREAM, NULL);
@@ -345,7 +320,7 @@ void DecoderInterfaceTest::TestVclNal() { · 55 unmodified lines
345320 int iTmp, iOut;
346321 CM_RETURN eRet;
347322
348− ValidInit();
323+ Init();
349324
350325 //Test SetOption
351326 //VclNal never supports SetOption
@@ -454,7 +429,7 @@ void DecoderInterfaceTest::TestGetDecStatistics() { · 102 unmodified lines
454429 SDecoderStatistics sDecStatic;
455430 int32_t iError = 0;
456431
457− ValidInit();
432+ Init();
458433 // setoption not support,
459434 eRet = (CM_RETURN)m_pDec->SetOption (DECODER_OPTION_GET_STATISTICS, NULL);
460435 EXPECT_EQ (eRet, cmInitParaError);
@@ -477,7 +452,7 @@ void DecoderInterfaceTest::TestGetDecStatistics() { · 16 unmodified lines
477452 Uninit();
478453
479454 //Decoder error bs when the first IDR lost
480− ValidInit();
455+ Init();
481456 iError = 2;
482457 m_pDec->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iError);
483458 DecoderBs ("res/BA_MW_D_IDR_LOST.264");
@@ -495,7 +470,7 @@ void DecoderInterfaceTest::TestGetDecStatistics() { · 11 unmodified lines
495470 Uninit();
496471
497472 //ecoder error bs when the first P lost
498− ValidInit();
473+ Init();
499474 iError = 2;
500475 m_pDec->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iError);
501476
@@ -516,7 +491,7 @@ void DecoderInterfaceTest::TestGetDecStatistics() { · 14 unmodified lines
516491 //EC enable
517492
518493 //EC Off UT just correc bitstream
519− ValidInit();
494+ Init();
520495 iError = 0;
521496 m_pDec->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iError);
522497 DecoderBs ("res/test_vd_1d.264");
test/decoder/DecUT_ParseSyntax.cpp+2−5
@@ -86,16 +86,13 @@ int32_t InitDecoder (const SDecodingParam* pParam, PWelsDecoderContext pCtx, SLo · 85 unmodified lines
8686 return cmMallocMemeError;
8787 }
8888
89− pCtx->sLogCtx = *pLogCtx;
90−
89+ WELS_VERIFY_RETURN_PROC_IF (cmInitParaError, WelsInitDecoder (pCtx, pParam->bParseOnly, pLogCtx), UninitDecoder (pCtx));
9190 //check param and update decoder context
9291 pCtx->pParam = (SDecodingParam*) pCtx->pMemAlign->WelsMallocz (sizeof (SDecodingParam), "SDecodingParam");
9392 WELS_VERIFY_RETURN_PROC_IF (cmMallocMemeError, (NULL == pCtx->pParam), UninitDecoder (pCtx));
94− int32_t iRet = DecoderConfigParam (pCtx, pParam);
93+ int32_t iRet = DecoderConfigParam (pCtx, pCtx->pParam);
9594 WELS_VERIFY_RETURN_IFNEQ (iRet, cmResultSuccess);
9695
97− WELS_VERIFY_RETURN_PROC_IF (cmInitParaError, WelsInitDecoder (pCtx, pLogCtx), UninitDecoder (pCtx));
98−
9996 return cmResultSuccess;
10097 }
10198

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t