# HG changeset patch # User michael # Date 1168650037 0 # Node ID 88967250d7189dd64c906c4183806ea63d3e5d66 # Parent 4aa24216f71a398c069e85e9542c88f686316a56 replace a few hardcoded numbers with their correct named ones diff -r 4aa24216f71a -r 88967250d718 cabac.h --- a/cabac.h Sat Jan 13 00:56:43 2007 +0000 +++ b/cabac.h Sat Jan 13 01:00:37 2007 +0000 @@ -539,26 +539,26 @@ c->range -= RangeLPS; #ifndef BRANCHLESS_CABAC_DECODER - if(c->low < (c->range<<17)){ + if(c->low < (c->range<<(CABAC_BITS+1))){ bit= s&1; *state= ff_h264_mps_state[s]; renorm_cabac_decoder_once(c); }else{ bit= ff_h264_norm_shift[RangeLPS]; - c->low -= (c->range<<17); + c->low -= (c->range<<(CABAC_BITS+1)); *state= ff_h264_lps_state[s]; c->range = RangeLPS<low <<= bit; bit= (s&1)^1; - if(!(c->low & 0xFFFF)){ + if(!(c->low & CABAC_MASK)){ refill2(c); } } #else /* BRANCHLESS_CABAC_DECODER */ - lps_mask= ((c->range<<17) - c->low)>>31; + lps_mask= ((c->range<<(CABAC_BITS+1)) - c->low)>>31; - c->low -= (c->range<<17) & lps_mask; + c->low -= (c->range<<(CABAC_BITS+1)) & lps_mask; c->range += (RangeLPS - c->range) & lps_mask; s^=lps_mask; @@ -620,7 +620,7 @@ if(!(c->low & CABAC_MASK)) refill(c); - range= c->range<<17; + range= c->range<<(CABAC_BITS+1); if(c->low < range){ return 0; }else{ @@ -669,7 +669,7 @@ if(!(c->low & CABAC_MASK)) refill(c); - range= c->range<<17; + range= c->range<<(CABAC_BITS+1); c->low -= range; mask= c->low >> 31; range &= mask; @@ -794,7 +794,7 @@ */ static int get_cabac_terminate(CABACContext *c){ c->range -= 2; - if(c->low < c->range<<17){ + if(c->low < c->range<<(CABAC_BITS+1)){ renorm_cabac_decoder_once(c); return 0; }else{