Showing the changes to test/decoder/DecUT_ParseSyntax.cpp (1 of 29 files). Show all
Unified · Split
| @@ -155,6 +155,11 @@ class DecoderParseSyntaxTest : public ::testing::Test { · 154 unmodified lines | |||
| 155 | SDecodingParam m_sDecParam; | 155 | SDecodingParam m_sDecParam; |
| 156 | SBufferInfo m_sBufferInfo; | 156 | SBufferInfo m_sBufferInfo; |
| 157 | SParserBsInfo m_sParserBsInfo; | 157 | SParserBsInfo m_sParserBsInfo; |
| 158 | SWelsDecoderSpsPpsCTX m_sDecoderSpsPpsCTX; | ||
| 159 | SWelsLastDecPicInfo m_sLastDecPicInfo; | ||
| 160 | SDecoderStatistics m_sDecoderStatistics; | ||
| 161 | SVlcTable m_sVlcTable; | ||
| 162 | |||
| 158 | uint8_t* m_pData[3]; | 163 | uint8_t* m_pData[3]; |
| 159 | unsigned char m_szBuffer[BUF_SIZE]; //for mocking packet | 164 | unsigned char m_szBuffer[BUF_SIZE]; //for mocking packet |
| 160 | int m_iBufLength; //record the valid data in m_szBuffer | 165 | int m_iBufLength; //record the valid data in m_szBuffer |
| @@ -168,6 +173,11 @@ int32_t DecoderParseSyntaxTest::Init() { · 7 unmodified lines | |||
| 168 | memset (&m_sBufferInfo, 0, sizeof (SBufferInfo)); | 173 | memset (&m_sBufferInfo, 0, sizeof (SBufferInfo)); |
| 169 | memset (&m_sDecParam, 0, sizeof (SDecodingParam)); | 174 | memset (&m_sDecParam, 0, sizeof (SDecodingParam)); |
| 170 | memset (&m_sParserBsInfo, 0, sizeof (SParserBsInfo)); | 175 | memset (&m_sParserBsInfo, 0, sizeof (SParserBsInfo)); |
| 176 | memset (&m_sDecoderSpsPpsCTX, 0, sizeof (SWelsDecoderSpsPpsCTX)); | ||
| 177 | memset (&m_sLastDecPicInfo, 0, sizeof (SWelsLastDecPicInfo)); | ||
| 178 | memset (&m_sDecoderStatistics, 0, sizeof (SDecoderStatistics)); | ||
| 179 | memset (&m_sVlcTable, 0, sizeof (SVlcTable)); | ||
| 180 | |||
| 171 | m_sDecParam.pFileNameRestructed = NULL; | 181 | m_sDecParam.pFileNameRestructed = NULL; |
| 172 | m_sDecParam.uiCpuLoad = rand() % 100; | 182 | m_sDecParam.uiCpuLoad = rand() % 100; |
| 173 | m_sDecParam.uiTargetDqLayer = rand() % 100; | 183 | m_sDecParam.uiTargetDqLayer = rand() % 100; |
| @@ -193,6 +203,10 @@ int32_t DecoderParseSyntaxTest::Init() { · 19 unmodified lines | |||
| 193 | m_pCtx = NULL; | 203 | m_pCtx = NULL; |
| 194 | return ERR_MALLOC_FAILED; | 204 | return ERR_MALLOC_FAILED; |
| 195 | } | 205 | } |
| 206 | m_pCtx->pLastDecPicInfo = &m_sLastDecPicInfo; | ||
| 207 | m_pCtx->pDecoderStatistics = &m_sDecoderStatistics; | ||
| 208 | m_pCtx->pVlcTable = &m_sVlcTable; | ||
| 209 | WelsDecoderSpsPpsDefaults (m_pCtx->sSpsPpsCtx); | ||
| 196 | CM_RETURN eRet = (CM_RETURN)Initialize (&m_sDecParam, m_pCtx, &m_pWelsTrace->m_sLogCtx); | 210 | CM_RETURN eRet = (CM_RETURN)Initialize (&m_sDecParam, m_pCtx, &m_pWelsTrace->m_sLogCtx); |
| 197 | return (int32_t)eRet; | 211 | return (int32_t)eRet; |
| 198 | } | 212 | } |
| @@ -377,23 +391,23 @@ void DecoderParseSyntaxTest::TestScalingList() { · 178 unmodified lines | |||
| 377 | iRet = Init(); | 391 | iRet = Init(); |
| 378 | ASSERT_EQ (iRet, ERR_NONE); | 392 | ASSERT_EQ (iRet, ERR_NONE); |
| 379 | ASSERT_TRUE (DecodeBs ("res/BA_MW_D.264", CorrectDec)); | 393 | ASSERT_TRUE (DecodeBs ("res/BA_MW_D.264", CorrectDec)); |
| 380 | ASSERT_TRUE (m_pCtx->sSpsBuffer[0].bSeqScalingMatrixPresentFlag == false); | 394 | ASSERT_TRUE (m_pCtx->sSpsPpsCtx.sSpsBuffer[0].bSeqScalingMatrixPresentFlag == false); |
| 381 | EXPECT_EQ (0, memcmp (iScalingListZero, m_pCtx->sSpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t))); | 395 | EXPECT_EQ (0, memcmp (iScalingListZero, m_pCtx->sSpsPpsCtx.sSpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t))); |
| 382 | ASSERT_TRUE (m_pCtx->sPpsBuffer[0].bPicScalingMatrixPresentFlag == false); | 396 | ASSERT_TRUE (m_pCtx->sSpsPpsCtx.sPpsBuffer[0].bPicScalingMatrixPresentFlag == false); |
| 383 | EXPECT_EQ (0, memcmp (iScalingListZero, m_pCtx->sPpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t))); | 397 | EXPECT_EQ (0, memcmp (iScalingListZero, m_pCtx->sSpsPpsCtx.sPpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t))); |
| 384 | Uninit(); | 398 | Uninit(); |
| 385 | //Scalinglist value just written into sps and pps | 399 | //Scalinglist value just written into sps and pps |
| 386 | iRet = Init(); | 400 | iRet = Init(); |
| 387 | ASSERT_EQ (iRet, ERR_NONE); | 401 | ASSERT_EQ (iRet, ERR_NONE); |
| 388 | ASSERT_TRUE (DecodeBs ("res/test_scalinglist_jm.264", CorrectDec)); | 402 | ASSERT_TRUE (DecodeBs ("res/test_scalinglist_jm.264", CorrectDec)); |
| 389 | ASSERT_TRUE (m_pCtx->sSpsBuffer[0].bSeqScalingMatrixPresentFlag); | 403 | ASSERT_TRUE (m_pCtx->sSpsPpsCtx.sSpsBuffer[0].bSeqScalingMatrixPresentFlag); |
| 390 | for (int i = 0; i < 6; i++) { | 404 | for (int i = 0; i < 6; i++) { |
| 391 | EXPECT_EQ (0, memcmp (iScalingList[i], m_pCtx->sSpsBuffer[0].iScalingList4x4[i], 16 * sizeof (uint8_t))); | 405 | EXPECT_EQ (0, memcmp (iScalingList[i], m_pCtx->sSpsPpsCtx.sSpsBuffer[0].iScalingList4x4[i], 16 * sizeof (uint8_t))); |
| 392 | } | 406 | } |
| 393 | 407 | ||
| 394 | ASSERT_TRUE (m_pCtx->sPpsBuffer[0].bPicScalingMatrixPresentFlag == true); | 408 | ASSERT_TRUE (m_pCtx->sSpsPpsCtx.sPpsBuffer[0].bPicScalingMatrixPresentFlag == true); |
| 395 | for (int i = 0; i < 6; i++) { | 409 | for (int i = 0; i < 6; i++) { |
| 396 | EXPECT_EQ (0, memcmp (iScalingListPPS[i], m_pCtx->sPpsBuffer[0].iScalingList4x4[i], 16 * sizeof (uint8_t))); | 410 | EXPECT_EQ (0, memcmp (iScalingListPPS[i], m_pCtx->sSpsPpsCtx.sPpsBuffer[0].iScalingList4x4[i], 16 * sizeof (uint8_t))); |
| 397 | } | 411 | } |
| 398 | Uninit(); | 412 | Uninit(); |
| 399 | } | 413 | } |