This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit eb40b0b6b7424bb7eee66abfaab8577c5a13cb7b
Author:     Andreas Rheinhardt <[email protected]>
AuthorDate: Tue Jul 28 22:17:05 2026 +0200
Commit:     Andreas Rheinhardt <[email protected]>
CommitDate: Sun Aug 2 02:00:49 2026 +0200

    tests/checkasm/huffyuvdsp: Add test for add_hfyu_median_pred_int16
    
    Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 tests/checkasm/huffyuvdsp.c | 37 +++++++++++++++++++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)

diff --git a/tests/checkasm/huffyuvdsp.c b/tests/checkasm/huffyuvdsp.c
index d4b58a5bd2..4be043e586 100644
--- a/tests/checkasm/huffyuvdsp.c
+++ b/tests/checkasm/huffyuvdsp.c
@@ -22,6 +22,7 @@
 
 #include "libavutil/intreadwrite.h"
 #include "libavutil/mem.h"
+#include "libavutil/mem_internal.h"
 
 #include "libavcodec/huffyuvdsp.h"
 
@@ -77,6 +78,35 @@ static void check_add_int16(HuffYUVDSPContext *c, unsigned 
mask, int width, cons
     av_free(dst1);
 }
 
+static void check_add_hfyu_median_pred_int16(const HuffYUVDSPContext *c, 
unsigned mask, int width)
+{
+    declare_func_emms(AV_CPU_FLAG_MMXEXT, void, uint16_t *dst, const uint16_t 
*top,
+                       const uint16_t *diff, unsigned mask,
+                       int w, int *left, int *left_top);
+
+    if (!check_func(c->add_hfyu_median_pred_int16, 
"add_hfyu_median_pred_int16"))
+        return;
+
+    DECLARE_ALIGNED(16, uint16_t, top)[MAX_WIDTH];
+    DECLARE_ALIGNED(16, uint16_t, diff)[MAX_WIDTH];
+    DECLARE_ALIGNED(16, uint16_t, dst_new)[MAX_WIDTH];
+    DECLARE_ALIGNED(16, uint16_t, dst_ref)[MAX_WIDTH];
+    int left_new = rnd() & mask, left_ref = left_new;
+    int lt_new   = rnd() & mask, lt_ref   = lt_new;
+
+    randomize_buffer_mask(top,  MAX_WIDTH, mask);
+    randomize_buffer_mask(diff, MAX_WIDTH, mask);
+
+    call_ref(dst_ref, top, diff, mask, width, &left_ref, &lt_ref);
+    call_new(dst_new, top, diff, mask, width, &left_new, &lt_new);
+
+    if (left_ref != left_new || lt_ref != lt_new ||
+        memcmp(dst_ref, dst_new, width * sizeof(dst_ref[0])))
+        fail();
+
+    bench_new(dst_new, top, diff, mask, width, &left_new, &lt_new);
+}
+
 static void check_add_hfyu_left_pred_bgr32(HuffYUVDSPContext *c)
 {
 #define BUF_SIZE 1080
@@ -108,9 +138,9 @@ void checkasm_check_huffyuvdsp(void)
 {
     HuffYUVDSPContext c;
 
-    ff_huffyuvdsp_init(&c, AV_PIX_FMT_YUV422P);
+    ff_huffyuvdsp_init(&c, AV_PIX_FMT_YUV422P14);
 
-    unsigned bps  = 9 + rnd() % 8;
+    unsigned bps  = 9 + rnd() % 6;
     unsigned mask = (1 << bps) - 1;
     int width = 1 + rnd() % MAX_WIDTH;
 
@@ -122,6 +152,9 @@ void checkasm_check_huffyuvdsp(void)
     check_add_int16(&c, mask, MAX_WIDTH, "add_int16_128");
     report("add_int16_128");
 
+    check_add_hfyu_median_pred_int16(&c, mask, width);
+    report("add_hfyu_median_pred_int16");
+
     check_add_hfyu_left_pred_bgr32(&c);
     report("add_hfyu_left_pred_bgr32");
 }

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to