summaryrefslogtreecommitdiff
path: root/libavcodec/mpegaudiodec_common.c
Commit message (Collapse)AuthorAge
* avcodec/mpegaudio_tablegen: Make exponential LUT sharedAndreas Rheinhardt2020-12-08
| | | | | | | | | | | | | | | | 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>
* avcodec/mpegaudiodec: Hardcode tables to save spaceAndreas Rheinhardt2020-12-08
| | | | | | | | | | | | | | | | | | | The csa_tables (which always consist of 32 entries of four byte each, but the type depends upon whether the decoder is fixed or floating-point) are currently initialized once during decoder initialization; yet it turns out that this is actually no benefit: The code used to initialize these tables takes up 153 (fixed point) and 122 (floating point) bytes when compiled with GCC 9.3 with -O3 on x64, so it is better to just hardcode these tables. Essentially the same applies to the is_tables: They have a size of 128B each and the code to initialize them occupies 149 (fixed point) resp. 140 (floating point) bytes. So hardcode them, too. To make the origin of the tables clear, references to the code used to create them have been added. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpegaudiodec: Share fixed and floating point data and init codeAndreas Rheinhardt2020-12-08
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>