Commit a0490b32 authored by Guillaume Poirier's avatar Guillaume Poirier

adds some useful comments after some of the #else, #elseif,

#endif preprocessor directives to make it clearer which code
block depends on which #define xx

Originally committed as revision 6668 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 28146a8c
...@@ -449,7 +449,7 @@ static int get_cabac(CABACContext *c, uint8_t * const state){ ...@@ -449,7 +449,7 @@ static int get_cabac(CABACContext *c, uint8_t * const state){
: "%ecx", "%ebx", "%edx", "%esi" : "%ecx", "%ebx", "%edx", "%esi"
); );
bit&=1; bit&=1;
#else #else /* BRANCHLESS_CABAC_DECODER */
asm volatile( asm volatile(
"movzbl (%1), %%eax \n\t" "movzbl (%1), %%eax \n\t"
"movl "RANGE "(%2), %%ebx \n\t" "movl "RANGE "(%2), %%ebx \n\t"
...@@ -467,7 +467,7 @@ static int get_cabac(CABACContext *c, uint8_t * const state){ ...@@ -467,7 +467,7 @@ static int get_cabac(CABACContext *c, uint8_t * const state){
"andl %%ecx, %%edx \n\t" "andl %%ecx, %%edx \n\t"
"subl %%edx, %%ebx \n\t" "subl %%edx, %%ebx \n\t"
"xorl %%ecx, %%eax \n\t" "xorl %%ecx, %%eax \n\t"
#else #else /* CMOV_IS_FAST */
"movl %%edx, %%ecx \n\t" "movl %%edx, %%ecx \n\t"
"subl %%ebx, %%edx \n\t" "subl %%ebx, %%edx \n\t"
"sarl $31, %%edx \n\t" //lps_mask "sarl $31, %%edx \n\t" //lps_mask
...@@ -477,7 +477,7 @@ static int get_cabac(CABACContext *c, uint8_t * const state){ ...@@ -477,7 +477,7 @@ static int get_cabac(CABACContext *c, uint8_t * const state){
"andl %%edx, %%ecx \n\t" "andl %%edx, %%ecx \n\t"
"subl %%ecx, %%ebx \n\t" "subl %%ecx, %%ebx \n\t"
"xorl %%edx, %%eax \n\t" "xorl %%edx, %%eax \n\t"
#endif #endif /* CMOV_IS_FAST */
//eax:state ebx:low edx:mask esi:range //eax:state ebx:low edx:mask esi:range
"movzbl "MANGLE(ff_h264_mps_state)"(%%eax), %%ecx \n\t" "movzbl "MANGLE(ff_h264_mps_state)"(%%eax), %%ecx \n\t"
...@@ -519,8 +519,8 @@ static int get_cabac(CABACContext *c, uint8_t * const state){ ...@@ -519,8 +519,8 @@ static int get_cabac(CABACContext *c, uint8_t * const state){
: "%ecx", "%ebx", "%edx", "%esi" : "%ecx", "%ebx", "%edx", "%esi"
); );
bit&=1; bit&=1;
#endif #endif /* BRANCHLESS_CABAC_DECODER */
#else #else /* ARCH_X86 */
int s = *state; int s = *state;
int RangeLPS= ff_h264_lps_range[s][c->range>>(CABAC_BITS+7)]<<(CABAC_BITS+1); int RangeLPS= ff_h264_lps_range[s][c->range>>(CABAC_BITS+7)]<<(CABAC_BITS+1);
int bit, lps_mask attribute_unused; int bit, lps_mask attribute_unused;
...@@ -543,7 +543,7 @@ static int get_cabac(CABACContext *c, uint8_t * const state){ ...@@ -543,7 +543,7 @@ static int get_cabac(CABACContext *c, uint8_t * const state){
refill2(c); refill2(c);
} }
} }
#else #else /* BRANCHLESS_CABAC_DECODER */
lps_mask= (c->range - c->low)>>31; lps_mask= (c->range - c->low)>>31;
c->low -= c->range & lps_mask; c->low -= c->range & lps_mask;
...@@ -558,8 +558,8 @@ static int get_cabac(CABACContext *c, uint8_t * const state){ ...@@ -558,8 +558,8 @@ static int get_cabac(CABACContext *c, uint8_t * const state){
c->low <<= lps_mask; c->low <<= lps_mask;
if(!(c->low & CABAC_MASK)) if(!(c->low & CABAC_MASK))
refill2(c); refill2(c);
#endif #endif /* BRANCHLESS_CABAC_DECODER */
#endif #endif /* ARCH_X86 */
return bit; return bit;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment