This reverts commit 27172bafd7ff2cc80b08768a32a23470f3d6d3fd, reversing changes made to 24916a652ee5d3e36d931c222df20966f7c158fa.
Showing the changes to test/decoder/DecUT_DecExt.cpp (1 of 11 files). Show all
Unified · Split
| @@ -26,8 +26,6 @@ class DecoderInterfaceTest : public ::testing::Test { · 25 unmodified lines | |||
| 26 | } | 26 | } |
| 27 | //Init members | 27 | //Init members |
| 28 | void Init(); | 28 | void Init(); |
| 29 | //Init valid members | ||
| 30 | void ValidInit(); | ||
| 31 | //Uninit members | 29 | //Uninit members |
| 32 | void Uninit(); | 30 | void Uninit(); |
| 33 | //Mock input data for test | 31 | //Mock input data for test |
| @@ -99,29 +97,6 @@ void DecoderInterfaceTest::Init() { · 65 unmodified lines | |||
| 99 | ASSERT_EQ (eRet, cmResultSuccess); | 97 | ASSERT_EQ (eRet, cmResultSuccess); |
| 100 | } | 98 | } |
| 101 | 99 | ||
| 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 | |||
| 125 | void DecoderInterfaceTest::Uninit() { | 100 | void DecoderInterfaceTest::Uninit() { |
| 126 | if (m_pDec) { | 101 | if (m_pDec) { |
| 127 | CM_RETURN eRet = (CM_RETURN) m_pDec->Uninitialize(); | 102 | CM_RETURN eRet = (CM_RETURN) m_pDec->Uninitialize(); |
| @@ -283,7 +258,7 @@ void DecoderInterfaceTest::TestEndOfStream() { · 155 unmodified lines | |||
| 283 | int iTmp, iOut; | 258 | int iTmp, iOut; |
| 284 | CM_RETURN eRet; | 259 | CM_RETURN eRet; |
| 285 | 260 | ||
| 286 | ValidInit(); | 261 | Init(); |
| 287 | 262 | ||
| 288 | //invalid input | 263 | //invalid input |
| 289 | eRet = (CM_RETURN) m_pDec->SetOption (DECODER_OPTION_END_OF_STREAM, NULL); | 264 | eRet = (CM_RETURN) m_pDec->SetOption (DECODER_OPTION_END_OF_STREAM, NULL); |
| @@ -345,7 +320,7 @@ void DecoderInterfaceTest::TestVclNal() { · 55 unmodified lines | |||
| 345 | int iTmp, iOut; | 320 | int iTmp, iOut; |
| 346 | CM_RETURN eRet; | 321 | CM_RETURN eRet; |
| 347 | 322 | ||
| 348 | ValidInit(); | 323 | Init(); |
| 349 | 324 | ||
| 350 | //Test SetOption | 325 | //Test SetOption |
| 351 | //VclNal never supports SetOption | 326 | //VclNal never supports SetOption |
| @@ -454,7 +429,7 @@ void DecoderInterfaceTest::TestGetDecStatistics() { · 102 unmodified lines | |||
| 454 | SDecoderStatistics sDecStatic; | 429 | SDecoderStatistics sDecStatic; |
| 455 | int32_t iError = 0; | 430 | int32_t iError = 0; |
| 456 | 431 | ||
| 457 | ValidInit(); | 432 | Init(); |
| 458 | // setoption not support, | 433 | // setoption not support, |
| 459 | eRet = (CM_RETURN)m_pDec->SetOption (DECODER_OPTION_GET_STATISTICS, NULL); | 434 | eRet = (CM_RETURN)m_pDec->SetOption (DECODER_OPTION_GET_STATISTICS, NULL); |
| 460 | EXPECT_EQ (eRet, cmInitParaError); | 435 | EXPECT_EQ (eRet, cmInitParaError); |
| @@ -477,7 +452,7 @@ void DecoderInterfaceTest::TestGetDecStatistics() { · 16 unmodified lines | |||
| 477 | Uninit(); | 452 | Uninit(); |
| 478 | 453 | ||
| 479 | //Decoder error bs when the first IDR lost | 454 | //Decoder error bs when the first IDR lost |
| 480 | ValidInit(); | 455 | Init(); |
| 481 | iError = 2; | 456 | iError = 2; |
| 482 | m_pDec->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iError); | 457 | m_pDec->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iError); |
| 483 | DecoderBs ("res/BA_MW_D_IDR_LOST.264"); | 458 | DecoderBs ("res/BA_MW_D_IDR_LOST.264"); |
| @@ -495,7 +470,7 @@ void DecoderInterfaceTest::TestGetDecStatistics() { · 11 unmodified lines | |||
| 495 | Uninit(); | 470 | Uninit(); |
| 496 | 471 | ||
| 497 | //ecoder error bs when the first P lost | 472 | //ecoder error bs when the first P lost |
| 498 | ValidInit(); | 473 | Init(); |
| 499 | iError = 2; | 474 | iError = 2; |
| 500 | m_pDec->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iError); | 475 | m_pDec->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iError); |
| 501 | 476 | ||
| @@ -516,7 +491,7 @@ void DecoderInterfaceTest::TestGetDecStatistics() { · 14 unmodified lines | |||
| 516 | //EC enable | 491 | //EC enable |
| 517 | 492 | ||
| 518 | //EC Off UT just correc bitstream | 493 | //EC Off UT just correc bitstream |
| 519 | ValidInit(); | 494 | Init(); |
| 520 | iError = 0; | 495 | iError = 0; |
| 521 | m_pDec->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iError); | 496 | m_pDec->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iError); |
| 522 | DecoderBs ("res/test_vd_1d.264"); | 497 | DecoderBs ("res/test_vd_1d.264"); |