MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / mpegaudio_tableinit

Function mpegaudio_tableinit

libavcodec/mpegaudio_tablegen.h:41–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39static uint32_t expval_table[512][16];
40
41static void mpegaudio_tableinit(void)
42{
43 int i, value, exponent;
44 for (i = 1; i < TABLE_4_3_SIZE; i++) {
45 double value = i / 4;
46 double f, fm;
47 int e, m;
48 f = value * cbrtf(value) * pow(2, (i & 3) * 0.25);
49 fm = frexp(f, &e);
50 m = (uint32_t)(fm * (1LL << 31) + 0.5);
51 e += FRAC_BITS - 31 + 5 - 100;
52
53 /* normalized to FRAC_BITS */
54 table_4_3_value[i] = m;
55 table_4_3_exp[i] = -e;
56 }
57 for (exponent = 0; exponent < 512; exponent++) {
58 for (value = 0; value < 16; value++) {
59 double f = (double)value * cbrtf(value) * pow(2, (exponent - 400) * 0.25 + FRAC_BITS + 5);
60 expval_table[exponent][value] = llrint(f);
61 }
62 exp_table[exponent] = expval_table[exponent][1];
63 }
64}
65#endif /* CONFIG_HARDCODED_TABLES */
66
67#endif /* MPEGAUDIO_TABLEGEN_H */

Callers 2

mainFunction · 0.85
decode_initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected