Mercurial > libavcodec.hg
comparison mpegaudio_tablegen.h @ 11707:eb9e142ea51f libavcodec
float based mp1/mp2/mp3 decoders.
author | michael |
---|---|
date | Tue, 11 May 2010 19:52:42 +0000 |
parents | 64c8bc5340bd |
children | a1b4029b2465 |
comparison
equal
deleted
inserted
replaced
11706:15e7486e5c7a | 11707:eb9e142ea51f |
---|---|
35 #else | 35 #else |
36 static int8_t table_4_3_exp[TABLE_4_3_SIZE]; | 36 static int8_t table_4_3_exp[TABLE_4_3_SIZE]; |
37 static uint32_t table_4_3_value[TABLE_4_3_SIZE]; | 37 static uint32_t table_4_3_value[TABLE_4_3_SIZE]; |
38 static uint32_t exp_table[512]; | 38 static uint32_t exp_table[512]; |
39 static uint32_t expval_table[512][16]; | 39 static uint32_t expval_table[512][16]; |
40 static float exp_table_float[512]; | |
41 static float expval_table_float[512][16]; | |
40 | 42 |
41 static void mpegaudio_tableinit(void) | 43 static void mpegaudio_tableinit(void) |
42 { | 44 { |
43 int i, value, exponent; | 45 int i, value, exponent; |
44 for (i = 1; i < TABLE_4_3_SIZE; i++) { | 46 for (i = 1; i < TABLE_4_3_SIZE; i++) { |
56 } | 58 } |
57 for (exponent = 0; exponent < 512; exponent++) { | 59 for (exponent = 0; exponent < 512; exponent++) { |
58 for (value = 0; value < 16; value++) { | 60 for (value = 0; value < 16; value++) { |
59 double f = (double)value * cbrtf(value) * pow(2, (exponent - 400) * 0.25 + FRAC_BITS + 5); | 61 double f = (double)value * cbrtf(value) * pow(2, (exponent - 400) * 0.25 + FRAC_BITS + 5); |
60 expval_table[exponent][value] = llrint(f); | 62 expval_table[exponent][value] = llrint(f); |
63 expval_table_float[exponent][value] = f; | |
61 } | 64 } |
62 exp_table[exponent] = expval_table[exponent][1]; | 65 exp_table[exponent] = expval_table[exponent][1]; |
66 exp_table_float[exponent] = expval_table_float[exponent][1]; | |
63 } | 67 } |
64 } | 68 } |
65 #endif /* CONFIG_HARDCODED_TABLES */ | 69 #endif /* CONFIG_HARDCODED_TABLES */ |
66 | 70 |
67 #endif /* MPEGAUDIO_TABLEGEN_H */ | 71 #endif /* MPEGAUDIO_TABLEGEN_H */ |