From 5ea3adfcf92a7e229e740a4853893756b802d664 Mon Sep 17 00:00:00 2001 From: Tristan Matthews Date: Fri, 13 Jun 2025 10:04:45 -0400 Subject: [PATCH] checkasm: add checkasm_check_dctcoef MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is useful for tests that compare dctcoefs which will be either 2 bytes or 4 bytes, depending on bitdepth. Reviewed-by: Martin Storsjö Signed-off-by: Michael Niedermayer --- tests/checkasm/checkasm.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h index 146bfdec35..e829942d58 100644 --- a/tests/checkasm/checkasm.h +++ b/tests/checkasm/checkasm.h @@ -443,5 +443,16 @@ DECL_CHECKASM_CHECK_FUNC(int32_t); #define checkasm_check_pixel_padded_align(...) \ checkasm_check_pixel2(__VA_ARGS__, 8) +/* This assumes that there is a local variable named "bit_depth". + * For tests that don't have that and only operate on a single + * bitdepth, just call checkasm_check(uint8_t, ...) directly. */ +#define checkasm_check_dctcoef(buf1, stride1, buf2, stride2, ...) \ + ((bit_depth > 8) ? \ + checkasm_check(int32_t, (const int32_t*)buf1, stride1, \ + (const int32_t*)buf2, stride2, \ + __VA_ARGS__) : \ + checkasm_check(int16_t, (const int16_t*)buf1, stride1, \ + (const int16_t*)buf2, stride2, \ + __VA_ARGS__)) #endif /* TESTS_CHECKASM_CHECKASM_H */