diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-12-10 06:39:41 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-04-27 00:43:51 +0200 |
commit | 1d5d666601b6dc9319f8a539c40d016e3aef932e (patch) | |
tree | 239eaae24015fd055db8140d25ad6857fd481470 /libavcodec/msmpeg4enc.c | |
parent | 0d30c04e5d1414b402a3ea45e586b955a286333e (diff) | |
download | ffmpeg-1d5d666601b6dc9319f8a539c40d016e3aef932e.tar.gz |
avcodec/msmpeg4: Factor out common RLTable initialization code
Up until now, both the msmpeg4 decoders and encoders initialized several
RLTables common to them (the decoders also initialized the VLCs of these
RLTables). This is an obstacle to making these codecs init-threadsafe.
So move this initialization to ff_msmpeg4_common_init() that already
contains this initialization code. This allows to reuse the AVOnce used
for initializing ff_v2_dc_lum/chroma_table which automatically makes
initializing these RLTables thread-safe.
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/msmpeg4enc.c')
-rw-r--r-- | libavcodec/msmpeg4enc.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/libavcodec/msmpeg4enc.c b/libavcodec/msmpeg4enc.c index 7147015042..e22e8107ad 100644 --- a/libavcodec/msmpeg4enc.c +++ b/libavcodec/msmpeg4enc.c @@ -131,9 +131,6 @@ av_cold void ff_msmpeg4_encode_init(MpegEncContext *s) init_mv_table(&ff_mv_tables[0], mv_index_tables[0]); init_mv_table(&ff_mv_tables[1], mv_index_tables[1]); - for(i=0;i<NB_RL_TABLES;i++) - ff_rl_init(&ff_rl_table[i], ff_static_rl_table_store[i]); - for(i=0; i<NB_RL_TABLES; i++){ int level; for (level = 1; level <= MAX_LEVEL; level++) { |