38 for(;
c->outstanding_count;
c->outstanding_count--){
45 while (
c->dec.range < 0x100) {
47 if (
c->dec.low < 0x100) {
49 }
else if (
c->dec.low < 0x200) {
50 c->outstanding_count++;
57 c->dec.range +=
c->dec.range;
58 c->dec.low +=
c->dec.low;
67 c->dec.range -= RangeLPS;
70 c->dec.low +=
c->dec.range - RangeLPS;
71 c->dec.range = RangeLPS;
83 c->dec.low +=
c->dec.low;
86 c->dec.low +=
c->dec.range;
89 if (
c->dec.low < 0x200) {
91 }
else if (
c->dec.low < 0x400) {
92 c->outstanding_count++;
111 c->dec.low +=
c->dec.range;
118 put_bits(&
c->pb, 2, ((
c->dec.low >> 7) & 3) | 1);
134 c->dec.range = 0x1FE;
135 c->outstanding_count = 0;
152 else r[
i] = (
i>>8)&1;
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Libavcodec external API header.
Context Adaptive Binary Arithmetic Coder.
int ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size)
static int av_noinline av_unused get_cabac_noinline(CABACContext *c, uint8_t *const state)
static const uint8_t *const ff_h264_lps_range
static int av_unused get_cabac_bypass(CABACContext *c)
static const uint8_t *const ff_h264_mlps_state
static int av_unused get_cabac_terminate(CABACContext *c)
#define bit(string, value)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static int put_bits_count(PutBitContext *s)
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
Context structure for the Lagged Fibonacci PRNG.
static void init_cabac_encoder(CABACTestContext *c, uint8_t *buf, int buf_size)
static void renorm_cabac_encoder(CABACTestContext *c)
static void put_cabac(CABACTestContext *c, uint8_t *const state, int bit)
static void put_cabac_bypass(CABACTestContext *c, int bit)
static void put_cabac_bit(CABACTestContext *c, int b)
static int put_cabac_terminate(CABACTestContext *c, int bit)