summaryrefslogtreecommitdiff
path: root/libavcodec/cabac.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-01-13 01:00:37 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-01-13 01:00:37 +0000
commit3b6dc9ca6db0d94d0fdad5e36b11a1f5d5ede917 (patch)
tree427da477fdbc623edfac0932ee9f977f821fd70f /libavcodec/cabac.h
parent6de062957b4e4f40c52bb2b5a57ecd2f3681fb2e (diff)
replace a few hardcoded numbers with their correct named ones
Originally committed as revision 7441 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/cabac.h')
-rw-r--r--libavcodec/cabac.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/cabac.h b/libavcodec/cabac.h
index f47406a9ea..931bd23223 100644
--- a/libavcodec/cabac.h
+++ b/libavcodec/cabac.h
@@ -539,26 +539,26 @@ static int av_always_inline get_cabac_inline(CABACContext *c, uint8_t * const st
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<<bit;
c->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 @@ static int get_cabac_bypass(CABACContext *c){
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 @@ static av_always_inline int get_cabac_bypass_sign(CABACContext *c, int val){
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 decode_significance_8x8_x86(CABACContext *c, uint8_t *significant_coe
*/
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{