27 #ifndef AVCODEC_RANGECODER_H
28 #define AVCODEC_RANGECODER_H
55 while (c->
range < 0x100) {
58 }
else if (c->
low <= 0xFF00) {
63 }
else if (c->
low >= 0x10000) {
72 c->
low = (c->
low & 0xFF) << 8;
87 int range1 = (c->
range * (*state)) >> 8;
106 if (c->
range < 0x100) {
117 int range1 = (c->
range * (*state)) >> 8;
134 int one_mask one_mask = (c->
range - c->
low - 1) >> 31;
139 *state = c->
zero_state[(*state) + (256 & one_mask)];
static int get_rac(RangeCoder *c, uint8_t *const state)
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
void ff_init_range_encoder(RangeCoder *c, uint8_t *buf, int buf_size)
void ff_build_rac_states(RangeCoder *c, int factor, int max_p)
static void put_rac(RangeCoder *c, uint8_t *const state, int bit)
static void renorm_encoder(RangeCoder *c)
simple assert() macros that are a bit more flexible than ISO C assert().
static void refill(RangeCoder *c)
void ff_init_range_decoder(RangeCoder *c, const uint8_t *buf, int buf_size)
int ff_rac_terminate(RangeCoder *c)
static int get_rac_count(RangeCoder *c)
static const int factor[16]
common internal and external API header
uint8_t * bytestream_start