Mercurial > libavcodec.hg
comparison rl.h @ 4667:b3f099adfb36 libavcodec
move RLTable stuff to its own header
author | michael |
---|---|
date | Wed, 14 Mar 2007 12:29:32 +0000 |
parents | mpegvideo.h@a9f4d5c92218 |
children | 1f1a0e67b961 |
comparison
equal
deleted
inserted
replaced
4666:c43d2a68ec57 | 4667:b3f099adfb36 |
---|---|
1 /** | |
2 * @file rl.h | |
3 * rl header. | |
4 */ | |
5 | |
6 #ifndef AVCODEC_RL_H | |
7 #define AVCODEC_RL_H | |
8 | |
9 /** RLTable. */ | |
10 typedef struct RLTable { | |
11 int n; ///< number of entries of table_vlc minus 1 | |
12 int last; ///< number of values for last = 0 | |
13 const uint16_t (*table_vlc)[2]; | |
14 const int8_t *table_run; | |
15 const int8_t *table_level; | |
16 uint8_t *index_run[2]; ///< encoding only | |
17 int8_t *max_level[2]; ///< encoding & decoding | |
18 int8_t *max_run[2]; ///< encoding & decoding | |
19 VLC vlc; ///< decoding only deprected FIXME remove | |
20 RL_VLC_ELEM *rl_vlc[32]; ///< decoding only | |
21 } RLTable; | |
22 | |
23 void init_rl(RLTable *rl, int use_static); | |
24 void init_vlc_rl(RLTable *rl, int use_static); | |
25 | |
26 static inline int get_rl_index(const RLTable *rl, int last, int run, int level) | |
27 { | |
28 int index; | |
29 index = rl->index_run[last][run]; | |
30 if (index >= rl->n) | |
31 return rl->n; | |
32 if (level > rl->max_level[last][run]) | |
33 return rl->n; | |
34 return index + level - 1; | |
35 } | |
36 | |
37 #endif |