# HG changeset patch # User mru # Date 1263241286 0 # Node ID e8f4b9e41b7ac30a8f162d1d428462cfbdf129a5 # Parent b4aca3bfff0f6cea0255e3ea8ce3173a6dc20609 AAC: use table for cbrtf(n)*n The maximum length of escape_sequence is 21 bits, so adjust limit in code to match this. Up to 10% faster on Cortex-A8. diff -r b4aca3bfff0f -r e8f4b9e41b7a aac.c --- a/aac.c Mon Jan 11 18:02:00 2010 +0000 +++ b/aac.c Mon Jan 11 20:21:26 2010 +0000 @@ -101,6 +101,7 @@ static VLC vlc_scalefactors; static VLC vlc_spectral[11]; +static float cbrt_tab[1<<13]; static ChannelElement *get_che(AACContext *ac, int type, int elem_id) { @@ -555,6 +556,10 @@ ff_init_ff_sine_windows(10); ff_init_ff_sine_windows( 7); + if (!cbrt_tab[(1<<13) - 1]) + for (i = 0; i < 1<<13; i++) + cbrt_tab[i] = cbrtf(i) * i; + return 0; } @@ -949,7 +954,7 @@ return -1; } n = (1 << n) + get_bits(gb, n); - coef[coef_tmp_idx + j] *= cbrtf(n) * n; + coef[coef_tmp_idx + j] *= cbrt_tab[n]; } else coef[coef_tmp_idx + j] *= vq_ptr[j]; }