10 #include "bitstream.h"
11 #include "mpegvideo.h"
14 typedef struct RLTable {
15 int n; ///< number of entries of table_vlc minus 1
16 int last; ///< number of values for last = 0
17 const uint16_t (*table_vlc)[2];
18 const int8_t *table_run;
19 const int8_t *table_level;
20 uint8_t *index_run[2]; ///< encoding only
21 int8_t *max_level[2]; ///< encoding & decoding
22 int8_t *max_run[2]; ///< encoding & decoding
23 VLC vlc; ///< decoding only deprected FIXME remove
24 RL_VLC_ELEM *rl_vlc[32]; ///< decoding only
29 * @param static_store static uint8_t array[2][2*MAX_RUN + MAX_LEVEL + 3] which will hold
30 * the level and run tables, if this is NULL av_malloc() will be used
32 void init_rl(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 3]);
33 void init_vlc_rl(RLTable *rl, int use_static);
35 static inline int get_rl_index(const RLTable *rl, int last, int run, int level)
38 index = rl->index_run[last][run];
41 if (level > rl->max_level[last][run])
43 return index + level - 1;