[FFmpeg-devel] [PATCH 1/5] AAC: use table for cbrtf(n)*n

Benjamin Larsson banan
Mon Jan 11 14:08:20 CET 2010


Mans Rullgard wrote:
> Up to 10% faster on Cortex-A8.
> ---
>  libavcodec/aac.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/libavcodec/aac.c b/libavcodec/aac.c
> index 2bb05b8..14849d4 100644
> --- a/libavcodec/aac.c
> +++ b/libavcodec/aac.c
> @@ -101,6 +101,7 @@ union float754 {
>  static VLC vlc_scalefactors;
>  static VLC vlc_spectral[11];
>  
> +static float cbrt_tab[1<<15];
>  
>  static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
>  {
> @@ -555,6 +556,9 @@ static av_cold int aac_decode_init(AVCodecContext *avccontext)
>      ff_init_ff_sine_windows(10);
>      ff_init_ff_sine_windows( 7);
>  
> +    for (i = 0; i < 1<<15; i++)
> +        cbrt_tab[i] = cbrtf(i) * i;
>   

This could use a if(!cbrt_tab[1<<15 -1]) test.

MvH
Benjamin Larsson





More information about the ffmpeg-devel mailing list