]> git.sesse.net Git - ffmpeg/commit
avcodec/msmpeg4: Factor out common RLTable initialization code
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 10 Dec 2020 05:39:41 +0000 (06:39 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Mon, 26 Apr 2021 22:43:51 +0000 (00:43 +0200)
commit1d5d666601b6dc9319f8a539c40d016e3aef932e
tree239eaae24015fd055db8140d25ad6857fd481470
parent0d30c04e5d1414b402a3ea45e586b955a286333e
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>
libavcodec/msmpeg4.c
libavcodec/msmpeg4data.c
libavcodec/msmpeg4data.h
libavcodec/msmpeg4dec.c
libavcodec/msmpeg4enc.c