[FFmpeg-devel] [PATCH] checkasm/ac3dsp: add float_to_fixed24 test

James Almer jamrial at gmail.com
Thu Nov 23 19:11:58 EET 2023


On 11/23/2023 4:08 AM, flow gg wrote:
> +static void check_float_to_fixed24(AC3DSPContext *c) {
> +#define BUF_SIZE 1024
> +    LOCAL_ALIGNED_32(int32_t, v1, [BUF_SIZE]);

This one is not necessary. You can reuse dst or dst2 for the bench() as 
it's write only.

> +    LOCAL_ALIGNED_32(float, v2, [BUF_SIZE]);
> +
> +    declare_func(void, int32_t *, const float *, unsigned int);
> +
> +    randomize_float(v2, BUF_SIZE);
> +
> +    if (check_func(c->float_to_fixed24, "float_to_fixed24")) {
> +        LOCAL_ALIGNED_32(int32_t, dst, [BUF_SIZE]);
> +        LOCAL_ALIGNED_32(int32_t, dst2, [BUF_SIZE]);
> +
> +        call_ref(dst, v2, BUF_SIZE);
> +        call_new(dst2, v2, BUF_SIZE);
> +
> +        if (memcmp(dst, dst2, sizeof(*dst) * 10) != 0)

BUF_SIZE instead of 10.

> +            fail();
> +
> +        bench_new(v1, v2, BUF_SIZE);
> +    }
> +
> +
> +    report("float_to_fixed24");
> +}



More information about the ffmpeg-devel mailing list