* [FFmpeg-devel] [PATCH 1/3] checkasm/h264dsp: add h264_add_pixels_clear test
@ 2023-12-25 4:00 flow gg
0 siblings, 0 replies; only message in thread
From: flow gg @ 2023-12-25 4:00 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: 0001-checkasm-h264dsp-add-h264_add_pixels_clear-test.patch --]
[-- Type: text/x-patch, Size: 2537 bytes --]
From 39a9d1728cd867f5a4bfc39232167e9769247bf6 Mon Sep 17 00:00:00 2001
From: sunyuechi <sunyuechi@iscas.ac.cn>
Date: Thu, 21 Dec 2023 20:02:11 +0800
Subject: [PATCH 1/3] checkasm/h264dsp: add h264_add_pixels_clear test
---
tests/checkasm/h264dsp.c | 55 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/tests/checkasm/h264dsp.c b/tests/checkasm/h264dsp.c
index 3c95f9d74d..2a33d3da66 100644
--- a/tests/checkasm/h264dsp.c
+++ b/tests/checkasm/h264dsp.c
@@ -440,6 +440,58 @@ static void check_loop_filter_intra(void)
}
}
+#define randomize(buf, len) \
+ do { \
+ for (int i = 0; i < len; i++) \
+ buf[i] = rnd(); \
+ } while (0)
+
+static void check_h264_add_pixels_clear(void)
+{
+#define BUF_SIZE 1024
+ LOCAL_ALIGNED_32(int16_t, src, [BUF_SIZE]);
+ LOCAL_ALIGNED_32(int16_t, src2, [BUF_SIZE]);
+ LOCAL_ALIGNED_32(uint8_t, dst, [BUF_SIZE]);
+ LOCAL_ALIGNED_32(uint8_t, dst2, [BUF_SIZE]);
+ H264DSPContext h;
+ ff_h264dsp_init(&h, 8, 1);
+ declare_func(void, uint8_t *, int16_t *, int);
+ int func, stride;
+
+ for (func = 0; func < 2; func++) {
+ void (*add_pixels_clear)(uint8_t *, int16_t *, int) = NULL;
+ const char *name;
+ switch (func) {
+ case 0:
+ add_pixels_clear = h.h264_add_pixels4_clear;
+ name = "h264_add_pixels4_clear";
+ stride = 4;
+ break;
+ case 1:
+ add_pixels_clear = h.h264_add_pixels8_clear;
+ name = "h264_add_pixels8_clear";
+ stride = 8;
+ break;
+ }
+
+ if (check_func(add_pixels_clear, "%s", name)) {
+ randomize(src, BUF_SIZE);
+ memcpy(src2, src, BUF_SIZE * sizeof(*src));
+ randomize(dst, BUF_SIZE);
+ memcpy(dst2, dst, BUF_SIZE * sizeof(*dst));
+
+ call_ref(dst, src, stride);
+ call_new(dst2, src2, stride);
+
+ if (memcmp(dst, dst2, BUF_SIZE * sizeof(*dst)) != 0 || memcmp(src, src2, BUF_SIZE * (*src)) != 0){
+ fail();
+ }
+
+ bench_new(dst, src, stride);
+ }
+ }
+}
+
void checkasm_check_h264dsp(void)
{
check_idct();
@@ -451,4 +503,7 @@ void checkasm_check_h264dsp(void)
check_loop_filter_intra();
report("loop_filter_intra");
+
+ check_h264_add_pixels_clear();
+ report("add_pixels_clear");
}
--
2.43.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:[~2023-12-25 4:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-25 4:00 [FFmpeg-devel] [PATCH 1/3] checkasm/h264dsp: add h264_add_pixels_clear 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