summaryrefslogtreecommitdiff
path: root/libavcodec/rl.h
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-05-08 01:11:06 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-01-09 09:38:43 +0100
commit938251c878d46aef001da2527fb7234b9f2f83ea (patch)
tree8ee6169eb76842da4a3fdd1a1f75aab0ca02c45f /libavcodec/rl.h
parent832ead2ec40392e73422f9a9d3ab1f21ea025207 (diff)
downloadffmpeg-938251c878d46aef001da2527fb7234b9f2f83ea.tar.gz
avcodec/rl: Don't pretend ff_rl_init() initializes a RLTable twice
It can't any longer, because all users of ff_rl_init() are now behind ff_thread_once() or the global codec lock. Therefore the check for whether the RLTable is already initialized can be removed; as can the stack buffers that existed to make sure that nothing is ever set to a value different from its final value. Similarly, it is not necessary to check whether the VLCs associated with the RLTable are already initialized (they aren't). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/rl.h')
-rw-r--r--libavcodec/rl.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/libavcodec/rl.h b/libavcodec/rl.h
index 5aae698e31..07e3da5003 100644
--- a/libavcodec/rl.h
+++ b/libavcodec/rl.h
@@ -72,15 +72,12 @@ void ff_rl_init_vlc(RLTable *rl, unsigned static_size);
#define INIT_VLC_RL(rl, static_size)\
{\
- int q;\
static RL_VLC_ELEM rl_vlc_table[32][static_size];\
\
- if(!rl.rl_vlc[0]){\
- for(q=0; q<32; q++)\
- rl.rl_vlc[q]= rl_vlc_table[q];\
+ for (int q = 0; q < 32; q++) \
+ rl.rl_vlc[q] = rl_vlc_table[q]; \
\
- ff_rl_init_vlc(&rl, static_size);\
- }\
+ ff_rl_init_vlc(&rl, static_size); \
}
#define INIT_FIRST_VLC_RL(rl, static_size) \