History

re-structure SWelsDecoderContext and others and prepare for the support of multi-threading support.

xiaotiansf committed 7 years ago

Commit 2f5ecec1 parent 9ed97c729 files · +2285 −1568Browse files

Showing the changes to test/decoder/DecUT_ParseSyntax.cpp (1 of 29 files). Show all

Unified · Split

test/decoder/DecUT_ParseSyntax.cpp+22−8
@@ -155,6 +155,11 @@ class DecoderParseSyntaxTest : public ::testing::Test { · 154 unmodified lines
155155 SDecodingParam m_sDecParam;
156156 SBufferInfo m_sBufferInfo;
157157 SParserBsInfo m_sParserBsInfo;
158+ SWelsDecoderSpsPpsCTX m_sDecoderSpsPpsCTX;
159+ SWelsLastDecPicInfo m_sLastDecPicInfo;
160+ SDecoderStatistics m_sDecoderStatistics;
161+ SVlcTable m_sVlcTable;
162+
158163 uint8_t* m_pData[3];
159164 unsigned char m_szBuffer[BUF_SIZE]; //for mocking packet
160165 int m_iBufLength; //record the valid data in m_szBuffer
@@ -168,6 +173,11 @@ int32_t DecoderParseSyntaxTest::Init() { · 7 unmodified lines
168173 memset (&m_sBufferInfo, 0, sizeof (SBufferInfo));
169174 memset (&m_sDecParam, 0, sizeof (SDecodingParam));
170175 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+
171181 m_sDecParam.pFileNameRestructed = NULL;
172182 m_sDecParam.uiCpuLoad = rand() % 100;
173183 m_sDecParam.uiTargetDqLayer = rand() % 100;
@@ -193,6 +203,10 @@ int32_t DecoderParseSyntaxTest::Init() { · 19 unmodified lines
193203 m_pCtx = NULL;
194204 return ERR_MALLOC_FAILED;
195205 }
206+ m_pCtx->pLastDecPicInfo = &m_sLastDecPicInfo;
207+ m_pCtx->pDecoderStatistics = &m_sDecoderStatistics;
208+ m_pCtx->pVlcTable = &m_sVlcTable;
209+ WelsDecoderSpsPpsDefaults (m_pCtx->sSpsPpsCtx);
196210 CM_RETURN eRet = (CM_RETURN)Initialize (&m_sDecParam, m_pCtx, &m_pWelsTrace->m_sLogCtx);
197211 return (int32_t)eRet;
198212 }
@@ -377,23 +391,23 @@ void DecoderParseSyntaxTest::TestScalingList() { · 178 unmodified lines
377391 iRet = Init();
378392 ASSERT_EQ (iRet, ERR_NONE);
379393 ASSERT_TRUE (DecodeBs ("res/BA_MW_D.264", CorrectDec));
380− ASSERT_TRUE (m_pCtx->sSpsBuffer[0].bSeqScalingMatrixPresentFlag == false);
381− EXPECT_EQ (0, memcmp (iScalingListZero, m_pCtx->sSpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t)));
382− ASSERT_TRUE (m_pCtx->sPpsBuffer[0].bPicScalingMatrixPresentFlag == false);
383− EXPECT_EQ (0, memcmp (iScalingListZero, m_pCtx->sPpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t)));
394+ ASSERT_TRUE (m_pCtx->sSpsPpsCtx.sSpsBuffer[0].bSeqScalingMatrixPresentFlag == false);
395+ EXPECT_EQ (0, memcmp (iScalingListZero, m_pCtx->sSpsPpsCtx.sSpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t)));
396+ ASSERT_TRUE (m_pCtx->sSpsPpsCtx.sPpsBuffer[0].bPicScalingMatrixPresentFlag == false);
397+ EXPECT_EQ (0, memcmp (iScalingListZero, m_pCtx->sSpsPpsCtx.sPpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t)));
384398 Uninit();
385399 //Scalinglist value just written into sps and pps
386400 iRet = Init();
387401 ASSERT_EQ (iRet, ERR_NONE);
388402 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);
390404 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)));
392406 }
393407
394− ASSERT_TRUE (m_pCtx->sPpsBuffer[0].bPicScalingMatrixPresentFlag == true);
408+ ASSERT_TRUE (m_pCtx->sSpsPpsCtx.sPpsBuffer[0].bPicScalingMatrixPresentFlag == true);
395409 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)));
397411 }
398412 Uninit();
399413 }

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