[FFmpeg-devel] [PATCH 1/3 v2] checkasm/takdsp: add decorrelate_sf test
Martin Storsjö
martin at martin.st
Fri Dec 22 14:16:30 EET 2023
On Fri, 22 Dec 2023, James Almer wrote:
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
> Fixes broken logic as reported by Martin.
>
> tests/checkasm/takdsp.c | 35 ++++++++++++++++++++++++++++++++---
> 1 file changed, 32 insertions(+), 3 deletions(-)
> +static void test_decorrelate_sf(TAKDSPContext *s) {
> + declare_func(void, int32_t *, int32_t *, int, int, int);
> +
> + if (check_func(s->decorrelate_sf, "decorrelate_sf")) {
> + LOCAL_ALIGNED_32(int32_t, p1, [BUF_SIZE]);
> + LOCAL_ALIGNED_32(int32_t, p1_2, [BUF_SIZE]);
> + LOCAL_ALIGNED_32(int32_t, p2, [BUF_SIZE]);
> + int dshift, dfactor;
> +
> + randomize(p1, BUF_SIZE);
> + memcpy(p1_2, p1, BUF_SIZE * sizeof(*p1));
> + randomize(p2, BUF_SIZE);
> + dshift = (rnd() & 0xF) + 1;
> + dfactor = sign_extend(rnd(), 10);
> +
> + call_ref(p1, p2, BUF_SIZE, dshift, dfactor);
> + call_new(p1_2, p2, BUF_SIZE, dshift, dfactor);
> +
> + if (memcmp(p1, p1_2, BUF_SIZE) != 0) {
This still needs a *sizeof(*p1)
Other than that, this looks good, thanks!
// Martin
More information about the ffmpeg-devel
mailing list