diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-12-10 04:32:17 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-04-27 00:40:18 +0200 |
commit | d99707b42a55b2fcfc17b8c9bf3f38c1879dbaa7 (patch) | |
tree | eadd12b2001dee25c4accb123d7b881173306645 /libavcodec/mpeg4video.h | |
parent | fea1f42e5f82db01ef3eec6ee8b0862944a5e319 (diff) | |
download | ffmpeg-d99707b42a55b2fcfc17b8c9bf3f38c1879dbaa7.tar.gz |
avcodec/mpeg4video: Make initializing RLTable thread-safe
Up until now the RLTable ff_mpeg4_rl_intra was initialized by both mpeg4
decoder and encoder (except the VLCs that are only used by the decoder).
This is an obstacle to making these codecs init-threadsafe, so move
initializing this to a single function that is guarded by a dedicated
AVOnce.
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/mpeg4video.h')
-rw-r--r-- | libavcodec/mpeg4video.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h index e919db87a5..3db6f85153 100644 --- a/libavcodec/mpeg4video.h +++ b/libavcodec/mpeg4video.h @@ -129,6 +129,7 @@ extern const int8_t ff_mpeg4_intra_level[102]; extern const int8_t ff_mpeg4_intra_run[102]; extern RLTable ff_mpeg4_rl_intra; +void ff_mpeg4_init_rl_intra(void); /* Note this is identical to the intra rvlc except that it is reordered. */ extern RLTable ff_rvlc_rl_inter; @@ -180,8 +181,6 @@ int ff_mpeg4_frame_end(AVCodecContext *avctx, const uint8_t *buf, int buf_size); */ int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my); -extern uint8_t ff_mpeg4_static_rl_table_store[3][2][2 * MAX_RUN + MAX_LEVEL + 3]; - #if 0 //3IV1 is quite rare and it slows things down a tiny bit #define IS_3IV1 s->codec_tag == AV_RL32("3IV1") #else |