summaryrefslogtreecommitdiff
path: root/tests/checkasm
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2021-02-17 12:04:23 -0300
committerJames Almer <jamrial@gmail.com>2021-02-17 13:39:11 -0300
commit2df3c2ed9b3ea1f2912bb663a5e942ba56385d05 (patch)
treecbd48a6b28a0952b0d518e20f098ed5bc66f73ab /tests/checkasm
parent2b4da1cb8c2984b37e5c912e103a1b8b734e7c1f (diff)
checkasm/vf_gblur: split off the horiz_slice test into its own function
Will come in handy for the following commit. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'tests/checkasm')
-rw-r--r--tests/checkasm/vf_gblur.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/tests/checkasm/vf_gblur.c b/tests/checkasm/vf_gblur.c
index 1d63fc22a0..8ff47a338f 100644
--- a/tests/checkasm/vf_gblur.c
+++ b/tests/checkasm/vf_gblur.c
@@ -33,18 +33,26 @@
tmp_buf[j] = (float)(rnd() & 0xFF); \
} while (0)
-void checkasm_check_vf_gblur(void)
+static void check_horiz_slice(float *dst_ref, float *dst_new)
{
- float *dst_ref = av_malloc(BUF_SIZE);
- float *dst_new = av_malloc(BUF_SIZE);
- int w = WIDTH;
- int h = HEIGHT;
int steps = 2;
float nu = 0.101f;
float bscale = 1.112f;
- GBlurContext s;
declare_func(void, float *dst, int w, int h, int steps, float nu, float bscale);
+ call_ref(dst_ref, WIDTH, HEIGHT, steps, nu, bscale);
+ call_new(dst_new, WIDTH, HEIGHT, steps, nu, bscale);
+ if (!float_near_abs_eps_array(dst_ref, dst_new, 0.01f, PIXELS)) {
+ fail();
+ }
+ bench_new(dst_new, WIDTH, HEIGHT, 1, nu, bscale);
+}
+
+void checkasm_check_vf_gblur(void)
+{
+ float *dst_ref = av_malloc(BUF_SIZE);
+ float *dst_new = av_malloc(BUF_SIZE);
+ GBlurContext s;
randomize_buffers(dst_ref, PIXELS);
memcpy(dst_new, dst_ref, BUF_SIZE);
@@ -52,13 +60,7 @@ void checkasm_check_vf_gblur(void)
ff_gblur_init(&s);
if (check_func(s.horiz_slice, "horiz_slice")) {
- call_ref(dst_ref, w, h, steps, nu, bscale);
- call_new(dst_new, w, h, steps, nu, bscale);
-
- if (!float_near_abs_eps_array(dst_ref, dst_new, 0.01f, PIXELS)) {
- fail();
- }
- bench_new(dst_new, w, h, 1, nu, bscale);
+ check_horiz_slice(dst_ref, dst_new);
}
report("horiz_slice");
av_freep(&dst_ref);