30 for (i = 0; i < 2; i++) {
49 for (last = 0; last < 2; last++) {
58 memset(max_level, 0,
MAX_RUN + 1);
60 memset(index_run, rl->
n,
MAX_RUN + 1);
61 for (i = start; i <
end; i++) {
64 if (index_run[run] == rl->
n)
66 if (level > max_level[run])
68 if (run > max_run[level])
94 memcpy(rl->
index_run[last], index_run, MAX_RUN + 1);
107 VLC vlc = { .
table =
table, .table_allocated = static_size };
111 for (q = 0; q < 32; q++) {
113 int qadd = (q - 1) | 1;
120 int code = vlc.
table[i][0];
127 }
else if (len < 0) {
137 if (code >= rl->
last) run += 192;
int last
number of values for last = 0
memory handling functions
const int8_t * table_level
Macro definitions for various function/variable attributes.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int8_t * max_run[2]
encoding & decoding
static av_cold int end(AVCodecContext *avctx)
int8_t * max_level[2]
encoding & decoding
static const struct endianess table[]
int n
number of entries of table_vlc minus 1
const uint16_t(* table_vlc)[2]
#define INIT_VLC_USE_NEW_STATIC
void ff_rl_free(RLTable *rl)
Free the contents of a dynamically allocated table.
RL_VLC_ELEM * rl_vlc[32]
decoding only
#define FF_ARRAY_ELEMS(a)
#define init_vlc(vlc, nb_bits, nb_codes,bits, bits_wrap, bits_size,codes, codes_wrap, codes_size,flags)
av_cold int ff_rl_init(RLTable *rl, uint8_t static_store[2][2 *MAX_RUN+MAX_LEVEL+3])
uint8_t * index_run[2]
encoding only
VLC_TYPE(* table)[2]
code, bits
av_cold void ff_rl_init_vlc(RLTable *rl, unsigned static_size)