summaryrefslogtreecommitdiff
path: root/libavcodec/j2kenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-05-07 04:12:13 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-05-12 06:00:14 +0200
commitb43e946b71e144a4ce5e83cd18e5a07155edb26f (patch)
treedf26ccfbe9cbe32a334db8cd50bc8acdddfcde00 /libavcodec/j2kenc.c
parent65462185721e3686e27f22e952485ffc4ebd6f97 (diff)
avcodec/mqc: Hardcode tables to save space
mqc currently initializes three arrays at runtime; each of them has 2 * 47 elements, one is uint16_t, two are uint8_t, so that their combined size is 8 * 47. The source data for these initializations is contained in an array of 47 elements of size six. Said array is only used in order to initialize the other arrays, so the savings are just 2 * 47B. Yet this is dwarfed by the size of the code for performing the initializations: It is 109B (GCC 10.2, x64, -O3 albeit in an av_cold function); this does not even include the size of the code in the callers. So just hardcode these tables. This also fixes a data race, because the encoder always initialized these tables during init, although they might already be used at the same time by already running encoder/decoder instances. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/j2kenc.c')
-rw-r--r--libavcodec/j2kenc.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c
index c51adadd13..17eb959d73 100644
--- a/libavcodec/j2kenc.c
+++ b/libavcodec/j2kenc.c
@@ -1780,7 +1780,6 @@ static av_cold int j2kenc_init(AVCodecContext *avctx)
}
ff_jpeg2000_init_tier1_luts();
- ff_mqc_init_context_tables();
init_luts();
init_quantization(s);