[FFmpeg-cvslog] checkasm: add checkasm_check_dctcoef

Tristan Matthews git at videolan.org
Mon Jun 16 02:43:53 EEST 2025


ffmpeg | branch: master | Tristan Matthews <tmatth at videolan.org> | Fri Jun 13 10:04:45 2025 -0400| [5ea3adfcf92a7e229e740a4853893756b802d664] | committer: Michael Niedermayer

checkasm: add checkasm_check_dctcoef

This is useful for tests that compare dctcoefs which will be either 2 bytes or
4 bytes, depending on bitdepth.

Reviewed-by: Martin Storsjö <martin at martin.st>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5ea3adfcf92a7e229e740a4853893756b802d664
---

 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 */



More information about the ffmpeg-cvslog mailing list