[tests] Fix mts_tests.c to not consider irrelevant elements

This commit is contained in:
Joose Sainio 2023-09-26 11:36:43 +03:00
parent 69c1c948fa
commit 079d7e9a1a

View file

@ -158,6 +158,7 @@ TEST dct(void)
{ {
char testname[100]; char testname[100];
for (int blocksize = 0; blocksize < NUM_SIZES; blocksize++) { for (int blocksize = 0; blocksize < NUM_SIZES; blocksize++) {
size_t size = 1 << (LCU_MIN_LOG_W + blocksize);
for (int trafo = 0; trafo < NUM_TRANSFORM; trafo++) { for (int trafo = 0; trafo < NUM_TRANSFORM; trafo++) {
sprintf(testname, "Block: %d x %d, trafo: %d", 1 << (LCU_MIN_LOG_W + blocksize), 1 << (LCU_MIN_LOG_W + blocksize), trafo); sprintf(testname, "Block: %d x %d, trafo: %d", 1 << (LCU_MIN_LOG_W + blocksize), 1 << (LCU_MIN_LOG_W + blocksize), trafo);
cu_info_t tu; cu_info_t tu;
@ -172,8 +173,13 @@ TEST dct(void)
test_env.tested_func(UVG_BIT_DEPTH, COLOR_Y, &tu, 1 << (LCU_MIN_LOG_W + blocksize), 1 << (LCU_MIN_LOG_W + blocksize), buf, test_result, UVG_MTS_BOTH); test_env.tested_func(UVG_BIT_DEPTH, COLOR_Y, &tu, 1 << (LCU_MIN_LOG_W + blocksize), 1 << (LCU_MIN_LOG_W + blocksize), buf, test_result, UVG_MTS_BOTH);
for (int i = 0; i < LCU_WIDTH * LCU_WIDTH; ++i) { for (int y = 0; y < size; ++y) {
ASSERT_EQm(testname, test_result[i], dct_result[trafo][blocksize][i]); if (y>= 16) break;
for (int x = 0; x < size; ++x) {
if (x >= 16) break;
int i = y * size + x;
ASSERT_EQm(testname, test_result[i], dct_result[trafo][blocksize][i]);
}
} }
//fprintf(stderr, "PASS: %s\r\n", testname); //fprintf(stderr, "PASS: %s\r\n", testname);
} }