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 1/2] checkasm/vc1dsp: add mspel_pixels test
@ 2024-03-02 12:05 flow gg
  0 siblings, 0 replies; only message in thread
From: flow gg @ 2024-03-02 12:05 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 0001-checkasm-vc1dsp-add-mspel_pixels-test.patch --]
[-- Type: text/x-patch, Size: 2040 bytes --]

From efcb91959cb373145f2fc9fcbfcc6659610172cc Mon Sep 17 00:00:00 2001
From: sunyuechi <sunyuechi@iscas.ac.cn>
Date: Fri, 1 Mar 2024 19:45:53 +0800
Subject: [PATCH 1/2] checkasm/vc1dsp: add mspel_pixels test

---
 tests/checkasm/vc1dsp.c | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/tests/checkasm/vc1dsp.c b/tests/checkasm/vc1dsp.c
index 570785776f..42e9c626e0 100644
--- a/tests/checkasm/vc1dsp.c
+++ b/tests/checkasm/vc1dsp.c
@@ -438,6 +438,40 @@ static void check_unescape(void)
     }
 }
 
+static void check_mspel_pixels(void)
+{
+    LOCAL_ALIGNED_8(uint8_t, src0, [32 * 32]);
+    LOCAL_ALIGNED_8(uint8_t, src1, [32 * 32]);
+    LOCAL_ALIGNED_8(uint8_t, dst0, [32 * 32]);
+    LOCAL_ALIGNED_8(uint8_t, dst1, [32 * 32]);
+
+    VC1DSPContext h;
+
+    const test tests[] = {
+        VC1DSP_SIZED_TEST(put_vc1_mspel_pixels_tab[0][0], 16, 16)
+        VC1DSP_SIZED_TEST(put_vc1_mspel_pixels_tab[1][0], 8, 8)
+        VC1DSP_SIZED_TEST(avg_vc1_mspel_pixels_tab[0][0], 16, 16)
+        VC1DSP_SIZED_TEST(avg_vc1_mspel_pixels_tab[1][0], 8, 8)
+    };
+
+    ff_vc1dsp_init(&h);
+
+    for (size_t t = 0; t < FF_ARRAY_ELEMS(tests); ++t) {
+        void (*func)(uint8_t *, const uint8_t*, ptrdiff_t, int) = *(void **)((intptr_t) &h + tests[t].offset);
+        if (check_func(func, "vc1dsp.%s", tests[t].name)) {
+            declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *, const uint8_t*, ptrdiff_t, int);
+            RANDOMIZE_BUFFER8(dst, 32 * 32);
+            RANDOMIZE_BUFFER8(src, 32 * 32);
+            call_ref(dst0, src0, 32, 0);
+            call_new(dst1, src1, 32, 0);
+            if (memcmp(dst0, dst1, 32 * 32)) {
+                fail();
+            }
+            bench_new(dst1, src0, 32, 0);
+        }
+    }
+}
+
 void checkasm_check_vc1dsp(void)
 {
     check_inv_trans_inplace();
@@ -449,4 +483,7 @@ void checkasm_check_vc1dsp(void)
 
     check_unescape();
     report("unescape_buffer");
+
+    check_mspel_pixels();
+    report("mspel_pixels");
 }
-- 
2.44.0


[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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:[~2024-03-02 12:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-02 12:05 [FFmpeg-devel] [PATCH 1/2] checkasm/vc1dsp: add mspel_pixels test flow gg

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