[FFmpeg-cvslog] checkasm/huffyuvdsp: test for add_hfyu_left_pred_bgr32

Rémi Denis-Courmont git at videolan.org
Wed Nov 15 16:52:48 EET 2023


ffmpeg | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Nov 12 15:41:59 2023 +0200| [6b708cd7831342496b4430ef8c62ad9b8d836dd4] | committer: Rémi Denis-Courmont

checkasm/huffyuvdsp: test for add_hfyu_left_pred_bgr32

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

 tests/checkasm/huffyuvdsp.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/tests/checkasm/huffyuvdsp.c b/tests/checkasm/huffyuvdsp.c
index 6ba27e267f..a08f5a8391 100644
--- a/tests/checkasm/huffyuvdsp.c
+++ b/tests/checkasm/huffyuvdsp.c
@@ -64,6 +64,34 @@ static void check_add_int16(HuffYUVDSPContext *c, unsigned mask, int width, cons
     av_free(dst1);
 }
 
+static void check_add_hfyu_left_pred_bgr32(HuffYUVDSPContext *c)
+{
+#define BUF_SIZE 1080
+    uint8_t src[4 * BUF_SIZE], dst0[4 * BUF_SIZE], dst1[4 * BUF_SIZE];
+    uint8_t left[4], left0[4], left1[4];
+
+    declare_func(void, uint8_t *d, const uint8_t *s, intptr_t w, uint8_t *l);
+
+    randomize_buffers(src, sizeof (src));
+    randomize_buffers(left, sizeof (left));
+    memcpy(left0, left, sizeof (left));
+    memcpy(left1, left, sizeof (left));
+
+    if (check_func(c->add_hfyu_left_pred_bgr32, "add_hfyu_left_pred_bgr32")) {
+        call_ref(dst0, src, BUF_SIZE, left0);
+        call_new(dst1, src, BUF_SIZE, left1);
+
+        if (memcmp(dst0, dst1, sizeof (dst0)) != 0 ||
+            memcmp(left0, left1, sizeof (left0)) != 0) {
+            fail();
+        }
+
+        bench_new(dst1, src, BUF_SIZE, left);
+    }
+
+    report("add_hfyu_left_pred_bgr32");
+}
+
 void checkasm_check_huffyuvdsp(void)
 {
     HuffYUVDSPContext c;
@@ -78,4 +106,6 @@ void checkasm_check_huffyuvdsp(void)
     /*! test always with the same size (for perf test) */
     check_add_int16(&c, 65535, 16*128, "add_int16_128");
     report("add_int16_128");
+
+    check_add_hfyu_left_pred_bgr32(&c);
 }



More information about the ffmpeg-cvslog mailing list