X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fcabac.h;h=8065ae0f45a8c6b44db2d93f74900f747f6512f9;hb=0b1f20e23c3d61d06c86ee1aa160cd4da8b47b0c;hp=ed156e6fcaeef94636e79d7eaac78439fd8664a0;hpb=4dcd1a3145dd93602b86a44ebc07d98ca2a30ab6;p=ffmpeg diff --git a/libavcodec/cabac.h b/libavcodec/cabac.h index ed156e6fcae..8065ae0f45a 100644 --- a/libavcodec/cabac.h +++ b/libavcodec/cabac.h @@ -41,9 +41,6 @@ typedef struct CABACContext{ int low; int range; int outstanding_count; -#ifdef STRICT_LIMITS - int symCount; -#endif const uint8_t *bytestream_start; const uint8_t *bytestream; const uint8_t *bytestream_end; @@ -65,31 +62,6 @@ void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size); void ff_init_cabac_states(CABACContext *c); -static inline void put_cabac_bit(CABACContext *c, int b){ - put_bits(&c->pb, 1, b); - for(;c->outstanding_count; c->outstanding_count--){ - put_bits(&c->pb, 1, 1-b); - } -} - -static inline void renorm_cabac_encoder(CABACContext *c){ - while(c->range < 0x100){ - //FIXME optimize - if(c->low<0x100){ - put_cabac_bit(c, 0); - }else if(c->low<0x200){ - c->outstanding_count++; - c->low -= 0x100; - }else{ - put_cabac_bit(c, 1); - c->low -= 0x200; - } - - c->range+= c->range; - c->low += c->low; - } -} - static void refill(CABACContext *c){ #if CABAC_BITS == 16 c->low+= (c->bytestream[0]<<9) + (c->bytestream[1]<<1); @@ -100,15 +72,6 @@ static void refill(CABACContext *c){ c->bytestream+= CABAC_BITS/8; } -static inline void renorm_cabac_decoder(CABACContext *c){ - while(c->range < 0x100){ - c->range+= c->range; - c->low+= c->low; - if(!(c->low & CABAC_MASK)) - refill(c); - } -} - static inline void renorm_cabac_decoder_once(CABACContext *c){ int shift= (uint32_t)(c->range - 0x100)>>31; c->range<<= shift; @@ -216,62 +179,4 @@ static int av_unused get_cabac_terminate(CABACContext *c){ } } -#if 0 -/** - * Get (truncated) unary binarization. - */ -static int get_cabac_u(CABACContext *c, uint8_t * state, int max, int max_index, int truncated){ - int i; - - for(i=0; i>=1){ - v+= v + get_cabac_bypass(c); - } - i += v; - - if(is_signed && get_cabac_bypass(c)){ - return -i; - }else - return i; -} -#endif /* 0 */ - #endif /* AVCODEC_CABAC_H */