Mercurial > libavcodec.hg
annotate rl.h @ 5124:5f9cbdd466fe libavcodec
move codecs declarations from avcodec.h to allcodecs.h
author | aurel |
---|---|
date | Mon, 11 Jun 2007 16:05:32 +0000 |
parents | 1f1a0e67b961 |
children | 4394344397d8 |
rev | line source |
---|---|
1106 | 1 /** |
4667 | 2 * @file rl.h |
3 * rl header. | |
1106 | 4 */ |
2967 | 5 |
4667 | 6 #ifndef AVCODEC_RL_H |
7 #define AVCODEC_RL_H | |
745
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
726
diff
changeset
|
8 |
1110 | 9 /** RLTable. */ |
0 | 10 typedef struct RLTable { |
2967 | 11 int n; ///< number of entries of table_vlc minus 1 |
12 int last; ///< number of values for last = 0 | |
1064 | 13 const uint16_t (*table_vlc)[2]; |
14 const int8_t *table_run; | |
15 const int8_t *table_level; | |
2967 | 16 uint8_t *index_run[2]; ///< encoding only |
17 int8_t *max_level[2]; ///< encoding & decoding | |
18 int8_t *max_run[2]; ///< encoding & decoding | |
1110 | 19 VLC vlc; ///< decoding only deprected FIXME remove |
2967 | 20 RL_VLC_ELEM *rl_vlc[32]; ///< decoding only |
0 | 21 } RLTable; |
22 | |
4668 | 23 /** |
24 * | |
25 * @param static_store static uint8_t array[2][2*MAX_RUN + MAX_LEVEL + 3] which will hold | |
26 * the level and run tables, if this is NULL av_malloc() will be used | |
27 */ | |
28 void init_rl(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 3]); | |
2370
26560d4fdb1f
Memory leak fix patch by (Burkhard Plaum <plaum >at< ipf.uni-stuttgart )dot( de>)
michael
parents:
2327
diff
changeset
|
29 void init_vlc_rl(RLTable *rl, int use_static); |
0 | 30 |
243 | 31 static inline int get_rl_index(const RLTable *rl, int last, int run, int level) |
0 | 32 { |
33 int index; | |
34 index = rl->index_run[last][run]; | |
35 if (index >= rl->n) | |
36 return rl->n; | |
37 if (level > rl->max_level[last][run]) | |
38 return rl->n; | |
39 return index + level - 1; | |
40 } | |
41 | |
3582
6310389a9688
Compile fix (for GCC<3.3) when encoders are disabled
gpoirier
parents:
3312
diff
changeset
|
42 #endif |