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@gmail.com>2020-12-08 22:25:23 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-12-31 13:11:59 +0300
commit6e8fcd9c5624c1a89e49803de9e10562ace61b6a (patch)
tree68007453ffc341058d2624de2bf1fb4b02ec8761 /libavcodec/mpeg12enc.c
parent1ead0c6388ba7f74ccb0c3e991a49600c92c877e (diff)
avcodec/mpeg12: Don't initialize encoder-only parts of RLTable
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. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/mpeg12enc.c')
-rw-r--r--libavcodec/mpeg12enc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index d399e9e75e..155971fecd 100644
--- a/libavcodec/mpeg12enc.c
+++ b/libavcodec/mpeg12enc.c
@@ -1041,8 +1041,10 @@ void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[8][64],
static av_cold void mpeg12_encode_init_static(void)
{
- ff_rl_init(&ff_rl_mpeg1, ff_mpeg12_static_rl_table_store[0]);
- ff_rl_init(&ff_rl_mpeg2, ff_mpeg12_static_rl_table_store[1]);
+ static uint8_t mpeg12_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3];
+
+ ff_rl_init(&ff_rl_mpeg1, mpeg12_static_rl_table_store[0]);
+ ff_rl_init(&ff_rl_mpeg2, mpeg12_static_rl_table_store[1]);
for (int i = 0; i < 64; i++) {
mpeg1_max_level[0][i] = ff_rl_mpeg1.max_level[0][i];