[FFmpeg-cvslog] r24213 - trunk/libavcodec/dca.c

Vitor Sessak vitor1001
Mon Jul 12 17:13:50 CEST 2010


On 07/12/2010 02:32 PM, benoit wrote:
> Author: benoit
> Date: Mon Jul 12 14:32:24 2010
> New Revision: 24213
>
> Log:
> Use math constant instead of hardcoded rounded value for sqrt(0.5).
> Patch by Christophe.Gisquet (gmail)
>
> Modified:
>     trunk/libavcodec/dca.c
>
> Modified: trunk/libavcodec/dca.c
> ==============================================================================
> --- trunk/libavcodec/dca.c	Mon Jul 12 12:17:20 2010	(r24212)
> +++ trunk/libavcodec/dca.c	Mon Jul 12 14:32:24 2010	(r24213)
> @@ -1403,8 +1403,8 @@ static int dca_decode_frame(AVCodecConte
>               float* rt_chan   = s->samples + s->channel_order_tab[s->xch_base_channel - 1] * 256;
>               int j;
>               for(j = 0; j<  256; ++j) {
> -                lt_chan[j] -= (back_chan[j] - s->add_bias) * 0.707107f;
> -                rt_chan[j] -= (back_chan[j] - s->add_bias) * 0.707107f;
> +                lt_chan[j] -= (back_chan[j] - s->add_bias) * M_SQRT1_2;
> +                rt_chan[j] -= (back_chan[j] - s->add_bias) * M_SQRT1_2;

Won't this patch make it use double-precision floating point math when 
not needed?

-Vitor



More information about the ffmpeg-cvslog mailing list