The function actually was correct for big-endian use already (and the changes in 239e22d0 actually broke normal decoding tests), it was only the test function itself that needed fixing for big-endian.
Showing the changes to test/decoder/DecUT_DeblockCommon.cpp (1 of 2 files). Show all
Unified · Split
| @@ -773,6 +773,8 @@ TEST (DecoderDeblocking, DeblockingBsMarginalMBAvcbase) { · 772 unmodified lines | ||
| 773 | 773 | int8_t iNoZeroCount[24 * 2]; // (*pNzc)[24] |
| 774 | 774 | int8_t iLayerRefIndex[2][16 * 2]; // (*pRefIndex[LIST_A])[MB_BLOCK4x4_NUM]; |
| 775 | 775 | int16_t iLayerMv[2][16 * 2][2]; //(*pMv[LIST_A])[MB_BLOCK4x4_NUM][MV_A]; |
| 776 | + uint32_t uiBSx4; | |
| 777 | + uint8_t* pBS = (uint8_t*) (&uiBSx4); | |
| 776 | 778 | |
| 777 | 779 | sDqLayer.pNzc = (int8_t (*)[24])iNoZeroCount; |
| 778 | 780 | sDqLayer.pRefIndex[0] = (int8_t (*)[16])&iLayerRefIndex[0]; |
| @@ -790,6 +792,10 @@ TEST (DecoderDeblocking, DeblockingBsMarginalMBAvcbase) { · 11 unmodified lines | ||
| 790 | 792 | memset(iLayerRefIndex, 0, sizeof(int8_t)*2*16*2); \ |
| 791 | 793 | memset(iLayerMv, 0, sizeof(int16_t)*2*16*2*2); |
| 792 | 794 | |
| 795 | +#define SET_REF_VALUE(value, pos) \ | |
| 796 | + uiBSx4 = 0; \ | |
| 797 | + pBS[pos] = value; | |
| 798 | + | |
| 793 | 799 | int32_t iCurrBlock, iNeighborBlock; |
| 794 | 800 | |
| 795 | 801 | /* Cycle for each block and its neighboring block */ |
| @@ -801,21 +807,24 @@ TEST (DecoderDeblocking, DeblockingBsMarginalMBAvcbase) { · 5 unmodified lines | ||
| 801 | 807 | // (1) iEdge == 0, current block NoZeroCount != 0 |
| 802 | 808 | UT_DB_CLEAN_STATUS |
| 803 | 809 | iNoZeroCount[0 * 24 + iCurrBlock] = 1; // Current MB_block position |
| 810 | + SET_REF_VALUE(2, iPos); | |
| 804 | 811 | EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1, |
| 805 | − 0) == (2u << (iPos * 8))) << iEdge << " " << iPos << " NoZeroCount!=0"; | |
| 812 | + 0) == uiBSx4) << iEdge << " " << iPos << " NoZeroCount!=0"; | |
| 806 | 813 | |
| 807 | 814 | // (2) iEdge == 0, neighbor block NoZeroCount != 0 |
| 808 | 815 | UT_DB_CLEAN_STATUS |
| 809 | 816 | iNoZeroCount[1 * 24 + iNeighborBlock ] = 1; // Neighbor MB_block position |
| 817 | + SET_REF_VALUE(2, iPos); | |
| 810 | 818 | EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1, |
| 811 | − 0) == (2u << (iPos * 8))) << iEdge << " " << iPos << " NoZeroCount!=0"; | |
| 819 | + 0) == uiBSx4) << iEdge << " " << iPos << " NoZeroCount!=0"; | |
| 812 | 820 | |
| 813 | 821 | // (3) iEdge == 0, reference idx diff |
| 814 | 822 | UT_DB_CLEAN_STATUS |
| 815 | 823 | iLayerRefIndex[0][0 * 16 + iCurrBlock] = 0; |
| 816 | 824 | iLayerRefIndex[0][1 * 16 + iNeighborBlock] = 1; |
| 825 | + SET_REF_VALUE(1, iPos); | |
| 817 | 826 | EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1, |
| 818 | − 0) == (1u << (iPos * 8))) << iEdge << " " << iPos << " Ref idx diff"; | |
| 827 | + 0) == uiBSx4) << iEdge << " " << iPos << " Ref idx diff"; | |
| 819 | 828 | |
| 820 | 829 | // (4) iEdge == 0, abs(mv diff) < 4 |
| 821 | 830 | UT_DB_CLEAN_STATUS |
| @@ -837,35 +846,41 @@ TEST (DecoderDeblocking, DeblockingBsMarginalMBAvcbase) { · 15 unmodified lines | ||
| 837 | 846 | // (5) iEdge == 0, abs(mv diff) > 4 |
| 838 | 847 | UT_DB_CLEAN_STATUS |
| 839 | 848 | iLayerMv[0][0 * 16 + iCurrBlock][0] = 4; |
| 849 | + SET_REF_VALUE(1, iPos); | |
| 840 | 850 | EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1, |
| 841 | − 0) == (1u << (iPos * 8))) << iEdge << " " << iPos << " diff_mv == 4"; | |
| 851 | + 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == 4"; | |
| 842 | 852 | |
| 843 | 853 | UT_DB_CLEAN_STATUS |
| 844 | 854 | iLayerMv[0][0 * 16 + iCurrBlock][1] = 4; |
| 855 | + SET_REF_VALUE(1, iPos); | |
| 845 | 856 | EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1, |
| 846 | − 0) == (1u << (iPos * 8))) << iEdge << " " << iPos << " diff_mv == 4"; | |
| 857 | + 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == 4"; | |
| 847 | 858 | |
| 848 | 859 | UT_DB_CLEAN_STATUS |
| 849 | 860 | iLayerMv[0][1 * 16 + iNeighborBlock][0] = 4; |
| 861 | + SET_REF_VALUE(1, iPos); | |
| 850 | 862 | EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1, |
| 851 | − 0) == (1u << (iPos * 8))) << iEdge << " " << iPos << " diff_mv == 4"; | |
| 863 | + 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == 4"; | |
| 852 | 864 | |
| 853 | 865 | UT_DB_CLEAN_STATUS |
| 854 | 866 | iLayerMv[0][1 * 16 + iNeighborBlock][1] = 4; |
| 867 | + SET_REF_VALUE(1, iPos); | |
| 855 | 868 | EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1, |
| 856 | − 0) == (1u << (iPos * 8))) << iEdge << " " << iPos << " diff_mv == 4"; | |
| 869 | + 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == 4"; | |
| 857 | 870 | |
| 858 | 871 | UT_DB_CLEAN_STATUS |
| 859 | 872 | iLayerMv[0][0 * 16 + iCurrBlock][0] = -2048; |
| 860 | 873 | iLayerMv[0][1 * 16 + iNeighborBlock][0] = 2047; |
| 874 | + SET_REF_VALUE(1, iPos); | |
| 861 | 875 | EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1, |
| 862 | − 0) == (1u << (iPos * 8))) << iEdge << " " << iPos << " diff_mv == maximum"; | |
| 876 | + 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == maximum"; | |
| 863 | 877 | |
| 864 | 878 | UT_DB_CLEAN_STATUS |
| 865 | 879 | iLayerMv[0][0 * 16 + iCurrBlock][1] = -2048; |
| 866 | 880 | iLayerMv[0][1 * 16 + iNeighborBlock][1] = 2047; |
| 881 | + SET_REF_VALUE(1, iPos); | |
| 867 | 882 | EXPECT_TRUE (DeblockingBsMarginalMBAvcbase (&sDqLayer, iEdge, 1, |
| 868 | − 0) == (1u << (iPos * 8))) << iEdge << " " << iPos << " diff_mv == maximum"; | |
| 883 | + 0) == uiBSx4) << iEdge << " " << iPos << " diff_mv == maximum"; | |
| 869 | 884 | } |
| 870 | 885 | } |
| 871 | 886 | } |