History

deblocking: Disambiguate reference pictures

Macroblocks can refer to the same reference picture using different indices when the same picture appears in multiple slots in the current reference picture lists. That leads to calculating the wrong loop filter strength for edge processing, and small errors in the conformance suite on (for example) CVWP5_TOSHIBA_E.264 and others. Modify the test-suite and checksums for affected test files where this situation occurs.

Jan Schmidt committed 7 years ago

Commit 398da801 parent 579a5bc5 files · +197 −137Browse files

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

Unified · Split

test/decoder/DecUT_DeblockCommon.cpp+26−14
@@ -776,9 +776,11 @@ TEST (DecoderDeblocking, FilteringEdgeLumaHV) { · 775 unmodified lines
776776
777777 /////////// Bs calculation functions
778778 TEST (DecoderDeblocking, DeblockingBsMarginalMBAvcbase) {
779− // uint32_t DeblockingBsMarginalMBAvcbase (PDqLayer pCurDqLayer, int32_t iEdge, int32_t iNeighMb, int32_t iMbXy)
779+ // uint32_t DeblockingBsMarginalMBAvcbase (PDeblockingFilter pFilter, PDqLayer pCurDqLayer, int32_t iEdge, int32_t iNeighMb, int32_t iMbXy)
780780 /* Calculate the Bs equal to 2 or 1 */
781781 SDqLayer sDqLayer;
782+ SDeblockingFilter sFilter;
783+ int i;
782784
783785 // Only define 2 MBs here
784786 int8_t iNoZeroCount[24 * 2]; // (*pNzc)[24]
@@ -787,6 +789,8 @@ TEST (DecoderDeblocking, DeblockingBsMarginalMBAvcbase) { · 2 unmodified lines
787789 uint32_t uiBSx4;
788790 uint8_t* pBS = (uint8_t*) (&uiBSx4);
789791
792+ PPicture iFilterPics[2][MAX_DPB_COUNT]; // Dummy reference pictures list
793+
790794 sDqLayer.pNzc = (int8_t (*)[24])iNoZeroCount;
791795 sDqLayer.pRefIndex[0] = (int8_t (*)[16])&iLayerRefIndex[0];
792796 sDqLayer.pRefIndex[1] = (int8_t (*)[16])&iLayerRefIndex[1];
@@ -797,6 +801,13 @@ TEST (DecoderDeblocking, DeblockingBsMarginalMBAvcbase) { · 4 unmodified lines
797801 bool bTSize8x8Flag[50] = {false};
798802 sDqLayer.pTransformSize8x8Flag = bTSize8x8Flag;
799803 memset (bTSize8x8Flag, 0, sizeof (bool) * 50);
804+ // Dummy picture list pointers to 1..MAX_DPB_COUNT
805+ // the pointer values don't need to be valid, just different
806+ for (i = 0; i < MAX_DPB_COUNT; i++)
807+ iFilterPics[0][i] = iFilterPics[1][i] = (PPicture)(iFilterPics + (i<<3));
808+
809+ sFilter.pRefPics[0] = iFilterPics[0];
810+ sFilter.pRefPics[1] = iFilterPics[1];
800811
801812 #define UT_DB_CLEAN_STATUS \
802813 memset(iNoZeroCount, 0, sizeof(int8_t)*24*2); \
@@ -819,14 +830,14 @@ TEST (DecoderDeblocking, DeblockingBsMarginalMBAvcbase) { · 16 unmodified lines
819830 UT_DB_CLEAN_STATUS
820831 iNoZeroCount[0 * 24 + iCurrBlock] = 1; // Current MB_block position
821832 SET_REF_VALUE(2, iPos);
822− EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1,
833+ EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
823834 0) == uiBSx4) << iEdge << " " << iPos << " NoZeroCount!=0";
824835
825836 // (2) iEdge == 0, neighbor block NoZeroCount != 0
826837 UT_DB_CLEAN_STATUS
827838 iNoZeroCount[1 * 24 + iNeighborBlock ] = 1; // Neighbor MB_block position
828839 SET_REF_VALUE(2, iPos);
829− EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1,
840+ EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
830841 0) == uiBSx4) << iEdge << " " << iPos << " NoZeroCount!=0";
831842
832843 // (3) iEdge == 0, reference idx diff
@@ -834,63 +845,63 @@ TEST (DecoderDeblocking, DeblockingBsMarginalMBAvcbase) { · 1 unmodified line
834845 iLayerRefIndex[0][0 * 16 + iCurrBlock] = 0;
835846 iLayerRefIndex[0][1 * 16 + iNeighborBlock] = 1;
836847 SET_REF_VALUE(1, iPos);
837− EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1,
848+ EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
838849 0) == uiBSx4) << iEdge << " " << iPos << " Ref idx diff";
839850
840851 // (4) iEdge == 0, abs(mv diff) < 4
841852 UT_DB_CLEAN_STATUS
842853 iLayerMv[0][0 * 16 + iCurrBlock][0] = rand() % 4;
843− EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1, 0) == 0) << iEdge << " " << iPos << " diff_mv < 4";
854+ EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1, 0) == 0) << iEdge << " " << iPos << " diff_mv < 4";
844855
845856 UT_DB_CLEAN_STATUS
846857 iLayerMv[0][0 * 16 + iCurrBlock][1] = rand() % 4;
847− EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1, 0) == 0) << iEdge << " " << iPos << " diff_mv < 4";
858+ EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1, 0) == 0) << iEdge << " " << iPos << " diff_mv < 4";
848859
849860 UT_DB_CLEAN_STATUS
850861 iLayerMv[0][1 * 16 + iNeighborBlock][0] = rand() % 4;
851− EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1, 0) == 0) << iEdge << " " << iPos << " diff_mv < 4";
862+ EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1, 0) == 0) << iEdge << " " << iPos << " diff_mv < 4";
852863
853864 UT_DB_CLEAN_STATUS
854865 iLayerMv[0][1 * 16 + iNeighborBlock][1] = rand() % 4;
855− EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1, 0) == 0) << iEdge << " " << iPos << " diff_mv < 4";
866+ EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1, 0) == 0) << iEdge << " " << iPos << " diff_mv < 4";
856867
857868 // (5) iEdge == 0, abs(mv diff) > 4
858869 UT_DB_CLEAN_STATUS
859870 iLayerMv[0][0 * 16 + iCurrBlock][0] = 4;
860871 SET_REF_VALUE(1, iPos);
861− EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1,
872+ EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
862873 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == 4";
863874
864875 UT_DB_CLEAN_STATUS
865876 iLayerMv[0][0 * 16 + iCurrBlock][1] = 4;
866877 SET_REF_VALUE(1, iPos);
867− EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1,
878+ EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
868879 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == 4";
869880
870881 UT_DB_CLEAN_STATUS
871882 iLayerMv[0][1 * 16 + iNeighborBlock][0] = 4;
872883 SET_REF_VALUE(1, iPos);
873− EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1,
884+ EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
874885 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == 4";
875886
876887 UT_DB_CLEAN_STATUS
877888 iLayerMv[0][1 * 16 + iNeighborBlock][1] = 4;
878889 SET_REF_VALUE(1, iPos);
879− EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1,
890+ EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
880891 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == 4";
881892
882893 UT_DB_CLEAN_STATUS
883894 iLayerMv[0][0 * 16 + iCurrBlock][0] = -2048;
884895 iLayerMv[0][1 * 16 + iNeighborBlock][0] = 2047;
885896 SET_REF_VALUE(1, iPos);
886− EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1,
897+ EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
887898 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == maximum";
888899
889900 UT_DB_CLEAN_STATUS
890901 iLayerMv[0][0 * 16 + iCurrBlock][1] = -2048;
891902 iLayerMv[0][1 * 16 + iNeighborBlock][1] = 2047;
892903 SET_REF_VALUE(1, iPos);
893− EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1,
904+ EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
894905 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == maximum";
895906 }
896907 }
@@ -913,6 +924,7 @@ TEST (Deblocking, WelsDeblockingMb) { · 16 unmodified lines
913924 sFilter.pLoopf->pfLumaDeblockingEQ4Hor = &UT_DeblockingFuncLumaEQ4Func;
914925 sFilter.pLoopf->pfLumaDeblockingLT4Ver = &UT_DeblockingFuncLumaLT4Func;
915926 sFilter.pLoopf->pfLumaDeblockingEQ4Ver = &UT_DeblockingFuncLumaEQ4Func;
927+ sFilter.pRefPics[0] = sFilter.pRefPics[1] = NULL; // Don't need Ref pics for intra tests
916928
917929 sDqLayer.iMbX = sDqLayer.iMbY = 0;
918930 sDqLayer.iMbXyIndex = 1;

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