]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/cabac.h
clarify codec_tag
[ffmpeg] / libavcodec / cabac.h
index f47406a9eab840b21df5c89c7ab90c3ad86b8976..fc9fc6dd572806093c81bbe9adeef7d0e69e239a 100644 (file)
@@ -462,7 +462,7 @@ static int av_always_inline get_cabac_inline(CABACContext *c, uint8_t * const st
 #else /* BRANCHLESS_CABAC_DECODER */
 
 
-#if defined CMOV_IS_FAST
+#if defined HAVE_FAST_CMOV
 #define BRANCHLESS_GET_CABAC_UPDATE(ret, cabac, statep, low, lowword, range, tmp, tmpbyte)\
         "mov    "tmp"       , %%ecx                                     \n\t"\
         "shl    $17         , "tmp"                                     \n\t"\
@@ -472,7 +472,7 @@ static int av_always_inline get_cabac_inline(CABACContext *c, uint8_t * const st
         "and    %%ecx       , "tmp"                                     \n\t"\
         "sub    "tmp"       , "low"                                     \n\t"\
         "xor    %%ecx       , "ret"                                     \n\t"
-#else /* CMOV_IS_FAST */
+#else /* HAVE_FAST_CMOV */
 #define BRANCHLESS_GET_CABAC_UPDATE(ret, cabac, statep, low, lowword, range, tmp, tmpbyte)\
         "mov    "tmp"       , %%ecx                                     \n\t"\
         "shl    $17         , "tmp"                                     \n\t"\
@@ -485,7 +485,7 @@ static int av_always_inline get_cabac_inline(CABACContext *c, uint8_t * const st
         "and    "tmp"       , %%ecx                                     \n\t"\
         "sub    %%ecx       , "low"                                     \n\t"\
         "xor    "tmp"       , "ret"                                     \n\t"
-#endif /* CMOV_IS_FAST */
+#endif /* HAVE_FAST_CMOV */
 
 
 #define BRANCHLESS_GET_CABAC(ret, cabac, statep, low, lowword, range, tmp, tmpbyte)\
@@ -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;
@@ -575,7 +575,7 @@ static int av_always_inline get_cabac_inline(CABACContext *c, uint8_t * const st
     return bit;
 }
 
-static int __attribute((noinline)) get_cabac_noinline(CABACContext *c, uint8_t * const state){
+static int av_noinline get_cabac_noinline(CABACContext *c, uint8_t * const state){
     return get_cabac_inline(c,state);
 }
 
@@ -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{