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_DeblockCommon.cpp (1 of 29 files). Show all

Unified · Split

test/decoder/DecUT_DeblockCommon.cpp+20−16
@@ -804,11 +804,11 @@ TEST (DecoderDeblocking, DeblockingBsMarginalMBAvcbase) { · 803 unmodified lines
804 // Dummy picture list pointers to 1..MAX_DPB_COUNT804 // Dummy picture list pointers to 1..MAX_DPB_COUNT
805 // the pointer values don't need to be valid, just different805 // the pointer values don't need to be valid, just different
806 for (i = 0; i < MAX_DPB_COUNT; i++)806 for (i = 0; i < MAX_DPB_COUNT; i++)
807 iFilterPics[0][i] = iFilterPics[1][i] = (PPicture)(iFilterPics + (i<<3));807 iFilterPics[0][i] = iFilterPics[1][i] = (PPicture) (iFilterPics + (i << 3));
808 808
809 sFilter.pRefPics[0] = iFilterPics[0];809 sFilter.pRefPics[0] = iFilterPics[0];
810 sFilter.pRefPics[1] = iFilterPics[1];810 sFilter.pRefPics[1] = iFilterPics[1];
811 811 sDqLayer.pDec = NULL;
812#define UT_DB_CLEAN_STATUS \812#define UT_DB_CLEAN_STATUS \
813 memset(iNoZeroCount, 0, sizeof(int8_t)*24*2); \813 memset(iNoZeroCount, 0, sizeof(int8_t)*24*2); \
814 memset(iLayerRefIndex, 0, sizeof(int8_t)*2*16*2); \814 memset(iLayerRefIndex, 0, sizeof(int8_t)*2*16*2); \
@@ -829,14 +829,14 @@ TEST (DecoderDeblocking, DeblockingBsMarginalMBAvcbase) { · 14 unmodified lines
829 // (1) iEdge == 0, current block NoZeroCount != 0829 // (1) iEdge == 0, current block NoZeroCount != 0
830 UT_DB_CLEAN_STATUS830 UT_DB_CLEAN_STATUS
831 iNoZeroCount[0 * 24 + iCurrBlock] = 1; // Current MB_block position831 iNoZeroCount[0 * 24 + iCurrBlock] = 1; // Current MB_block position
832 SET_REF_VALUE(2, iPos);832 SET_REF_VALUE (2, iPos);
833 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,833 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
834 0) == uiBSx4) << iEdge << " " << iPos << " NoZeroCount!=0";834 0) == uiBSx4) << iEdge << " " << iPos << " NoZeroCount!=0";
835 835
836 // (2) iEdge == 0, neighbor block NoZeroCount != 0836 // (2) iEdge == 0, neighbor block NoZeroCount != 0
837 UT_DB_CLEAN_STATUS837 UT_DB_CLEAN_STATUS
838 iNoZeroCount[1 * 24 + iNeighborBlock ] = 1; // Neighbor MB_block position838 iNoZeroCount[1 * 24 + iNeighborBlock ] = 1; // Neighbor MB_block position
839 SET_REF_VALUE(2, iPos);839 SET_REF_VALUE (2, iPos);
840 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,840 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
841 0) == uiBSx4) << iEdge << " " << iPos << " NoZeroCount!=0";841 0) == uiBSx4) << iEdge << " " << iPos << " NoZeroCount!=0";
842 842
@@ -844,63 +844,67 @@ TEST (DecoderDeblocking, DeblockingBsMarginalMBAvcbase) { · 1 unmodified line
844 UT_DB_CLEAN_STATUS844 UT_DB_CLEAN_STATUS
845 iLayerRefIndex[0][0 * 16 + iCurrBlock] = 0;845 iLayerRefIndex[0][0 * 16 + iCurrBlock] = 0;
846 iLayerRefIndex[0][1 * 16 + iNeighborBlock] = 1;846 iLayerRefIndex[0][1 * 16 + iNeighborBlock] = 1;
847 SET_REF_VALUE(1, iPos);847 SET_REF_VALUE (1, iPos);
848 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,848 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
849 0) == uiBSx4) << iEdge << " " << iPos << " Ref idx diff";849 0) == uiBSx4) << iEdge << " " << iPos << " Ref idx diff";
850 850
851 // (4) iEdge == 0, abs(mv diff) < 4851 // (4) iEdge == 0, abs(mv diff) < 4
852 UT_DB_CLEAN_STATUS852 UT_DB_CLEAN_STATUS
853 iLayerMv[0][0 * 16 + iCurrBlock][0] = rand() % 4;853 iLayerMv[0][0 * 16 + iCurrBlock][0] = rand() % 4;
854 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1, 0) == 0) << iEdge << " " << iPos << " diff_mv < 4";854 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
855 0) == 0) << iEdge << " " << iPos << " diff_mv < 4";
855 856
856 UT_DB_CLEAN_STATUS857 UT_DB_CLEAN_STATUS
857 iLayerMv[0][0 * 16 + iCurrBlock][1] = rand() % 4;858 iLayerMv[0][0 * 16 + iCurrBlock][1] = rand() % 4;
858 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1, 0) == 0) << iEdge << " " << iPos << " diff_mv < 4";859 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
860 0) == 0) << iEdge << " " << iPos << " diff_mv < 4";
859 861
860 UT_DB_CLEAN_STATUS862 UT_DB_CLEAN_STATUS
861 iLayerMv[0][1 * 16 + iNeighborBlock][0] = rand() % 4;863 iLayerMv[0][1 * 16 + iNeighborBlock][0] = rand() % 4;
862 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1, 0) == 0) << iEdge << " " << iPos << " diff_mv < 4";864 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
865 0) == 0) << iEdge << " " << iPos << " diff_mv < 4";
863 866
864 UT_DB_CLEAN_STATUS867 UT_DB_CLEAN_STATUS
865 iLayerMv[0][1 * 16 + iNeighborBlock][1] = rand() % 4;868 iLayerMv[0][1 * 16 + iNeighborBlock][1] = rand() % 4;
866 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1, 0) == 0) << iEdge << " " << iPos << " diff_mv < 4";869 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
870 0) == 0) << iEdge << " " << iPos << " diff_mv < 4";
867 871
868 // (5) iEdge == 0, abs(mv diff) > 4872 // (5) iEdge == 0, abs(mv diff) > 4
869 UT_DB_CLEAN_STATUS873 UT_DB_CLEAN_STATUS
870 iLayerMv[0][0 * 16 + iCurrBlock][0] = 4;874 iLayerMv[0][0 * 16 + iCurrBlock][0] = 4;
871 SET_REF_VALUE(1, iPos);875 SET_REF_VALUE (1, iPos);
872 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,876 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
873 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == 4";877 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == 4";
874 878
875 UT_DB_CLEAN_STATUS879 UT_DB_CLEAN_STATUS
876 iLayerMv[0][0 * 16 + iCurrBlock][1] = 4;880 iLayerMv[0][0 * 16 + iCurrBlock][1] = 4;
877 SET_REF_VALUE(1, iPos);881 SET_REF_VALUE (1, iPos);
878 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,882 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
879 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == 4";883 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == 4";
880 884
881 UT_DB_CLEAN_STATUS885 UT_DB_CLEAN_STATUS
882 iLayerMv[0][1 * 16 + iNeighborBlock][0] = 4;886 iLayerMv[0][1 * 16 + iNeighborBlock][0] = 4;
883 SET_REF_VALUE(1, iPos);887 SET_REF_VALUE (1, iPos);
884 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,888 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
885 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == 4";889 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == 4";
886 890
887 UT_DB_CLEAN_STATUS891 UT_DB_CLEAN_STATUS
888 iLayerMv[0][1 * 16 + iNeighborBlock][1] = 4;892 iLayerMv[0][1 * 16 + iNeighborBlock][1] = 4;
889 SET_REF_VALUE(1, iPos);893 SET_REF_VALUE (1, iPos);
890 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,894 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
891 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == 4";895 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == 4";
892 896
893 UT_DB_CLEAN_STATUS897 UT_DB_CLEAN_STATUS
894 iLayerMv[0][0 * 16 + iCurrBlock][0] = -2048;898 iLayerMv[0][0 * 16 + iCurrBlock][0] = -2048;
895 iLayerMv[0][1 * 16 + iNeighborBlock][0] = 2047;899 iLayerMv[0][1 * 16 + iNeighborBlock][0] = 2047;
896 SET_REF_VALUE(1, iPos);900 SET_REF_VALUE (1, iPos);
897 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,901 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
898 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == maximum";902 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == maximum";
899 903
900 UT_DB_CLEAN_STATUS904 UT_DB_CLEAN_STATUS
901 iLayerMv[0][0 * 16 + iCurrBlock][1] = -2048;905 iLayerMv[0][0 * 16 + iCurrBlock][1] = -2048;
902 iLayerMv[0][1 * 16 + iNeighborBlock][1] = 2047;906 iLayerMv[0][1 * 16 + iNeighborBlock][1] = 2047;
903 SET_REF_VALUE(1, iPos);907 SET_REF_VALUE (1, iPos);
904 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,908 EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sFilter, &sDqLayer, iEdge, 1,
905 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == maximum";909 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == maximum";
906 }910 }
@@ -912,7 +916,7 @@ TEST (Deblocking, WelsDeblockingMb) { · 5 unmodified lines
912 /* Deblock one MB, calculate the Bs inside the function, only consider the intra / intra block */916 /* Deblock one MB, calculate the Bs inside the function, only consider the intra / intra block */
913 SDqLayer sDqLayer;917 SDqLayer sDqLayer;
914 sDqLayer.sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.eSliceType = P_SLICE;918 sDqLayer.sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.eSliceType = P_SLICE;
915 919 sDqLayer.pDec = NULL;
916 SDeblockingFilter sFilter;920 SDeblockingFilter sFilter;
917 SDeblockingFunc sDBFunc;921 SDeblockingFunc sDBFunc;
918 sFilter.pLoopf = &sDBFunc;922 sFilter.pLoopf = &sDBFunc;

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