X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fmpegaudio_tablegen.h;h=9d056cb253480f4a488c29592060ae7430391aac;hb=c67278098def4438fc587744f5df1c147bc95dc3;hp=362b545e0f72ae13161a23be935fbf06cc40617e;hpb=eadaa00c6fe1752b0460aa0c94d3df47502c78df;p=ffmpeg diff --git a/libavcodec/mpegaudio_tablegen.h b/libavcodec/mpegaudio_tablegen.h index 362b545e0f7..9d056cb2534 100644 --- a/libavcodec/mpegaudio_tablegen.h +++ b/libavcodec/mpegaudio_tablegen.h @@ -31,38 +31,37 @@ #define TABLE_4_3_SIZE (8191 + 16)*4 #if CONFIG_HARDCODED_TABLES #define mpegaudio_tableinit() -#include "mpegaudio_tables.h" +#include "libavcodec/mpegaudio_tables.h" #else -static int8_t table_4_3_exp[TABLE_4_3_SIZE]; +static int8_t table_4_3_exp[TABLE_4_3_SIZE]; static uint32_t table_4_3_value[TABLE_4_3_SIZE]; static uint32_t exp_table[512]; static uint32_t expval_table[512][16]; static void mpegaudio_tableinit(void) { - int i; - for(i=1;i>4); - double f= value * cbrtf(value) * pow(2, (exponent-400)*0.25 + FRAC_BITS + 5); - expval_table[exponent][i&15]= llrint(f); - if((i&15)==1) - exp_table[exponent]= llrint(f); + for (exponent = 0; exponent < 512; exponent++) { + for (value = 0; value < 16; value++) { + double f = (double)value * cbrtf(value) * pow(2, (exponent - 400) * 0.25 + FRAC_BITS + 5); + expval_table[exponent][value] = llrint(f); + } + exp_table[exponent] = expval_table[exponent][1]; } } -#endif /* CONFIG_HARDCODED_TABLES && !TABLEGEN */ +#endif /* CONFIG_HARDCODED_TABLES */ #endif /* MPEGAUDIO_TABLEGEN_H */