* [FFmpeg-devel] Subject: [PATCH 2/3] checkasm/dnxhdenc: add get_pixels_8x4_sym test
@ 2023-12-20 8:40 flow gg
0 siblings, 0 replies; only message in thread
From: flow gg @ 2023-12-20 8:40 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: 0002-checkasm-dnxhdenc-add-get_pixels_8x4_sym-test.patch --]
[-- Type: text/x-patch, Size: 5219 bytes --]
From 2f17a594805615a93f3f475246d61d61cc0aa43b Mon Sep 17 00:00:00 2001
From: sunyuechi <sunyuechi@iscas.ac.cn>
Date: Wed, 20 Dec 2023 16:21:38 +0800
Subject: [PATCH 2/3] checkasm/dnxhdenc: add get_pixels_8x4_sym test
---
tests/checkasm/Makefile | 1 +
tests/checkasm/checkasm.c | 3 ++
tests/checkasm/checkasm.h | 1 +
tests/checkasm/dnxhdenc.c | 73 +++++++++++++++++++++++++++++++++++++++
tests/fate/checkasm.mak | 1 +
5 files changed, 79 insertions(+)
create mode 100644 tests/checkasm/dnxhdenc.c
diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile
index e6d732d8de..47328b59b9 100644
--- a/tests/checkasm/Makefile
+++ b/tests/checkasm/Makefile
@@ -26,6 +26,7 @@ AVCODECOBJS-$(CONFIG_AAC_DECODER) += aacpsdsp.o \
AVCODECOBJS-$(CONFIG_AAC_ENCODER) += aacencdsp.o
AVCODECOBJS-$(CONFIG_ALAC_DECODER) += alacdsp.o
AVCODECOBJS-$(CONFIG_DCA_DECODER) += synth_filter.o
+AVCODECOBJS-$(CONFIG_DNXHD_ENCODER) += dnxhdenc.o
AVCODECOBJS-$(CONFIG_EXR_DECODER) += exrdsp.o
AVCODECOBJS-$(CONFIG_FLAC_DECODER) += flacdsp.o
AVCODECOBJS-$(CONFIG_HUFFYUV_DECODER) += huffyuvdsp.o
diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
index 51a8cdf3a0..e4606a15ca 100644
--- a/tests/checkasm/checkasm.c
+++ b/tests/checkasm/checkasm.c
@@ -98,6 +98,9 @@ static const struct {
#if CONFIG_DCA_DECODER
{ "synth_filter", checkasm_check_synth_filter },
#endif
+ #if CONFIG_DNXHD_ENCODER
+ { "dnxhdenc", checkasm_check_dnxhdenc },
+ #endif
#if CONFIG_EXR_DECODER
{ "exrdsp", checkasm_check_exrdsp },
#endif
diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h
index cb57eeeddf..6dd001aeee 100644
--- a/tests/checkasm/checkasm.h
+++ b/tests/checkasm/checkasm.h
@@ -54,6 +54,7 @@ void checkasm_check_blend(void);
void checkasm_check_blockdsp(void);
void checkasm_check_bswapdsp(void);
void checkasm_check_colorspace(void);
+void checkasm_check_dnxhdenc(void);
void checkasm_check_exrdsp(void);
void checkasm_check_fixed_dsp(void);
void checkasm_check_flacdsp(void);
diff --git a/tests/checkasm/dnxhdenc.c b/tests/checkasm/dnxhdenc.c
new file mode 100644
index 0000000000..c88ae3113d
--- /dev/null
+++ b/tests/checkasm/dnxhdenc.c
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2023 Institue of Software Chinese Academy of Sciences (ISCAS).
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <string.h>
+
+#include "libavutil/mem.h"
+#include "libavutil/mem_internal.h"
+
+#include "libavcodec/dnxhdenc.h"
+#include "libavcodec/dnxhdenc.c"
+
+#include "checkasm.h"
+
+#define randomize(buf, len) \
+ do { \
+ for (int i = 0; i < len; i++) \
+ buf[i] = rnd(); \
+ } while (0)
+
+static void test_get_pixels_8x4_sym(void) {
+#define BUF_SIZE 64*2
+ declare_func(void, int16_t *block, const uint8_t *pixels, ptrdiff_t line_size);
+
+ const CIDEntry cid_array[] = {
+ {.bit_depth = 8},
+ };
+ DNXHDEncContext s = {.cid_table = cid_array};
+
+ s.get_pixels_8x4_sym = dnxhd_8bit_get_pixels_8x4_sym;
+
+ ff_dnxhdenc_init(&s);
+
+ if (check_func(s.get_pixels_8x4_sym, "get_pixels_8x4_sym")) {
+ LOCAL_ALIGNED_32(int16_t, block1, [BUF_SIZE]);
+ LOCAL_ALIGNED_32(int16_t, block2, [BUF_SIZE]);
+ LOCAL_ALIGNED_32(uint8_t, pixels, [BUF_SIZE]);
+
+ randomize(pixels, BUF_SIZE);
+
+ call_ref(block1, pixels, BUF_SIZE);
+ call_new(block2, pixels, BUF_SIZE);
+
+ if (memcmp(block1, block2, BUF_SIZE) != 0) {
+ fail();
+ }
+
+ bench_new(block1, pixels, BUF_SIZE);
+ }
+
+ report("get_pixels_8x4_sym");
+}
+
+void checkasm_check_dnxhdenc(void)
+{
+ test_get_pixels_8x4_sym();
+}
diff --git a/tests/fate/checkasm.mak b/tests/fate/checkasm.mak
index 34e1a0a048..9e04b1b3cb 100644
--- a/tests/fate/checkasm.mak
+++ b/tests/fate/checkasm.mak
@@ -7,6 +7,7 @@ FATE_CHECKASM = fate-checkasm-aacencdsp \
fate-checkasm-av_tx \
fate-checkasm-blockdsp \
fate-checkasm-bswapdsp \
+ fate-checkasm-dnxhdenc \
fate-checkasm-exrdsp \
fate-checkasm-fixed_dsp \
fate-checkasm-flacdsp \
--
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-20 8:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-20 8:40 [FFmpeg-devel] Subject: [PATCH 2/3] checkasm/dnxhdenc: add get_pixels_8x4_sym 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