[FFmpeg-devel] [PATCH] Move tables initialisation and handling into ac3enc_tables.c
Aurelien Jacobs
aurel
Sat Jan 12 18:02:59 CET 2008
Diego 'Flameeyes' Petten? wrote:
>
> The attached patch moves the declaration and the initialisation of
> tables, as well as the include of the hardcoded tables, on a separate
> C file. The next patch will add tables generation code to that file.
>
> [...]
>
> +static inline int16_t fix15(float a)
> +{
> + int v;
> + v = (int)(a * (float)(1 << 15));
> + if (v < -32767)
> + v = -32767;
> + else if (v > 32767)
> + v = 32767;
> + return v;
> +}
Unrelated to this patch, but I wondered if clipping to -32767 was
intentional. I guess yes, but just in case it could be clipped to
-32768 instead, av_clip_int16() could be used.
Aurel
More information about the ffmpeg-devel
mailing list