Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Lynne <dev@lynne.ee>
To: Ffmpeg Devel <ffmpeg-devel@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] checkasm/h264dsp: add chroma_mc checkasm test
Date: Thu, 18 May 2023 16:21:27 +0200 (CEST)
Message-ID: <NVjEACm--3-9@lynne.ee> (raw)

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

Checks all variants of put_h264_chroma and avg_h264_chroma.

Patch attached.


[-- Attachment #2: 0001-checkasm-h264dsp-add-chroma_mc-checkasm-test.patch --]
[-- Type: text/x-diff, Size: 3585 bytes --]

From 001abdaa534ccb601aa8ee1431c04e33913401a2 Mon Sep 17 00:00:00 2001
From: Lynne <dev@lynne.ee>
Date: Thu, 18 May 2023 16:18:16 +0200
Subject: [PATCH] checkasm/h264dsp: add chroma_mc checkasm test

Checks all variants of put_h264_chroma and avg_h264_chroma.
---
 tests/checkasm/h264dsp.c | 45 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/tests/checkasm/h264dsp.c b/tests/checkasm/h264dsp.c
index 3c95f9d74d..e1f8e21ca2 100644
--- a/tests/checkasm/h264dsp.c
+++ b/tests/checkasm/h264dsp.c
@@ -22,6 +22,7 @@
 #include "checkasm.h"
 #include "libavcodec/avcodec.h"
 #include "libavcodec/h264dsp.h"
+#include "libavcodec/h264chroma.h"
 #include "libavcodec/h264data.h"
 #include "libavcodec/h264_parse.h"
 #include "libavutil/common.h"
@@ -440,6 +441,47 @@ static void check_loop_filter_intra(void)
     }
 }
 
+static void check_chroma_mc(void)
+{
+    H264ChromaContext h;
+    LOCAL_ALIGNED_32(uint8_t, src,  [16 * 18 * 2]);
+    LOCAL_ALIGNED_32(uint8_t, dst0, [16 * 18 * 2]);
+    LOCAL_ALIGNED_32(uint8_t, dst1, [16 * 18 * 2]);
+
+    declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, const uint8_t *src,
+                      ptrdiff_t stride, int h, int x, int y);
+
+    memset(src, 3, 16*18*2);
+
+    for (int bit_depth = 8; bit_depth <= 10; bit_depth++) {
+        ff_h264chroma_init(&h, bit_depth);
+        for (int size = 0; size < 4; size++) {
+
+#define CHECK_CHROMA_MC(name)                                                                         \
+            do {                                                                                      \
+                if (check_func(h.name## _pixels_tab[size], #name "_mc%d_%d", 1 << size, bit_depth)) { \
+                    for (int x = 0; x < 2; x++) {                                                     \
+                        for (int y = 0; y < 2; y++) {                                                 \
+                            memcpy(dst0, src, 16 * 16 * SIZEOF_PIXEL);                                \
+                            memcpy(dst1, src, 16 * 16 * SIZEOF_PIXEL);                                \
+                            call_ref(dst0, src, 16 * SIZEOF_PIXEL, 16, x, y);                         \
+                            call_new(dst1, src, 16 * SIZEOF_PIXEL, 16, x, y);                         \
+                            if (memcmp(dst0, dst1, 16 * 16 * SIZEOF_PIXEL)) {                         \
+                                fprintf(stderr, #name ": x:%i, y:%i\n", x, y);                        \
+                                fail();                                                               \
+                            }                                                                         \
+                            bench_new(dst1, src, 16 * SIZEOF_PIXEL, 16, x, y);                        \
+                        }                                                                             \
+                    }                                                                                 \
+                }                                                                                     \
+            } while (0)
+
+            CHECK_CHROMA_MC(put_h264_chroma);
+            CHECK_CHROMA_MC(avg_h264_chroma);
+        }
+    }
+}
+
 void checkasm_check_h264dsp(void)
 {
     check_idct();
@@ -451,4 +493,7 @@ void checkasm_check_h264dsp(void)
 
     check_loop_filter_intra();
     report("loop_filter_intra");
+
+    check_chroma_mc();
+    report("chroma_mc");
 }
-- 
2.40.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".

             reply	other threads:[~2023-05-18 14:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18 14:21 Lynne [this message]
     [not found] ` <NVjEACm--3-9@lynne.ee-NVjEEFt----9>
2023-05-20 18:36   ` Lynne

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=NVjEACm--3-9@lynne.ee \
    --to=dev@lynne.ee \
    --cc=ffmpeg-devel@ffmpeg.org \
    /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