[FFmpeg-devel] [PATCH 1/2] avcodec/aactab: do not use floats for constants

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Mar 6 12:30:19 CET 2016


On Sun, Mar 06, 2016 at 12:18:48PM +0100, Marton Balint wrote:
> This may improve precision for some compilers and architectures.
> 
> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
>  libavcodec/aactab.h | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/libavcodec/aactab.h b/libavcodec/aactab.h
> index b48e7da..a0d44a2 100644
> --- a/libavcodec/aactab.h
> +++ b/libavcodec/aactab.h
> @@ -92,8 +92,8 @@ static inline void ff_aac_tableinit(void)
>   * Table of the LTP coefficients
>   */
>  static const INTFLOAT ltp_coef[8] = {
> -    Q30(0.570829f), Q30(0.696616f), Q30(0.813004f), Q30(0.911304f),
> -    Q30(0.984900f), Q30(1.067894f), Q30(1.194601f), Q30(1.369533f),
> +    Q30(0.570829), Q30(0.696616), Q30(0.813004), Q30(0.911304),
> +    Q30(0.984900), Q30(1.067894), Q30(1.194601), Q30(1.369533),

I haven't tested it, but you might need to add a cast then
to the float variant (or have the macro append the f).
Some compilers don't like when you initialize a float variable
with a value not representable as float.


More information about the ffmpeg-devel mailing list