diff options
author | James Almer <jamrial@gmail.com> | 2024-05-12 11:53:19 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2024-05-12 17:24:08 -0300 |
commit | 5acec189afa300b28a581b7c4cfaa510d0f3a9c1 (patch) | |
tree | 420321e65ed7a290663526fb915984d1a036a1d2 /tests | |
parent | 1ba528769702e09ed2a7ce493ccc26190d8d4124 (diff) | |
download | ffmpeg-5acec189afa300b28a581b7c4cfaa510d0f3a9c1.tar.gz |
checkasm/flacdsp: add a test for wasted32
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/checkasm/flacdsp.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/checkasm/flacdsp.c b/tests/checkasm/flacdsp.c index d694c1093b..ee0897ed01 100644 --- a/tests/checkasm/flacdsp.c +++ b/tests/checkasm/flacdsp.c @@ -83,6 +83,27 @@ static void check_lpc(int pred_order, int bps) bench_new(dst, coeffs, pred_order, qlevel, BUF_SIZE); } +static void check_wasted32(void) +{ + int wasted = rnd() % 32; + LOCAL_ALIGNED_16(int32_t, dst, [BUF_SIZE]); + LOCAL_ALIGNED_16(int32_t, dst0, [BUF_SIZE]); + LOCAL_ALIGNED_16(int32_t, dst1, [BUF_SIZE]); + + declare_func(void, int32_t *, int, int); + + for (int i = 0; i < BUF_SIZE; i++) + dst[i] = rnd(); + + memcpy(dst0, dst, BUF_SIZE * sizeof (int32_t)); + memcpy(dst1, dst, BUF_SIZE * sizeof (int32_t)); + call_ref(dst0, wasted, BUF_SIZE); + call_new(dst1, wasted, BUF_SIZE); + if (memcmp(dst0, dst1, BUF_SIZE * sizeof (int32_t)) != 0) + fail(); + bench_new(dst, wasted, BUF_SIZE); +} + void checkasm_check_flacdsp(void) { LOCAL_ALIGNED_16(uint8_t, ref_dst, [BUF_SIZE*MAX_CHANNELS]); @@ -127,4 +148,9 @@ void checkasm_check_flacdsp(void) check_lpc(pred_orders[i], 32); report("lpc"); + + if (check_func(h.wasted32, "flac_wasted_32")) + check_wasted32(); + + report("wasted"); } |