Bundle MC tests for all motion vectors in one single test

This speeds up the compile time from 21.3 to 2.6 seconds
for the MC test files.

This makes it slightly harder to see exactly which test
failed on a quick glance, but it makes the overall structure of
the unit test output more manageable and readable, by reducing
the number of tests from 1300 to 430.
This commit is contained in:
Martin Storsjö 2015-01-26 15:13:25 +02:00
parent ca97f78ae8
commit 10e2f90b7e
3 changed files with 51 additions and 142 deletions

View File

@ -9,36 +9,31 @@ using namespace WelsDec;
#define CHROMA_FUNC sMcFunc.pMcChromaFunc
#define PREFIX
#define DEF_MCCOPYTESTS(pfx) \
DEF_MCCOPYTEST (pfx, 2, 2, 1) \
DEF_MCCOPYTEST (pfx, 2, 4, 1) \
DEF_MCCOPYTEST (pfx, 4, 2, 0) \
DEF_MCCOPYTEST (pfx, 4, 4, 0) \
DEF_MCCOPYTEST (pfx, 4, 8, 0) \
DEF_MCCOPYTEST (pfx, 8, 4, 0) \
DEF_MCCOPYTEST (pfx, 8, 8, 0) \
DEF_MCCOPYTEST (pfx, 16, 8, 0) \
DEF_MCCOPYTEST (pfx, 8, 16, 0) \
DEF_MCCOPYTEST (pfx, 16, 16, 0)
#define DEF_LUMA_MCTEST(pfx,a,b) \
DEF_LUMA_MCTEST_SUBCASE(pfx,a,b,4,4) \
DEF_LUMA_MCTEST_SUBCASE(pfx,a,b,4,8) \
DEF_LUMA_MCTEST_SUBCASE(pfx,a,b,8,4) \
DEF_LUMA_MCTEST_SUBCASE(pfx,a,b,8,8) \
DEF_LUMA_MCTEST_SUBCASE(pfx,a,b,16,8) \
DEF_LUMA_MCTEST_SUBCASE(pfx,a,b,8,16) \
DEF_LUMA_MCTEST_SUBCASE(pfx,a,b,16,16)
#define DEF_CHROMA_MCTEST(pfx,a,b) \
DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,2,2) \
DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,2,4) \
DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,4,2) \
DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,4,4) \
DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,4,8) \
DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,8,4) \
DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,8,8)
#include "mc_test_common.h"
DEF_MCCOPYTEST (, 2, 2, 1)
DEF_MCCOPYTEST (, 2, 4, 1)
DEF_MCCOPYTEST (, 4, 2, 0)
DEF_MCCOPYTEST (, 4, 4, 0)
DEF_MCCOPYTEST (, 4, 8, 0)
DEF_MCCOPYTEST (, 8, 4, 0)
DEF_MCCOPYTEST (, 8, 8, 0)
DEF_MCCOPYTEST (, 16, 8, 0)
DEF_MCCOPYTEST (, 8, 16, 0)
DEF_MCCOPYTEST (, 16, 16, 0)
DEF_LUMA_MCTEST (, 4, 4)
DEF_LUMA_MCTEST (, 4, 8)
DEF_LUMA_MCTEST (, 8, 4)
DEF_LUMA_MCTEST (, 8, 8)
DEF_LUMA_MCTEST (, 16, 8)
DEF_LUMA_MCTEST (, 8, 16)
DEF_LUMA_MCTEST (, 16, 16)
DEF_CHROMA_MCTEST (, 2, 2)
DEF_CHROMA_MCTEST (, 2, 4)
DEF_CHROMA_MCTEST (, 4, 2)
DEF_CHROMA_MCTEST (, 4, 4)
DEF_CHROMA_MCTEST (, 4, 8)
DEF_CHROMA_MCTEST (, 8, 4)
DEF_CHROMA_MCTEST (, 8, 8)

View File

@ -18,25 +18,20 @@ static void McLumaFunc (SMcFunc* pFuncs, const uint8_t* pSrc, int32_t iSrcStride
#define CHROMA_FUNC sMcFunc.pfChromaMc
#define PREFIX Enc
#define DEF_MCCOPYTESTS(pfx) \
DEF_MCCOPYTEST (pfx, 16, 8, 0) \
DEF_MCCOPYTEST (pfx, 16, 16, 0)
#define DEF_LUMA_MCTEST(pfx,a,b) \
DEF_LUMA_MCTEST_SUBCASE(pfx,a,b,16,8) \
DEF_LUMA_MCTEST_SUBCASE(pfx,a,b,16,16)
#define DEF_CHROMA_MCTEST(pfx,a,b) \
DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,4,2) \
DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,4,4) \
DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,4,8) \
DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,8,4) \
DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,8,8)
#include "mc_test_common.h"
DEF_MCCOPYTEST (Enc, 16, 8, 0)
DEF_MCCOPYTEST (Enc, 16, 16, 0)
DEF_LUMA_MCTEST (Enc, 16, 8)
DEF_LUMA_MCTEST (Enc, 16, 16)
DEF_CHROMA_MCTEST (Enc, 4, 2)
DEF_CHROMA_MCTEST (Enc, 4, 4)
DEF_CHROMA_MCTEST (Enc, 4, 8)
DEF_CHROMA_MCTEST (Enc, 8, 4)
DEF_CHROMA_MCTEST (Enc, 8, 8)
TEST (EncMcAvg, PixelAvg) {
SMcFunc sMcFunc;
for (int32_t k = 0; k < 2; k++) {

View File

@ -149,11 +149,11 @@ TEST(pfx##McCopy_c,iW##x##iH) \
}\
}
DEF_MCCOPYTESTS (PREFIX)
#define DEF_LUMA_MCTEST_SUBCASE(pfx,a,b,iW,iH) \
TEST(pfx##McHorVer##a##b##_c,iW##x##iH) \
#define DEF_LUMA_MCTEST(pfx,iW,iH) \
TEST(pfx##McHorVer,iW##x##iH) \
{ \
for (int32_t a = 0; a < 4; a++) { \
for (int32_t b = 0; b < 4; b++) { \
SMcFunc sMcFunc; \
uint8_t uSrcAnchor[4][MC_BUFF_HEIGHT][MC_BUFF_SRC_STRIDE]; \
uint8_t uSrcTest[MC_BUFF_HEIGHT][MC_BUFF_SRC_STRIDE]; \
@ -197,27 +197,15 @@ TEST(pfx##McHorVer##a##b##_c,iW##x##iH) \
} \
} \
}\
}\
}\
}
DEF_LUMA_MCTEST (PREFIX, 0, 1)
DEF_LUMA_MCTEST (PREFIX, 0, 2)
DEF_LUMA_MCTEST (PREFIX, 0, 3)
DEF_LUMA_MCTEST (PREFIX, 1, 0)
DEF_LUMA_MCTEST (PREFIX, 1, 1)
DEF_LUMA_MCTEST (PREFIX, 1, 2)
DEF_LUMA_MCTEST (PREFIX, 1, 3)
DEF_LUMA_MCTEST (PREFIX, 2, 0)
DEF_LUMA_MCTEST (PREFIX, 2, 1)
DEF_LUMA_MCTEST (PREFIX, 2, 2)
DEF_LUMA_MCTEST (PREFIX, 2, 3)
DEF_LUMA_MCTEST (PREFIX, 3, 0)
DEF_LUMA_MCTEST (PREFIX, 3, 1)
DEF_LUMA_MCTEST (PREFIX, 3, 2)
DEF_LUMA_MCTEST (PREFIX, 3, 3)
#define DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,iW,iH) \
TEST(pfx##McChromaWithFragMv_##a##b##_c,iW##x##iH) \
#define DEF_CHROMA_MCTEST(pfx,iW,iH) \
TEST(pfx##McChroma,iW##x##iH) \
{ \
for (int32_t a = 0; a < 8; a++) { \
for (int32_t b = 0; b < 8; b++) { \
SMcFunc sMcFunc; \
uint8_t uSrcAnchor[MC_BUFF_HEIGHT][MC_BUFF_SRC_STRIDE*2]; \
uint8_t uSrcTest[MC_BUFF_HEIGHT][MC_BUFF_SRC_STRIDE]; \
@ -256,75 +244,6 @@ TEST(pfx##McChromaWithFragMv_##a##b##_c,iW##x##iH) \
} \
} \
}\
}\
}\
}
DEF_CHROMA_MCTEST (PREFIX, 0, 1)
DEF_CHROMA_MCTEST (PREFIX, 0, 2)
DEF_CHROMA_MCTEST (PREFIX, 0, 3)
DEF_CHROMA_MCTEST (PREFIX, 0, 4)
DEF_CHROMA_MCTEST (PREFIX, 0, 5)
DEF_CHROMA_MCTEST (PREFIX, 0, 6)
DEF_CHROMA_MCTEST (PREFIX, 0, 7)
DEF_CHROMA_MCTEST (PREFIX, 1, 0)
DEF_CHROMA_MCTEST (PREFIX, 1, 1)
DEF_CHROMA_MCTEST (PREFIX, 1, 2)
DEF_CHROMA_MCTEST (PREFIX, 1, 3)
DEF_CHROMA_MCTEST (PREFIX, 1, 4)
DEF_CHROMA_MCTEST (PREFIX, 1, 5)
DEF_CHROMA_MCTEST (PREFIX, 1, 6)
DEF_CHROMA_MCTEST (PREFIX, 1, 7)
DEF_CHROMA_MCTEST (PREFIX, 2, 0)
DEF_CHROMA_MCTEST (PREFIX, 2, 1)
DEF_CHROMA_MCTEST (PREFIX, 2, 2)
DEF_CHROMA_MCTEST (PREFIX, 2, 3)
DEF_CHROMA_MCTEST (PREFIX, 2, 4)
DEF_CHROMA_MCTEST (PREFIX, 2, 5)
DEF_CHROMA_MCTEST (PREFIX, 2, 6)
DEF_CHROMA_MCTEST (PREFIX, 2, 7)
DEF_CHROMA_MCTEST (PREFIX, 3, 0)
DEF_CHROMA_MCTEST (PREFIX, 3, 1)
DEF_CHROMA_MCTEST (PREFIX, 3, 2)
DEF_CHROMA_MCTEST (PREFIX, 3, 3)
DEF_CHROMA_MCTEST (PREFIX, 3, 4)
DEF_CHROMA_MCTEST (PREFIX, 3, 5)
DEF_CHROMA_MCTEST (PREFIX, 3, 6)
DEF_CHROMA_MCTEST (PREFIX, 3, 7)
DEF_CHROMA_MCTEST (PREFIX, 4, 0)
DEF_CHROMA_MCTEST (PREFIX, 4, 1)
DEF_CHROMA_MCTEST (PREFIX, 4, 2)
DEF_CHROMA_MCTEST (PREFIX, 4, 3)
DEF_CHROMA_MCTEST (PREFIX, 4, 4)
DEF_CHROMA_MCTEST (PREFIX, 4, 5)
DEF_CHROMA_MCTEST (PREFIX, 4, 6)
DEF_CHROMA_MCTEST (PREFIX, 4, 7)
DEF_CHROMA_MCTEST (PREFIX, 5, 0)
DEF_CHROMA_MCTEST (PREFIX, 5, 1)
DEF_CHROMA_MCTEST (PREFIX, 5, 2)
DEF_CHROMA_MCTEST (PREFIX, 5, 3)
DEF_CHROMA_MCTEST (PREFIX, 5, 4)
DEF_CHROMA_MCTEST (PREFIX, 5, 5)
DEF_CHROMA_MCTEST (PREFIX, 5, 6)
DEF_CHROMA_MCTEST (PREFIX, 5, 7)
DEF_CHROMA_MCTEST (PREFIX, 6, 0)
DEF_CHROMA_MCTEST (PREFIX, 6, 1)
DEF_CHROMA_MCTEST (PREFIX, 6, 2)
DEF_CHROMA_MCTEST (PREFIX, 6, 3)
DEF_CHROMA_MCTEST (PREFIX, 6, 4)
DEF_CHROMA_MCTEST (PREFIX, 6, 5)
DEF_CHROMA_MCTEST (PREFIX, 6, 6)
DEF_CHROMA_MCTEST (PREFIX, 6, 7)
DEF_CHROMA_MCTEST (PREFIX, 7, 0)
DEF_CHROMA_MCTEST (PREFIX, 7, 1)
DEF_CHROMA_MCTEST (PREFIX, 7, 2)
DEF_CHROMA_MCTEST (PREFIX, 7, 3)
DEF_CHROMA_MCTEST (PREFIX, 7, 4)
DEF_CHROMA_MCTEST (PREFIX, 7, 5)
DEF_CHROMA_MCTEST (PREFIX, 7, 6)
DEF_CHROMA_MCTEST (PREFIX, 7, 7)