[FFmpeg-soc] [soc]: r4945 - amr/amrnbdec.c

Colin McQuillan m.niloc at googlemail.com
Wed Aug 5 17:48:51 CEST 2009


2009/8/5 Vitor Sessak <vitor1001 at gmail.com>:
> cmcq wrote:
>>
>> Author: cmcq
>> Date: Wed Aug  5 14:50:55 2009
>> New Revision: 4945
>>
>> Log:
>> sqrt is faster than log by about five times (or 2.5 times with libimf)
>> test program:
>
> [...]
>
>>     energy_pred = ff_dot_productf(energy_pred_fac, prev_pred_error, 4);
>>  -    energy_fixed_mean = ff_energyf(fixed_vector, AMR_SUBFRAME_SIZE);
>> -    energy_fixed_mean = 10.0 * log10f(energy_fixed_mean /
>> AMR_SUBFRAME_SIZE);
>> +    energy_fixed_mean = sqrt(ff_energyf(fixed_vector, AMR_SUBFRAME_SIZE)
>> /
>> +                             AMR_SUBFRAME_SIZE);
>>  -    return powf(10.0, 0.05 * (energy_pred + energy_mean[mode] -
>> -                              energy_fixed_mean));
>> +    return powf(10.0, 0.05 * (energy_pred + energy_mean[mode])) /
>> +        energy_fixed_mean;
>
> If you do
>
> return expf(logf(10.0) * 0.05 * (energy_pred + energy_mean[mode])) /
>            energy_fixed_mean;
>
> it will be probably faster (logf(10.0)*0.05 will be evaluated at
> compile-time).

Done - exp2f was a bit faster still. The amazing thing is that Intel's
libimf is four times as fast at exp2f as glibc (which calls x86's
f2xm1)


More information about the FFmpeg-soc mailing list