Go to the documentation of this file.
   27 #ifndef AVCODEC_CABAC_FUNCTIONS_H 
   28 #define AVCODEC_CABAC_FUNCTIONS_H 
   35 #ifndef UNCHECKED_BITSTREAM_READER 
   36 #define UNCHECKED_BITSTREAM_READER !CONFIG_SAFE_BITSTREAM_READER 
   57 #if !defined(get_cabac_bypass) || !defined(get_cabac_terminate) 
   60         c->low+= (
c->bytestream[0]<<9) + (
c->bytestream[1]<<1);
 
   62         c->low+= 
c->bytestream[0]<<1;
 
   65 #if !UNCHECKED_BITSTREAM_READER 
   66     if (
c->bytestream < 
c->bytestream_end)
 
   72 #ifndef get_cabac_terminate 
   74     int shift= (uint32_t)(
c->range - 0x100)>>31;
 
   82 #ifndef get_cabac_inline 
   87     x= 
c->low ^ (
c->low-1);
 
   96         x+= (
c->bytestream[0]<<9) + (
c->bytestream[1]<<1);
 
   98         x+= 
c->bytestream[0]<<1;
 
  102 #if !UNCHECKED_BITSTREAM_READER 
  103     if (
c->bytestream < 
c->bytestream_end)
 
  109 #ifndef get_cabac_inline 
  115     c->range -= RangeLPS;
 
  119     c->range += (RangeLPS - 
c->range) & lps_mask;
 
  126     c->range<<= lps_mask;
 
  142 #ifndef get_cabac_bypass 
  160 #ifndef get_cabac_bypass_sign 
  180 #ifndef get_cabac_terminate 
  187         return c->bytestream - 
c->bytestream_start;
 
  206     if ((
int) (
c->bytestream_end - ptr) < n)
 
  
static void renorm_cabac_decoder_once(CABACContext *c)
 
static av_always_inline int get_cabac_inline(CABACContext *c, uint8_t *const state)
 
#define bit(string, value)
 
static int av_unused get_cabac(CABACContext *c, uint8_t *const state)
 
static const uint8_t *const ff_h264_last_coeff_flag_offset_8x8
 
static double val(void *priv, double ch)
 
const uint8_t ff_h264_cabac_tables[512+4 *2 *64+4 *64+63]
 
static const uint8_t *const ff_h264_norm_shift
 
static const uint16_t mask[17]
 
static void refill2(CABACContext *c)
 
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
 
static int av_noinline av_unused get_cabac_noinline(CABACContext *c, uint8_t *const state)
 
#define H264_LPS_RANGE_OFFSET
 
static av_always_inline int get_cabac_bypass_sign(CABACContext *c, int val)
 
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 int av_unused get_cabac_bypass(CABACContext *c)
 
#define H264_NORM_SHIFT_OFFSET
 
#define H264_LAST_COEFF_FLAG_OFFSET_8x8_OFFSET
 
static void refill(CABACContext *c)
 
static int shift(int a, int b)
 
static const av_unused uint8_t * skip_bytes(CABACContext *c, int n)
Skip n bytes and reset the decoder.
 
#define H264_MLPS_STATE_OFFSET