summaryrefslogtreecommitdiff
path: root/tests/checkasm/checkasm.h
diff options
context:
space:
mode:
authorJanne Grunau <janne-libav@jannau.net>2015-12-07 16:14:46 +0100
committerJanne Grunau <janne-libav@jannau.net>2015-12-21 17:40:18 +0100
commit9d218d573f8088c606d873e80df572582e6773ef (patch)
treed46a9984d723b29be19b4a96b11b1b4ee813053c /tests/checkasm/checkasm.h
parent711781d7a1714ea4eb0217eb1ba04811978c43d1 (diff)
checkasm: add float comparison util functions
Diffstat (limited to 'tests/checkasm/checkasm.h')
-rw-r--r--tests/checkasm/checkasm.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h
index 6fc30ca0a2..4a4cce4286 100644
--- a/tests/checkasm/checkasm.h
+++ b/tests/checkasm/checkasm.h
@@ -42,6 +42,17 @@ void checkasm_fail_func(const char *msg, ...) av_printf_format(1, 2);
void checkasm_update_bench(int iterations, uint64_t cycles);
void checkasm_report(const char *name, ...) av_printf_format(1, 2);
+/* float compare utilities */
+int float_near_ulp(float a, float b, unsigned max_ulp);
+int float_near_abs_eps(float a, float b, float eps);
+int float_near_abs_eps_ulp(float a, float b, float eps, unsigned max_ulp);
+int float_near_ulp_array(const float *a, const float *b, unsigned max_ulp,
+ unsigned len);
+int float_near_abs_eps_array(const float *a, const float *b, float eps,
+ unsigned len);
+int float_near_abs_eps_array_ulp(const float *a, const float *b, float eps,
+ unsigned max_ulp, unsigned len);
+
extern AVLFG checkasm_lfg;
#define rnd() av_lfg_get(&checkasm_lfg)