Libav 0.7.1
|
00001 00024 #ifndef AVCODEC_X86_VP56_ARITH_H 00025 #define AVCODEC_X86_VP56_ARITH_H 00026 00027 #if HAVE_FAST_CMOV 00028 #define vp56_rac_get_prob vp56_rac_get_prob 00029 static av_always_inline int vp56_rac_get_prob(VP56RangeCoder *c, uint8_t prob) 00030 { 00031 unsigned int code_word = vp56_rac_renorm(c); 00032 unsigned int high = c->high; 00033 unsigned int low = 1 + (((high - 1) * prob) >> 8); 00034 unsigned int low_shift = low << 16; 00035 int bit = 0; 00036 00037 __asm__( 00038 "subl %4, %1 \n\t" 00039 "subl %3, %2 \n\t" 00040 "leal (%2, %3), %3 \n\t" 00041 "setae %b0 \n\t" 00042 "cmovb %4, %1 \n\t" 00043 "cmovb %3, %2 \n\t" 00044 : "+q"(bit), "+r"(high), "+r"(code_word), "+r"(low_shift) 00045 : "r"(low) 00046 ); 00047 00048 c->high = high; 00049 c->code_word = code_word; 00050 return bit; 00051 } 00052 #endif 00053 00054 #endif /* AVCODEC_X86_VP56_ARITH_H */