36 while(c->
range < 0x100){
40 }
else if(c->
low<0x200){
56 if(bit == ((*state)&1)){
80 }
else if(c->
low<0x400){
125 for(i=0; i<
SIZE; i++){
127 else r[
i] = (i>>8)&1;
130 for(i=0; i<
SIZE; i++){
134 for(i=0; i<
SIZE; i++){
144 memset(state, 0,
sizeof(state));
146 for(i=0; i<
SIZE; i++){
153 for(i=0; i<
SIZE; i++){
Context structure for the Lagged Fibonacci PRNG.
static void renorm_cabac_encoder(CABACContext *c)
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
static int put_cabac_terminate(CABACContext *c, int bit)
static int av_noinline av_unused get_cabac_noinline(CABACContext *c, uint8_t *const state)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static void put_cabac(CABACContext *c, uint8_t *const state, int bit)
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
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int put_bits_count(PutBitContext *s)
int ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size)
void ff_init_cabac_encoder(CABACContext *c, uint8_t *buf, int buf_size)
static int av_unused get_cabac_terminate(CABACContext *c)
Libavcodec external API header.
static void put_cabac_bypass(CABACContext *c, int bit)
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
static void put_cabac_bit(CABACContext *c, int b)
static int av_unused get_cabac_bypass(CABACContext *c)
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
#define bit(string, value)
static const uint8_t *const ff_h264_lps_range
Context Adaptive Binary Arithmetic Coder.
static const uint8_t *const ff_h264_mlps_state