[FFmpeg-devel] [PATCH 1/2] checkasm: add checkasm_check_dctcoef
Tristan Matthews
tmatth at videolan.org
Fri Jun 13 17:04:45 EEST 2025
This is useful for tests that compare dctcoefs which will be either 2 bytes or
4 bytes, depending on bitdepth.
---
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 */
--
2.48.1
More information about the ffmpeg-devel
mailing list