Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-05-07 05:12:13 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-05-12 07:00:14 +0300
commitb43e946b71e144a4ce5e83cd18e5a07155edb26f (patch)
treedf26ccfbe9cbe32a334db8cd50bc8acdddfcde00 /libavcodec/jpeg2000dec.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/jpeg2000dec.c')
-rw-r--r--libavcodec/jpeg2000dec.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 5364631432..1295c96305 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -2476,7 +2476,6 @@ static int jp2_find_codestream(Jpeg2000DecoderContext *s)
static av_cold void jpeg2000_init_static_data(void)
{
ff_jpeg2000_init_tier1_luts();
- ff_mqc_init_context_tables();
}
static av_cold int jpeg2000_decode_init(AVCodecContext *avctx)