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

Vitor Sessak vitor1001 at gmail.com
Wed Aug 5 17:09:34 CEST 2009


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).

-Vitor


More information about the FFmpeg-soc mailing list