diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-11-18 02:19:53 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-12-08 17:51:47 +0100 |
commit | ed33bbe678730ef1ffde77f20eb4c6afb7a6902c (patch) | |
tree | a46f589b105fca7f4290023d17474e12e98ad01e /libavcodec/mips | |
parent | 12e941df89aa0e2aa8c6b90bfef9d4127ae7063c (diff) | |
download | ffmpeg-ed33bbe678730ef1ffde77f20eb4c6afb7a6902c.tar.gz |
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>
Diffstat (limited to 'libavcodec/mips')
-rw-r--r-- | libavcodec/mips/compute_antialias_fixed.h | 3 | ||||
-rw-r--r-- | libavcodec/mips/compute_antialias_float.h | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/mips/compute_antialias_fixed.h b/libavcodec/mips/compute_antialias_fixed.h index a967f67de7..1f395d2302 100644 --- a/libavcodec/mips/compute_antialias_fixed.h +++ b/libavcodec/mips/compute_antialias_fixed.h @@ -59,7 +59,8 @@ static void compute_antialias_mips_fixed(MPADecodeContext *s, GranuleDef *g) { - int32_t *ptr, *csa; + const int32_t *csa; + int32_t *ptr; int n, i; int MAX_lo = 0xffffffff; diff --git a/libavcodec/mips/compute_antialias_float.h b/libavcodec/mips/compute_antialias_float.h index e2b4f29f4a..633eb9589d 100644 --- a/libavcodec/mips/compute_antialias_float.h +++ b/libavcodec/mips/compute_antialias_float.h @@ -63,7 +63,7 @@ static void compute_antialias_mips_float(MPADecodeContext *s, GranuleDef *g) { float *ptr, *ptr_end; - float *csa = &csa_table[0][0]; + const float *csa = &csa_table[0][0]; /* temporary variables */ float in1, in2, in3, in4, in5, in6, in7, in8; float out1, out2, out3, out4; |