diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-11-18 13:13:45 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-12-08 17:51:47 +0100 |
commit | d5d1c697bd0844a676eeb7761b130b6dd951edee (patch) | |
tree | b48866794f78373e136d839713a06dd0f8c39c82 /libavcodec/mpegaudiodata.h | |
parent | ed33bbe678730ef1ffde77f20eb4c6afb7a6902c (diff) |
avcodec/mpegaudio_tablegen: Make exponential LUT shared
Both the fixed as well as the floating point mpegaudio decoders use
LUTs of type int8_t and uint32_t with 32K entries each; these tables
are completely the same, yet they are not shared. This commit makes
them shared. When both fixed as well as floating point decoders are
enabled, this saves 160KiB from the bss segment for a normal build
(translating into 160KiB less memory usage if both a shared as well as
a floating point decoder have actually been used) and 160KiB from the
binary for a build with hardcoded tables.
It also means that the code to create said LUTs is no longer duplicated
(for a normal build).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/mpegaudiodata.h')
-rw-r--r-- | libavcodec/mpegaudiodata.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/mpegaudiodata.h b/libavcodec/mpegaudiodata.h index 01b1f88cd0..0a425ef6a8 100644 --- a/libavcodec/mpegaudiodata.h +++ b/libavcodec/mpegaudiodata.h @@ -29,6 +29,8 @@ #include <stdint.h> +#include "config.h" + #include "internal.h" #include "vlc.h" @@ -42,6 +44,15 @@ extern const int ff_mpa_quant_steps[17]; extern const int ff_mpa_quant_bits[17]; extern const unsigned char * const ff_mpa_alloc_tables[5]; +#define TABLE_4_3_SIZE ((8191 + 16)*4) +#if CONFIG_HARDCODED_TABLES +extern const int8_t ff_table_4_3_exp [TABLE_4_3_SIZE]; +extern const uint32_t ff_table_4_3_value[TABLE_4_3_SIZE]; +#else +extern int8_t ff_table_4_3_exp [TABLE_4_3_SIZE]; +extern uint32_t ff_table_4_3_value[TABLE_4_3_SIZE]; +#endif + /* VLCs for decoding layer 3 huffman tables */ extern VLC ff_huff_vlc[16]; extern VLC ff_huff_quad_vlc[2]; |