summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2024-05-21 13:04:29 +0300
committerNuo Mi <nuomi2021@gmail.com>2024-05-21 20:20:50 +0800
commita9dc7dd7fde368420dea0673242ab45cf57e7201 (patch)
tree9e398b558b12d162bf4924509791b2127bc79878
parentb8eb8b4f1964d27260418001af20be2be2f0a5a5 (diff)
downloadffmpeg-upstream-master.tar.gz
checkasm: vvc_alf: Limit benchmarking to a reasonable subset of functionsupstream-master
Don't benchmark every single combination of widths and heights; only benchmark cases which are squares (like in vvc_mc.c). Contrary to vvc_mc, which increases sizes by doubling dimensions, vvc_alf tests all sizes in increments of 4. Limit benchmarking to the cases which are powers of two. This reduces the number of benchmarked cases from 3072 down to 18.
-rw-r--r--tests/checkasm/vvc_alf.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/checkasm/vvc_alf.c b/tests/checkasm/vvc_alf.c
index 9526260598..6dd89bfafc 100644
--- a/tests/checkasm/vvc_alf.c
+++ b/tests/checkasm/vvc_alf.c
@@ -103,7 +103,9 @@ static void check_alf_filter(VVCDSPContext *c, const int bit_depth)
if (memcmp(dst0 + i * dst_stride, dst1 + i * dst_stride, w * SIZEOF_PIXEL))
fail();
}
- bench_new(dst1, dst_stride, src1 + offset, src_stride, w, h, filter, clip, vb_pos);
+ // Bench only square sizes, and ones with dimensions being a power of two.
+ if (w == h && (w & (w - 1)) == 0)
+ bench_new(dst1, dst_stride, src1 + offset, src_stride, w, h, filter, clip, vb_pos);
}
if (check_func(c->alf.filter[CHROMA], "vvc_alf_filter_chroma_%dx%d_%d", w, h, bit_depth)) {
const int vb_pos = ctu_size - ALF_VB_POS_ABOVE_CHROMA;
@@ -115,7 +117,8 @@ static void check_alf_filter(VVCDSPContext *c, const int bit_depth)
if (memcmp(dst0 + i * dst_stride, dst1 + i * dst_stride, w * SIZEOF_PIXEL))
fail();
}
- bench_new(dst1, dst_stride, src1 + offset, src_stride, w, h, filter, clip, vb_pos);
+ if (w == h && (w & (w - 1)) == 0)
+ bench_new(dst1, dst_stride, src1 + offset, src_stride, w, h, filter, clip, vb_pos);
}
}
}
@@ -156,7 +159,9 @@ static void check_alf_classify(VVCDSPContext *c, const int bit_depth)
fail();
if (memcmp(transpose_idx0, transpose_idx1, id_size))
fail();
- bench_new(class_idx1, transpose_idx1, src1 + offset, stride, w, h, vb_pos, alf_gradient_tmp);
+ // Bench only square sizes, and ones with dimensions being a power of two.
+ if (w == h && (w & (w - 1)) == 0)
+ bench_new(class_idx1, transpose_idx1, src1 + offset, stride, w, h, vb_pos, alf_gradient_tmp);
}
}
}