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

Vitor Sessak vitor1001
Thu Sep 25 22:04:08 CEST 2008


Michael Niedermayer wrote:
> 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)

Both done.

-Vitor




More information about the ffmpeg-cvslog mailing list