Go to the documentation of this file.
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;
144 uint8_t
state[10]= {0};
152 else r[
i] = (
i>>8)&1;
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
static int put_bytes_count(const PutBitContext *s, int round_up)
#define bit(string, value)
static void put_cabac(CABACTestContext *c, uint8_t *const state, int bit)
static void renorm_cabac_encoder(CABACTestContext *c)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static int put_cabac_terminate(CABACTestContext *c, int bit)
static const uint8_t *const ff_h264_mlps_state
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Context structure for the Lagged Fibonacci PRNG.
static int av_noinline av_unused get_cabac_noinline(CABACContext *c, uint8_t *const state)
static void put_cabac_bypass(CABACTestContext *c, int bit)
static int av_unused get_cabac_terminate(CABACContext *c)
static const uint8_t *const ff_h264_lps_range
int ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size)
#define i(width, name, range_min, range_max)
static void init_cabac_encoder(CABACTestContext *c, uint8_t *buf, int buf_size)
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
static void put_cabac_bit(CABACTestContext *c, int b)