summaryrefslogtreecommitdiff
path: root/libavcodec/rl.h
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-12-08 22:38:05 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-01-25 14:51:53 +0100
commit8f04988e463f17d58ba5a52f09cf49231037bb6c (patch)
tree3a3a48f8b5334f6759dd2dece341949620e8176a /libavcodec/rl.h
parentf741bd06748d95f1fe45edf1c24e493216170c24 (diff)
downloadffmpeg-8f04988e463f17d58ba5a52f09cf49231037bb6c.tar.gz
avcodec/rl: Allow to create only a few VLC tables
It is not uncommon that only the first one is used; this is similar to ff_init_2d_vlc_rl(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/rl.h')
-rw-r--r--libavcodec/rl.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/rl.h b/libavcodec/rl.h
index a83debccf7..26e0b32a90 100644
--- a/libavcodec/rl.h
+++ b/libavcodec/rl.h
@@ -68,6 +68,14 @@ void ff_rl_init_vlc(RLTable *rl, unsigned static_size);
}\
}
+#define INIT_FIRST_VLC_RL(rl, static_size) \
+do { \
+ static RL_VLC_ELEM rl_vlc_table[static_size]; \
+ \
+ rl.rl_vlc[0] = rl_vlc_table; \
+ ff_rl_init_vlc(&rl, static_size); \
+} while (0)
+
static inline int get_rl_index(const RLTable *rl, int last, int run, int level)
{
int index;