[FFmpeg-cvslog] r15404 - trunk/libavcodec/ra288.c

Michael Niedermayer michaelni
Thu Sep 25 03:16:34 CEST 2008


On Wed, Sep 24, 2008 at 10:31:24PM +0200, vitor wrote:
> Author: vitor
> Date: Wed Sep 24 22:31:24 2008
> New Revision: 15404
> 
> Log:
> Move constant multiplication out of the loop
> 
> 
> Modified:
>    trunk/libavcodec/ra288.c
> 
> Modified: trunk/libavcodec/ra288.c
> ==============================================================================
> --- trunk/libavcodec/ra288.c	(original)
> +++ trunk/libavcodec/ra288.c	Wed Sep 24 22:31:24 2008
> @@ -96,12 +96,12 @@ static void decode(RA288Context *ractx, 
>  
>      /* block 48 of G.728 spec */
>      /* exp(sum * 0.1151292546497) == pow(10.0,sum/20) */
> -    sumsum = exp(sum * 0.1151292546497) * gain / 2048.;
> +    sumsum = exp(sum * 0.1151292546497) * gain / (2048 * 4096);

* (1.0/(1<<23)) [or 2048*4096 if you prefer]


>  
>      for (i=0; i < 5; i++)
>          buffer[i] = codetable[cb_coef][i] * sumsum;
>  
> -    sum = scalar_product_float(buffer, buffer, 5) / 5;
> +    sum = (4096 * 4096) * scalar_product_float(buffer, buffer, 5) / 5;

* ((1<<24)/5.0)


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20080925/6cf867fa/attachment.pgp>



More information about the ffmpeg-cvslog mailing list