From: flow gg <hlefthleft@gmail.com> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: [FFmpeg-devel] [PATCH 1/3] checkasm/h264dsp: add h264_add_pixels_clear test Date: Mon, 25 Dec 2023 12:00:44 +0800 Message-ID: <CAEa-L+vst=H1BhGFiL49d6jVkn4ykqXAoqa-XFznwJsDyOuCYw@mail.gmail.com> (raw) [-- 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".
reply other threads:[~2023-12-25 4:01 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='CAEa-L+vst=H1BhGFiL49d6jVkn4ykqXAoqa-XFznwJsDyOuCYw@mail.gmail.com' \ --to=hlefthleft@gmail.com \ --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