summaryrefslogtreecommitdiff
path: root/libavcodec/rl.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-05-30 21:08:41 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-05-30 21:08:41 +0000
commitceaaf78bb758396657a77811a3c38478843afad0 (patch)
tree10aa937648a23fe3b5086f8c4e9c2393b6090ab2 /libavcodec/rl.h
parent2d80ce2bdf8241ff67e00118ef00d47e7f0dbb5d (diff)
Change init_vlc_rl() so it does not use *alloc_static() anymore.
Originally committed as revision 13567 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/rl.h')
-rw-r--r--libavcodec/rl.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/libavcodec/rl.h b/libavcodec/rl.h
index 03d2e56e4f..d71d3711bd 100644
--- a/libavcodec/rl.h
+++ b/libavcodec/rl.h
@@ -54,7 +54,23 @@ typedef struct RLTable {
* the level and run tables, if this is NULL av_malloc() will be used
*/
void init_rl(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 3]);
-void init_vlc_rl(RLTable *rl, int use_static);
+void init_vlc_rl(RLTable *rl);
+
+#define INIT_VLC_RL(rl, static_size)\
+{\
+ int q;\
+ static RL_VLC_ELEM rl_vlc_table[32][static_size];\
+ INIT_VLC_STATIC(&rl.vlc, 9, rl.n + 1,\
+ &rl.table_vlc[0][1], 4, 2,\
+ &rl.table_vlc[0][0], 4, 2, static_size);\
+\
+ if(!rl.rl_vlc[0]){\
+ for(q=0; q<32; q++)\
+ rl.rl_vlc[q]= rl_vlc_table[q];\
+\
+ init_vlc_rl(&rl);\
+ }\
+}
static inline int get_rl_index(const RLTable *rl, int last, int run, int level)
{