Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] checkasm/huffyuvdsp: test for add_hfyu_left_pred_bgr32
@ 2023-11-12 13:42 Rémi Denis-Courmont
  0 siblings, 0 replies; only message in thread
From: Rémi Denis-Courmont @ 2023-11-12 13:42 UTC (permalink / raw)
  To: ffmpeg-devel

---
 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);
 }
-- 
2.42.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-12 13:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-12 13:42 [FFmpeg-devel] [PATCH] checkasm/huffyuvdsp: test for add_hfyu_left_pred_bgr32 Rémi Denis-Courmont

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git