annotate rl.h @ 5197:953a9fd3b5f5 libavcodec

Ignore .ho files.
author diego
date Mon, 02 Jul 2007 10:13:19 +0000
parents 4394344397d8
children e0e53ab5a77a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1106
1e39f273ecd6 per file doxy
michaelni
parents: 1098
diff changeset
1 /**
4667
b3f099adfb36 move RLTable stuff to its own header
michael
parents: 4327
diff changeset
2 * @file rl.h
b3f099adfb36 move RLTable stuff to its own header
michael
parents: 4327
diff changeset
3 * rl header.
1106
1e39f273ecd6 per file doxy
michaelni
parents: 1098
diff changeset
4 */
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2805
diff changeset
5
4667
b3f099adfb36 move RLTable stuff to its own header
michael
parents: 4327
diff changeset
6 #ifndef AVCODEC_RL_H
b3f099adfb36 move RLTable stuff to its own header
michael
parents: 4327
diff changeset
7 #define AVCODEC_RL_H
745
25d7fb7c89be better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents: 726
diff changeset
8
5162
4394344397d8 include all prerequisites in header files
mru
parents: 4668
diff changeset
9 #include <stdint.h>
4394344397d8 include all prerequisites in header files
mru
parents: 4668
diff changeset
10 #include "bitstream.h"
4394344397d8 include all prerequisites in header files
mru
parents: 4668
diff changeset
11 #include "mpegvideo.h"
4394344397d8 include all prerequisites in header files
mru
parents: 4668
diff changeset
12
1110
d4096635b7b9 doxy / cosmetics
michaelni
parents: 1106
diff changeset
13 /** RLTable. */
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
14 typedef struct RLTable {
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2805
diff changeset
15 int n; ///< number of entries of table_vlc minus 1
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2805
diff changeset
16 int last; ///< number of values for last = 0
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
17 const uint16_t (*table_vlc)[2];
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
18 const int8_t *table_run;
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
19 const int8_t *table_level;
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2805
diff changeset
20 uint8_t *index_run[2]; ///< encoding only
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2805
diff changeset
21 int8_t *max_level[2]; ///< encoding & decoding
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2805
diff changeset
22 int8_t *max_run[2]; ///< encoding & decoding
1110
d4096635b7b9 doxy / cosmetics
michaelni
parents: 1106
diff changeset
23 VLC vlc; ///< decoding only deprected FIXME remove
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2805
diff changeset
24 RL_VLC_ELEM *rl_vlc[32]; ///< decoding only
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
25 } RLTable;
986e461dc072 Initial revision
glantau
parents:
diff changeset
26
4668
1f1a0e67b961 kill av_mallocz_static() calls in init_rl()
michael
parents: 4667
diff changeset
27 /**
1f1a0e67b961 kill av_mallocz_static() calls in init_rl()
michael
parents: 4667
diff changeset
28 *
1f1a0e67b961 kill av_mallocz_static() calls in init_rl()
michael
parents: 4667
diff changeset
29 * @param static_store static uint8_t array[2][2*MAX_RUN + MAX_LEVEL + 3] which will hold
1f1a0e67b961 kill av_mallocz_static() calls in init_rl()
michael
parents: 4667
diff changeset
30 * the level and run tables, if this is NULL av_malloc() will be used
1f1a0e67b961 kill av_mallocz_static() calls in init_rl()
michael
parents: 4667
diff changeset
31 */
1f1a0e67b961 kill av_mallocz_static() calls in init_rl()
michael
parents: 4667
diff changeset
32 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
33 void init_vlc_rl(RLTable *rl, int use_static);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
34
243
a6519f773064 * using static instead of extern
kabi
parents: 239
diff changeset
35 static inline int get_rl_index(const RLTable *rl, int last, int run, int level)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
36 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
37 int index;
986e461dc072 Initial revision
glantau
parents:
diff changeset
38 index = rl->index_run[last][run];
986e461dc072 Initial revision
glantau
parents:
diff changeset
39 if (index >= rl->n)
986e461dc072 Initial revision
glantau
parents:
diff changeset
40 return rl->n;
986e461dc072 Initial revision
glantau
parents:
diff changeset
41 if (level > rl->max_level[last][run])
986e461dc072 Initial revision
glantau
parents:
diff changeset
42 return rl->n;
986e461dc072 Initial revision
glantau
parents:
diff changeset
43 return index + level - 1;
986e461dc072 Initial revision
glantau
parents:
diff changeset
44 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
45
3582
6310389a9688 Compile fix (for GCC<3.3) when encoders are disabled
gpoirier
parents: 3312
diff changeset
46 #endif