History

Merge pull request #1406 from mstorsjo/fix-warnings

Fix compiler warnings about comparison between signed and unsigned Fix bugs WelsDeblockingFilterSlice UT when random value is 0

Ethan Hugg committed 12 years ago

Commit 3885bd82 parents f9bab05 ad247a91 file · +17 −17Browse files

Showing the changes to test/decoder/DecUT_DeblockCommon.cpp (1 of 1 file). Show all

Unified · Split

test/decoder/DecUT_DeblockCommon.cpp+17−17
@@ -583,7 +583,7 @@ TEST (DecoderDeblocking, WelsDeblockingFilterSlice) { · 582 unmodified lines
583583 // (1) Normal case, the iTotalMbInCurSlice == pSps->uiTotalMbCount
584584 sDqLayer.iMbX = sDqLayer.iMbY = 0;
585585 sDqLayer.iMbXyIndex = 0;
586− sDqLayer.sLayerInfo.sSliceInLayer.iTotalMbInCurSlice = rand() % 256;
586+ sDqLayer.sLayerInfo.sSliceInLayer.iTotalMbInCurSlice = 1 + rand() % 256; // at least one MB
587587 sDqLayer.sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.pSps->uiTotalMbCount =
588588 sDqLayer.sLayerInfo.sSliceInLayer.iTotalMbInCurSlice;
589589 sDqLayer.iMbWidth = 1 + rand() % 128;
@@ -591,32 +591,32 @@ TEST (DecoderDeblocking, WelsDeblockingFilterSlice) { · 1 unmodified line
591591 EXPECT_TRUE ((sDqLayer.iMbXyIndex + 1) == sDqLayer.sLayerInfo.sSliceInLayer.iTotalMbInCurSlice) << sDqLayer.iMbXyIndex
592592 << " " << sDqLayer.sLayerInfo.sSliceInLayer.iTotalMbInCurSlice;
593593
594− // (2) Normal case, multi slices, iTotalMbInCurSlice < pSps->uiTotalMbCount
594+ // (2) Normal case, multi slices, iTotalMbInCurSlice <= pSps->uiTotalMbCount
595595 sDqLayer.iMbX = sDqLayer.iMbY = 0;
596596 sDqLayer.iMbXyIndex = 0;
597− sDqLayer.sLayerInfo.sSliceInLayer.iTotalMbInCurSlice = rand() % 256;
597+ sDqLayer.sLayerInfo.sSliceInLayer.iTotalMbInCurSlice = 1 + rand() % 256;
598598 sDqLayer.sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.pSps->uiTotalMbCount =
599599 sDqLayer.sLayerInfo.sSliceInLayer.iTotalMbInCurSlice + rand() % 256;
600600 sDqLayer.iMbWidth = 1 + rand() % 128;
601601 WelsDeblockingFilterSlice (&sCtx, pDeblockMb);
602602 EXPECT_TRUE ((sDqLayer.iMbXyIndex + 1) == sDqLayer.sLayerInfo.sSliceInLayer.iTotalMbInCurSlice);
603603
604− // (3) Special case, iTotalMbInCurSlice > pSps->uiTotalMbCount, JUST FOR TEST
604+ // (3) Special case, iTotalMbInCurSlice >= pSps->uiTotalMbCount, JUST FOR TEST
605605 sDqLayer.iMbX = sDqLayer.iMbY = 0;
606606 sDqLayer.iMbXyIndex = 0;
607− sDqLayer.sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.pSps->uiTotalMbCount = rand() % 256;
607+ sDqLayer.sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.pSps->uiTotalMbCount = 1 + rand() % 256;
608608 sDqLayer.sLayerInfo.sSliceInLayer.iTotalMbInCurSlice =
609609 sDqLayer.sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.pSps->uiTotalMbCount + rand() % 256;
610610 sDqLayer.iMbWidth = 1 + rand() % 128;
611611 WelsDeblockingFilterSlice (&sCtx, pDeblockMb);
612− EXPECT_TRUE ((sDqLayer.iMbXyIndex + 1) ==
612+ EXPECT_TRUE ((uint32_t) (sDqLayer.iMbXyIndex + 1) ==
613613 sDqLayer.sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.pSps->uiTotalMbCount);
614614
615615 // (4) Special case, uiDisableDeblockingFilterIdc==1, disable deblocking
616616 sDqLayer.iMbX = sDqLayer.iMbY = 0;
617617 sDqLayer.iMbXyIndex = 0;
618618 sDqLayer.sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.uiDisableDeblockingFilterIdc = 1;
619− sDqLayer.sLayerInfo.sSliceInLayer.iTotalMbInCurSlice = rand() % 256;
619+ sDqLayer.sLayerInfo.sSliceInLayer.iTotalMbInCurSlice = 1 + rand() % 256;
620620 sDqLayer.sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.pSps->uiTotalMbCount =
621621 sDqLayer.sLayerInfo.sSliceInLayer.iTotalMbInCurSlice;
622622 sDqLayer.iMbWidth = 1 + rand() % 128;
@@ -796,20 +796,20 @@ TEST (DecoderDeblocking, DeblockingBsMarginalMBAvcbase) { · 173 unmodified lines
796796 UT_DB_CLEAN_STATUS
797797 iNoZeroCount[0 * 24 + iCurrBlock] = 1; // Current MB_block position
798798 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1,
799− 0) == (2 << (iPos * 8))) << iEdge << " " << iPos << " NoZeroCount!=0";
799+ 0) == (2u << (iPos * 8))) << iEdge << " " << iPos << " NoZeroCount!=0";
800800
801801 // (2) iEdge == 0, neighbor block NoZeroCount != 0
802802 UT_DB_CLEAN_STATUS
803803 iNoZeroCount[1 * 24 + iNeighborBlock ] = 1; // Neighbor MB_block position
804804 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1,
805− 0) == (2 << (iPos * 8))) << iEdge << " " << iPos << " NoZeroCount!=0";
805+ 0) == (2u << (iPos * 8))) << iEdge << " " << iPos << " NoZeroCount!=0";
806806
807807 // (3) iEdge == 0, reference idx diff
808808 UT_DB_CLEAN_STATUS
809809 iLayerRefIndex[0][0 * 16 + iCurrBlock] = 0;
810810 iLayerRefIndex[0][1 * 16 + iNeighborBlock] = 1;
811811 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1,
812− 0) == (1 << (iPos * 8))) << iEdge << " " << iPos << " Ref idx diff";
812+ 0) == (1u << (iPos * 8))) << iEdge << " " << iPos << " Ref idx diff";
813813
814814 // (4) iEdge == 0, abs(mv diff) < 4
815815 UT_DB_CLEAN_STATUS
@@ -832,34 +832,34 @@ TEST (DecoderDeblocking, DeblockingBsMarginalMBAvcbase) { · 16 unmodified lines
832832 UT_DB_CLEAN_STATUS
833833 iLayerMv[0][0 * 16 + iCurrBlock][0] = 4;
834834 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1,
835− 0) == (1 << (iPos * 8))) << iEdge << " " << iPos << " diff_mv == 4";
835+ 0) == (1u << (iPos * 8))) << iEdge << " " << iPos << " diff_mv == 4";
836836
837837 UT_DB_CLEAN_STATUS
838838 iLayerMv[0][0 * 16 + iCurrBlock][1] = 4;
839839 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1,
840− 0) == (1 << (iPos * 8))) << iEdge << " " << iPos << " diff_mv == 4";
840+ 0) == (1u << (iPos * 8))) << iEdge << " " << iPos << " diff_mv == 4";
841841
842842 UT_DB_CLEAN_STATUS
843843 iLayerMv[0][1 * 16 + iNeighborBlock][0] = 4;
844844 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1,
845− 0) == (1 << (iPos * 8))) << iEdge << " " << iPos << " diff_mv == 4";
845+ 0) == (1u << (iPos * 8))) << iEdge << " " << iPos << " diff_mv == 4";
846846
847847 UT_DB_CLEAN_STATUS
848848 iLayerMv[0][1 * 16 + iNeighborBlock][1] = 4;
849849 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1,
850− 0) == (1 << (iPos * 8))) << iEdge << " " << iPos << " diff_mv == 4";
850+ 0) == (1u << (iPos * 8))) << iEdge << " " << iPos << " diff_mv == 4";
851851
852852 UT_DB_CLEAN_STATUS
853853 iLayerMv[0][0 * 16 + iCurrBlock][0] = -2048;
854854 iLayerMv[0][1 * 16 + iNeighborBlock][0] = 2047;
855855 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1,
856− 0) == (1 << (iPos * 8))) << iEdge << " " << iPos << " diff_mv == maximum";
856+ 0) == (1u << (iPos * 8))) << iEdge << " " << iPos << " diff_mv == maximum";
857857
858858 UT_DB_CLEAN_STATUS
859859 iLayerMv[0][0 * 16 + iCurrBlock][1] = -2048;
860860 iLayerMv[0][1 * 16 + iNeighborBlock][1] = 2047;
861861 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1,
862− 0) == (1 << (iPos * 8))) << iEdge << " " << iPos << " diff_mv == maximum";
862+ 0) == (1u << (iPos * 8))) << iEdge << " " << iPos << " diff_mv == maximum";
863863 }
864864 }
865865 }
@@ -951,4 +951,4 @@ TEST (Deblocking, WelsDeblockingMb) { · 85 unmodified lines
951951 iQP = rand() % 16;
952952 sDqLayer.pMbType[1] = 0x04;
953953 UT_DB_MACROBLOCK_TEST (0x03, iQP, 0, 0, 0, 0, 0, 0)
954−}
954+}

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