History

fix subsetsps parse and scalinglist bug fix

huili2 committed 9 years ago

Commit c5a09fa1 parent d0719d59 files · +157 −36Browse files

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

Unified · Split

test/decoder/DecUT_ParseSyntax.cpp+16−6
@@ -259,17 +259,25 @@ void DecoderParseSyntaxTest::TestScalingList() { · 258 unmodified lines
259259 {10, 14, 20, 24, 14, 20, 24, 27, 20, 24, 27, 30, 24, 27, 30, 34 },
260260 { 9, 13, 18, 21, 13, 18, 21, 24, 18, 21, 24, 27, 21, 24, 27, 27 }
261261 };
262− uint8_t iScalingListPPS[6][16];
263− memset (iScalingListPPS, 0, 6 * 16 * sizeof (uint8_t));
262+ uint8_t iScalingListPPS[6][16] = {
263+ { 17, 17, 16, 16, 17, 16, 15, 15, 16, 15, 15, 15, 16, 15, 15, 15 },
264+ { 6, 12, 19, 26, 12, 19, 26, 31, 19, 26, 31, 35, 26, 31, 35, 39 },
265+ { 6, 12, 19, 26, 12, 19, 26, 31, 19, 26, 31, 35, 26, 31, 35, 40 },
266+ { 17, 17, 16, 16, 17, 16, 15, 15, 16, 15, 15, 15, 16, 15, 15, 14 },
267+ { 10, 14, 20, 24, 14, 20, 24, 27, 20, 24, 27, 30, 24, 27, 30, 34 },
268+ { 9, 13, 18, 21, 13, 18, 21, 24, 18, 21, 24, 27, 21, 24, 27, 27 }
269+ };
270+ uint8_t iScalingListZero[6][16];
271+ memset (iScalingListZero, 0, 6 * 16 * sizeof (uint8_t));
264272 //Scalinglist matrix not written into sps or pps
265273 int32_t iRet = ERR_NONE;
266274 iRet = Init();
267275 ASSERT_EQ (iRet, ERR_NONE);
268276 DecodeBs ("res/BA_MW_D.264");
269277 ASSERT_TRUE (m_pCtx->sSpsBuffer[0].bSeqScalingMatrixPresentFlag == false);
270− EXPECT_EQ (0, memcmp (iScalingListPPS, m_pCtx->sSpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t)));
278+ EXPECT_EQ (0, memcmp (iScalingListZero, m_pCtx->sSpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t)));
271279 ASSERT_TRUE (m_pCtx->sPpsBuffer[0].bPicScalingMatrixPresentFlag == false);
272− EXPECT_EQ (0, memcmp (iScalingListPPS, m_pCtx->sPpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t)));
280+ EXPECT_EQ (0, memcmp (iScalingListZero, m_pCtx->sPpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t)));
273281 Uninit();
274282 //Scalinglist value just written into sps and pps
275283 iRet = Init();
@@ -280,8 +288,10 @@ void DecoderParseSyntaxTest::TestScalingList() { · 4 unmodified lines
280288 EXPECT_EQ (0, memcmp (iScalingList[i], m_pCtx->sSpsBuffer[0].iScalingList4x4[i], 16 * sizeof (uint8_t)));
281289 }
282290
283− ASSERT_TRUE (m_pCtx->sPpsBuffer[0].bPicScalingMatrixPresentFlag == false);
284− EXPECT_EQ (0, memcmp (iScalingListPPS, m_pCtx->sPpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t)));
291+ ASSERT_TRUE (m_pCtx->sPpsBuffer[0].bPicScalingMatrixPresentFlag == true);
292+ for (int i = 0; i < 6; i++) {
293+ EXPECT_EQ (0, memcmp (iScalingListPPS[i], m_pCtx->sPpsBuffer[0].iScalingList4x4[i], 16 * sizeof (uint8_t)));
294+ }
285295 Uninit();
286296 }
287297

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