[FFmpeg-cvslog] tests/checkasm/vf_gblur.c: add check_verti_slice() for unit test

Wu Jianhua git at videolan.org
Sun Aug 29 21:06:05 EEST 2021


ffmpeg | branch: master | Wu Jianhua <jianhua.wu at intel.com> | Wed Aug  4 10:06:14 2021 +0800| [0c54ab20c254bf26c33a5cceb83862d3a59b3db7] | committer: Paul B Mahol

tests/checkasm/vf_gblur.c: add check_verti_slice() for unit test

Co-authored-by: Cheng Yanfei <yanfei.cheng at intel.com>
Co-authored-by: Jin Jun <jun.i.jin at intel.com>
Signed-off-by: Wu Jianhua <jianhua.wu at intel.com>

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

 tests/checkasm/vf_gblur.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/tests/checkasm/vf_gblur.c b/tests/checkasm/vf_gblur.c
index b9fe2f9a36..0fac37b6be 100644
--- a/tests/checkasm/vf_gblur.c
+++ b/tests/checkasm/vf_gblur.c
@@ -49,6 +49,22 @@ static void check_horiz_slice(float *dst_ref, float *dst_new)
     bench_new(dst_new, WIDTH, HEIGHT, 1, nu, bscale);
 }
 
+static void check_verti_slice(float *dst_ref, float *dst_new)
+{
+    int steps = 2;
+    float nu = 0.101f;
+    float bscale = 1.112f;
+
+    declare_func(void, float *buffer, int width, int height, int column_begin,
+                int column_end, int steps, float nu, float bscale);
+    call_ref(dst_ref, WIDTH, HEIGHT, 0, WIDTH, steps, nu, bscale);
+    call_new(dst_new, WIDTH, HEIGHT, 0, WIDTH, steps, nu, bscale);
+    if (!float_near_abs_eps_array(dst_ref, dst_new, 0.01f, PIXELS)) {
+         fail();
+    }
+    bench_new(dst_new, WIDTH, HEIGHT, 0, WIDTH, 1, nu, bscale);
+}
+
 static void check_postscale_slice(float *dst_ref, float *dst_new)
 {
     float postscale = 0.0603f;
@@ -85,6 +101,13 @@ void checkasm_check_vf_gblur(void)
     }
     report("postscale_slice");
 
+    randomize_buffers(dst_ref, PIXELS);
+    memcpy(dst_new, dst_ref, BUF_SIZE);
+    if (check_func(s.verti_slice, "verti_slice")) {
+        check_verti_slice(dst_ref, dst_new);
+    }
+    report("verti_slice");
+
     av_freep(&dst_ref);
     av_freep(&dst_new);
 }



More information about the ffmpeg-cvslog mailing list