mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-22 06:50:12 +01:00
avcodec/mpegaudiodec: Hardcode tables to save space
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>
This commit is contained in:
@@ -396,10 +396,6 @@ const uint8_t ff_mpa_pretab[2][22] = {
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 2, 0 },
|
||||
};
|
||||
|
||||
const float ff_ci_table[8] = {
|
||||
-0.6, -0.535, -0.33, -0.185, -0.095, -0.041, -0.0142, -0.0037,
|
||||
};
|
||||
|
||||
static av_cold void mpegaudiodec_common_init_static(void)
|
||||
{
|
||||
const uint8_t *huff_sym = mpa_huffsymbols, *huff_lens = mpa_hufflens;
|
||||
|
||||
Reference in New Issue
Block a user