From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCHv3] checkasm/flacdsp: add LPC test
Date: Wed, 15 Nov 2023 16:36:10 -0300
Message-ID: <15ef22a7-3d17-4a30-9ece-04269c6a910b@gmail.com> (raw)
In-Reply-To: <20231115192403.51290-1-remi@remlab.net>
On 11/15/2023 4:24 PM, Rémi Denis-Courmont wrote:
> ---
> tests/checkasm/flacdsp.c | 32 ++++++++++++++++++++++++++++++++
> 1 file changed, 32 insertions(+)
>
> diff --git a/tests/checkasm/flacdsp.c b/tests/checkasm/flacdsp.c
> index 51a0e0060b..b308237db1 100644
> --- a/tests/checkasm/flacdsp.c
> +++ b/tests/checkasm/flacdsp.c
> @@ -54,6 +54,28 @@ static void check_decorrelate(uint8_t **ref_dst, uint8_t **ref_src, uint8_t **ne
> bench_new(new_dst, (int32_t **)new_src, channels, BUF_SIZE / sizeof(int32_t), 8);
> }
>
> +static void check_lpc(int pred_order)
> +{
> + int qlevel = rnd() % 16;
> + LOCAL_ALIGNED_16(int32_t, coeffs, [32]);
> + LOCAL_ALIGNED_16(int32_t, dst0, [BUF_SIZE]);
> + LOCAL_ALIGNED_16(int32_t, dst1, [BUF_SIZE]);
> +
> + declare_func(void, int32_t *, const int[32], int, int, int);
> +
> + for (int i = 0; i < 32; i++)
> + coeffs[i] = rnd();
> + for (int i = 0; i < BUF_SIZE; i++)
> + dst0[i] = rnd();
> +
> + memcpy(dst1, dst0, BUF_SIZE * sizeof (int32_t));
> + call_ref(dst0, coeffs, pred_order, qlevel, BUF_SIZE);
> + call_new(dst1, coeffs, pred_order, qlevel, BUF_SIZE);
> + if (memcmp(dst0, dst1, BUF_SIZE * sizeof (int32_t)) != 0)
> + fail();
> + bench_new(dst1, coeffs, pred_order, qlevel, BUF_SIZE);
> +}
> +
> void checkasm_check_flacdsp(void)
> {
> LOCAL_ALIGNED_16(uint8_t, ref_dst, [BUF_SIZE*MAX_CHANNELS]);
> @@ -72,6 +94,7 @@ void checkasm_check_flacdsp(void)
> { AV_SAMPLE_FMT_S16, 16 },
> { AV_SAMPLE_FMT_S32, 32 },
> };
> + static const signed char pred_orders[] = { 13, 16, 29, 32 };
> FLACDSPContext h;
> int i, j;
>
> @@ -88,4 +111,13 @@ void checkasm_check_flacdsp(void)
> }
>
> report("decorrelate");
> +
> + for (i = 0; i < FF_ARRAY_ELEMS(pred_orders); i++)
> + if (check_func(h.lpc16, "flac_lpc_16_%d", pred_orders[i]))
> + check_lpc(pred_orders[i]);
> + for (i = 0; i < FF_ARRAY_ELEMS(pred_orders); i++)
> + if (check_func(h.lpc32, "flac_lpc_32_%d", pred_orders[i]))
> + check_lpc(pred_orders[i]);
> +
> + report("lpc");
> }
LGTM.
_______________________________________________
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".
prev parent reply other threads:[~2023-11-15 19:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-15 19:24 Rémi Denis-Courmont
2023-11-15 19:36 ` James Almer [this message]
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=15ef22a7-3d17-4a30-9ece-04269c6a910b@gmail.com \
--to=jamrial@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