From: Tristan Matthews <tmatth@videolan.org> To: ffmpeg-devel@ffmpeg.org Cc: Tristan Matthews <tmatth@videolan.org> Subject: [FFmpeg-devel] [PATCH 2/2] checkasm: h264dsp: test luma_dc_dequant Date: Fri, 13 Jun 2025 10:04:46 -0400 Message-ID: <20250613140600.2875509-2-tmatth@videolan.org> (raw) In-Reply-To: <20250613140600.2875509-1-tmatth@videolan.org> --- tests/checkasm/h264dsp.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tests/checkasm/h264dsp.c b/tests/checkasm/h264dsp.c index d1228ed985..f5f9650224 100644 --- a/tests/checkasm/h264dsp.c +++ b/tests/checkasm/h264dsp.c @@ -22,6 +22,7 @@ #include "checkasm.h" #include "libavcodec/h264dsp.h" #include "libavcodec/h264data.h" +#include "libavcodec/h264idct.h" #include "libavcodec/h264_parse.h" #include "libavutil/common.h" #include "libavutil/intreadwrite.h" @@ -324,6 +325,41 @@ static void check_idct_multiple(void) } } +static void check_idct_dequant(void) +{ + static const int depths[5] = { 8, 9, 10, 12, 14 }; + LOCAL_ALIGNED_16(int16_t, src, [16]); + /* Ensure dst buffers are large enough to hold dctcoefs of all bit-depths. */ + LOCAL_ALIGNED_16(uint8_t, dst0, [16 * 16 * sizeof(int32_t)]); + LOCAL_ALIGNED_16(uint8_t, dst1, [16 * 16 * sizeof(int32_t)]); + int16_t *dst_ref = (int16_t *)dst0; + int16_t *dst_new = (int16_t *)dst1; + H264DSPContext h; + int bit_depth, i, qmul; + declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_SSE2, void, int16_t *output, int16_t *input, int qmul); + + for (int j = 0; j < 16; j++) + src[j] = (rnd() % 512) - 256; + + qmul = rnd() % 4096; + + for (i = 0; i < FF_ARRAY_ELEMS(depths); i++) { + bit_depth = depths[i]; + ff_h264dsp_init(&h, bit_depth, 1); + + memset(dst0, 0, 16 * 16 * SIZEOF_COEF); + memset(dst1, 0, 16 * 16 * SIZEOF_COEF); + + if (check_func(h.h264_luma_dc_dequant_idct, "h264_luma_dc_dequant_idct_%d", bit_depth)) { + + call_ref(dst_ref, src, qmul); + call_new(dst_new, src, qmul); + checkasm_check_dctcoef(dst_ref, 16*SIZEOF_COEF, dst_new, 16*SIZEOF_COEF, 16, 16, "dst"); + bench_new(dst_new, src, qmul); + } + } +} + static void check_loop_filter(void) { @@ -453,6 +489,7 @@ void checkasm_check_h264dsp(void) { check_idct(); check_idct_multiple(); + check_idct_dequant(); report("idct"); check_loop_filter(); -- 2.48.1 _______________________________________________ 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".
next prev parent reply other threads:[~2025-06-13 14:06 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-06-12 17:25 [FFmpeg-devel] [PATCH] " Tristan Matthews 2025-06-12 20:13 ` Martin Storsjö 2025-06-13 4:11 ` Tristan Matthews 2025-06-13 4:12 ` [FFmpeg-devel] [PATCH 1/1] " Tristan Matthews 2025-06-13 6:08 ` [FFmpeg-devel] [PATCH] " Martin Storsjö 2025-06-13 13:21 ` Tristan Matthews 2025-06-13 13:26 ` Martin Storsjö 2025-06-13 14:04 ` [FFmpeg-devel] [PATCH 1/2] checkasm: add checkasm_check_dctcoef Tristan Matthews 2025-06-13 14:04 ` Tristan Matthews [this message] 2025-06-13 14:08 ` [FFmpeg-devel] [PATCH 2/2] checkasm: h264dsp: test luma_dc_dequant Martin Storsjö 2025-06-15 23:39 ` Michael Niedermayer 2025-06-16 6:53 ` Zhao Zhili 2025-06-16 13:58 ` Michael Niedermayer
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=20250613140600.2875509-2-tmatth@videolan.org \ --to=tmatth@videolan.org \ --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