26#ifndef AVCODEC_VPX_RAC_H
27#define AVCODEC_VPX_RAC_H
53 if (
c->end <=
c->buffer &&
c->bits >= 0)
55 return c->end_reached > 10;
62 unsigned int code_word =
c->code_word;
67 if(
bits >= 0 &&
c->buffer <
c->end) {
68 code_word |= bytestream_get_be16(&
c->buffer) <<
bits;
81#ifndef vpx_rac_get_prob
82#define vpx_rac_get_prob vpx_rac_get_prob
86 unsigned int low = 1 + (((
c->high - 1) *
prob) >> 8);
87 unsigned int low_shift = low << 16;
88 int bit = code_word >= low_shift;
90 c->high =
bit ?
c->high - low : low;
91 c->code_word =
bit ? code_word - low_shift : code_word;
97#ifndef vpx_rac_get_prob_branchy
102 unsigned low = 1 + (((
c->high - 1) *
prob) >> 8);
103 unsigned low_shift = low << 16;
105 if (code_word >= low_shift) {
107 c->code_word = code_word - low_shift;
112 c->code_word = code_word;
121 int low = (
c->high + 1) >> 1;
122 unsigned int low_shift = low << 16;
123 int bit = code_word >= low_shift;
126 code_word -= low_shift;
131 c->code_word = code_word;
#define bit(string, value)
#define prob(name, subs,...)
static const uint8_t bits[8]
static int shift(int a, int b)
Macro definitions for various function/variable attributes.
const uint8_t ff_vpx_norm_shift[256]
static av_always_inline int vpx_rac_get_prob_branchy(VPXRangeCoder *c, int prob)
int ff_vpx_init_range_decoder(VPXRangeCoder *c, const uint8_t *buf, int buf_size)
static av_always_inline int vpx_rac_get(VPXRangeCoder *c)
static av_always_inline unsigned int vpx_rac_renorm(VPXRangeCoder *c)
static av_always_inline int vpx_rac_is_end(VPXRangeCoder *c)
returns 1 if the end of the stream has been reached, 0 otherwise.