Commit 7157d8f850 for ffmpeg
commit 7157d8f8509a257ab6aea776a646cb0a968fea3d
Author: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Mon Nov 30 22:22:18 2026 +0100
tests/checkasm/proresdsp: Test dc-only shortcut
The C version has a shortcut for rows consisting
only of the DC-coefficient which leads to slightly
different results than the ordinary non-shortcut
codepath would have produced. Test this codepath.
(Without the last patch, the AVX2 version would fail
with seed 1544420462.)
Reviewed-by: Marcos Ashton Iglesias <marcosashiglesias@gmail.com>
Reviewed-by: Kyle Swanson <k@ylo.ph>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
diff --git a/tests/checkasm/proresdsp.c b/tests/checkasm/proresdsp.c
index 284bd2c540..72ed24e163 100644
--- a/tests/checkasm/proresdsp.c
+++ b/tests/checkasm/proresdsp.c
@@ -37,7 +37,10 @@
#define CLIP_MIN (1 << 2)
#define CLIP_MAX_12 ((1 << 12) - CLIP_MIN - 1)
-#define BLOCK_SIZE 64
+enum {
+ BLOCK_DIM = 8,
+ BLOCK_SIZE = BLOCK_DIM * BLOCK_DIM,
+};
static void permute_block(int16_t *dst, const int16_t *src, const uint8_t *perm)
{
@@ -81,9 +84,12 @@ void checkasm_check_proresdsp(void)
if (check_func(dsp.idct_put, "prores_idct_put_12")) {
declare_func(void, uint16_t *dst, ptrdiff_t linesize, int16_t *block, const int16_t *qmat);
- for (int i = 0; i < BLOCK_SIZE; i++) {
- src_qmat[i] = 1 + (rnd() % 255);
- src_block[i] = (int16_t)rnd();
+ for (int i = 0; i < BLOCK_DIM; ++i) {
+ unsigned dc_only_row = !(rnd() % 32);
+ for (int j = 0; j < BLOCK_DIM; ++j) {
+ src_qmat [8 * i + j] = 1 + (rnd() % 255);
+ src_block[8 * i + j] = dc_only_row && j ? 0 : (int16_t)rnd();
+ }
}
permute_block(block, src_block, dsp.idct_permutation);