[FFmpeg-devel] [PATCH 02/39] avcodec/mpeg12: Don't initialize encoder-only parts of RLTable

Anton Khirnov anton at khirnov.net
Wed Dec 30 19:36:50 EET 2020


Quoting Andreas Rheinhardt (2020-12-10 12:16:20)
> ff_mpeg12_init_vlcs() currently initializes index_run, max_level and
> max_run of ff_rl_mpeg1/2; yet the only user of these fields is the
> MPEG-1/2 encoder which already initializes these tables on its own.
> So remove the initializations in ff_mpeg12_init_vlcs(); this also
> simplifies making ff_mpeg12_init_vlcs() thread-safe.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> ---
>  libavcodec/mpeg12.c    | 4 ----
>  libavcodec/mpeg12.h    | 2 --
>  libavcodec/mpeg12enc.c | 6 ++++--
>  3 files changed, 4 insertions(+), 8 deletions(-)

Looks good, thought it's really confusing how rl_vlc is initialized both
by ff_rl_init() and by INIT_2D_VLC_RL()

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list