Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Krzysztof Pyrkosz via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Krzysztof Pyrkosz <ffmpeg@szaka.eu>
Subject: [FFmpeg-devel] [PATCH 1/2] tests/checkasm/sw_rgb: Added {yuyv, uyvy}toyuv{420, 422} test cases
Date: Tue, 11 Feb 2025 23:06:42 +0100
Message-ID: <20250211220642.116850-2-ffmpeg@szaka.eu> (raw)
In-Reply-To: <d83b103b-f84d-28dd-2a9b-b4b96bce3bbd@martin.st>

Splitting the previous patch into two.
I noticed that on my x86 box, one of the newly added tests fail:

MMXEXT:
   uyvytoyuv420_mmxext (sw_rgb.c:126)
   yuyvtoyuv420_mmxext (sw_rgb.c:126)
 - sw_rgb.uyvytoyuv          [FAILED]

SSE2, AVX and AVX2 are passing, though.

---
 tests/checkasm/sw_rgb.c | 63 ++++++++++++++++++++++++++---------------
 1 file changed, 40 insertions(+), 23 deletions(-)

diff --git a/tests/checkasm/sw_rgb.c b/tests/checkasm/sw_rgb.c
index b98c7c6b47..183b4eeaa8 100644
--- a/tests/checkasm/sw_rgb.c
+++ b/tests/checkasm/sw_rgb.c
@@ -61,7 +61,7 @@ static void check_shuffle_bytes(void * func, const char * report)
     memcpy(src1, src0, MAX_STRIDE);
 
     if (check_func(func, "%s", report)) {
-        for (i = 0; i < 6; i ++) {
+        for (i = 0; i < FF_ARRAY_ELEMS(width); i ++) {
             call_ref(src0, dst0, width[i]);
             call_new(src1, dst1, width[i]);
             if (memcmp(dst0, dst1, MAX_STRIDE))
@@ -71,9 +71,24 @@ static void check_shuffle_bytes(void * func, const char * report)
     }
 }
 
-static void check_uyvy_to_422p(void)
+typedef void (*uyvy_to_yuv_func)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
+                           const uint8_t *src, int width, int height,
+                           int lumStride, int chromStride, int srcStride);
+
+typedef struct
+{
+    uyvy_to_yuv_func func;
+    const char* from;
+    int to;
+} uyvy_to_yuv_f;
+
+static void check_uyvy_to_yuv(void)
 {
     int i;
+    uyvy_to_yuv_f funcs[] = {
+	{uyvytoyuv420, "uyvy", 420}, {uyvytoyuv422, "uyvy", 422},
+	{yuyvtoyuv420, "yuyv", 420}, {yuyvtoyuv422, "yuyv", 422}
+    };
 
     LOCAL_ALIGNED_32(uint8_t, src0, [MAX_STRIDE * MAX_HEIGHT * 2]);
     LOCAL_ALIGNED_32(uint8_t, src1, [MAX_STRIDE * MAX_HEIGHT * 2]);
@@ -91,26 +106,28 @@ static void check_uyvy_to_422p(void)
     randomize_buffers(src0, MAX_STRIDE * MAX_HEIGHT * 2);
     memcpy(src1, src0, MAX_STRIDE * MAX_HEIGHT * 2);
 
-    if (check_func(uyvytoyuv422, "uyvytoyuv422")) {
-        for (i = 0; i < 6; i ++) {
-            memset(dst_y_0, 0, MAX_STRIDE * MAX_HEIGHT);
-            memset(dst_y_1, 0, MAX_STRIDE * MAX_HEIGHT);
-            memset(dst_u_0, 0, (MAX_STRIDE/2) * MAX_HEIGHT);
-            memset(dst_u_1, 0, (MAX_STRIDE/2) * MAX_HEIGHT);
-            memset(dst_v_0, 0, (MAX_STRIDE/2) * MAX_HEIGHT);
-            memset(dst_v_1, 0, (MAX_STRIDE/2) * MAX_HEIGHT);
-
-            call_ref(dst_y_0, dst_u_0, dst_v_0, src0, planes[i].w, planes[i].h,
-                     MAX_STRIDE, MAX_STRIDE / 2, planes[i].s);
-            call_new(dst_y_1, dst_u_1, dst_v_1, src1, planes[i].w, planes[i].h,
-                     MAX_STRIDE, MAX_STRIDE / 2, planes[i].s);
-            if (memcmp(dst_y_0, dst_y_1, MAX_STRIDE * MAX_HEIGHT) ||
-                memcmp(dst_u_0, dst_u_1, (MAX_STRIDE/2) * MAX_HEIGHT) ||
-                memcmp(dst_v_0, dst_v_1, (MAX_STRIDE/2) * MAX_HEIGHT))
-                fail();
+    for (int k = 0; k < FF_ARRAY_ELEMS(funcs); k ++) {
+	if (check_func(funcs[k].func, "%stoyuv%d",funcs[k].from, funcs[k].to)) {
+	    for (i = 0; i < FF_ARRAY_ELEMS(planes); i ++) {
+		memset(dst_y_0, 0, MAX_STRIDE * MAX_HEIGHT);
+		memset(dst_y_1, 0, MAX_STRIDE * MAX_HEIGHT);
+		memset(dst_u_0, 0, (MAX_STRIDE/2) * MAX_HEIGHT);
+		memset(dst_u_1, 0, (MAX_STRIDE/2) * MAX_HEIGHT);
+		memset(dst_v_0, 0, (MAX_STRIDE/2) * MAX_HEIGHT);
+		memset(dst_v_1, 0, (MAX_STRIDE/2) * MAX_HEIGHT);
+
+		call_ref(dst_y_0, dst_u_0, dst_v_0, src0, planes[i].w, planes[i].h,
+			 MAX_STRIDE, MAX_STRIDE / 2, planes[i].s);
+		call_new(dst_y_1, dst_u_1, dst_v_1, src1, planes[i].w, planes[i].h,
+			 MAX_STRIDE, MAX_STRIDE / 2, planes[i].s);
+		if (memcmp(dst_y_0, dst_y_1, MAX_STRIDE * MAX_HEIGHT) ||
+		    memcmp(dst_u_0, dst_u_1, (MAX_STRIDE/2) * MAX_HEIGHT) ||
+		    memcmp(dst_v_0, dst_v_1, (MAX_STRIDE/2) * MAX_HEIGHT))
+		    fail();
+	    }
+	    bench_new(dst_y_1, dst_u_1, dst_v_1, src1, planes[5].w, planes[5].h,
+		      MAX_STRIDE, MAX_STRIDE / 2, planes[5].s);
         }
-        bench_new(dst_y_1, dst_u_1, dst_v_1, src1, planes[5].w, planes[5].h,
-                  MAX_STRIDE, MAX_STRIDE / 2, planes[5].s);
     }
 }
 
@@ -834,8 +851,8 @@ void checkasm_check_sw_rgb(void)
     check_shuffle_bytes(shuffle_bytes_2130, "shuffle_bytes_2130");
     report("shuffle_bytes_2130");
 
-    check_uyvy_to_422p();
-    report("uyvytoyuv422");
+    check_uyvy_to_yuv();
+    report("uyvytoyuv");
 
     check_interleave_bytes();
     report("interleave_bytes");
-- 
2.47.2

_______________________________________________
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".

  reply	other threads:[~2025-02-11 22:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-07 19:06 [FFmpeg-devel] [PATCH] swscale/aarch64/rgb2rgb_neon: Implemented uyvytoyuv422 Krzysztof Pyrkosz via ffmpeg-devel
2025-02-10 13:15 ` Martin Storsjö
2025-02-11 21:24   ` Krzysztof Pyrkosz via ffmpeg-devel
2025-02-11 21:33   ` Krzysztof Pyrkosz via ffmpeg-devel
2025-02-11 21:53     ` Martin Storsjö
2025-02-11 22:06       ` Krzysztof Pyrkosz via ffmpeg-devel [this message]
2025-02-11 22:06       ` [FFmpeg-devel] [PATCH 2/2] swscale/aarch64/rgb2rgb_neon: Implemented {yuyv, uyvy}toyuv{420, 422} Krzysztof Pyrkosz via ffmpeg-devel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250211220642.116850-2-ffmpeg@szaka.eu \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=ffmpeg@szaka.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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