[FFmpeg-devel] [PATCH] checkasm: add flacdsp decorrelate tests

Henrik Gramner henrik at gramner.com
Thu Sep 17 10:43:31 CEST 2015


On Thu, Sep 17, 2015 at 12:02 AM, James Almer <jamrial at gmail.com> wrote:
> +#define randomize_buffers()                            \
> +    do {                                               \
> +        uint32_t r;                                    \
> +        int i, j;                                      \
> +        for (i = 0; i < BUF_SIZE; i += 4) {            \
> +            for (j = 0; j < channels; j++) {           \
> +                r = rnd() & (1 << (bits - 2)) - 1;     \
> +                AV_WN32A(ref_src[j] + i, r);           \
> +                AV_WN32A(new_src[j] + i, r);           \
> +            }                                          \
> +        }                                              \
> +    } while (0)

r could be declared and initialized at the same time.

> +    LOCAL_ALIGNED_16(uint8_t, ref_buf, [BUF_SIZE*MAX_CHANNELS]);
> +    LOCAL_ALIGNED_16(uint8_t, new_buf, [BUF_SIZE*MAX_CHANNELS]);
> +    uint8_t *ref_src[] = { &ref_buf[BUF_SIZE*0], &ref_buf[BUF_SIZE*1], &ref_buf[BUF_SIZE*2], &ref_buf[BUF_SIZE*3],
> +                           &ref_buf[BUF_SIZE*4], &ref_buf[BUF_SIZE*5], &ref_buf[BUF_SIZE*6], &ref_buf[BUF_SIZE*7] };
> +    uint8_t *new_src[] = { &new_buf[BUF_SIZE*0], &new_buf[BUF_SIZE*1], &new_buf[BUF_SIZE*2], &new_buf[BUF_SIZE*3],
> +                           &new_buf[BUF_SIZE*4], &new_buf[BUF_SIZE*5], &new_buf[BUF_SIZE*6], &new_buf[BUF_SIZE*7] };

Those could potentially be int32_t*, then you could avoid the typecast
later on. Not sure it that would actually makes things cleaner though,
so not a big deal.

Otherwise seems OK.


More information about the ffmpeg-devel mailing list