mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
CMOV-ify vp56 arithcoder
This incantation causes gcc 4.3 to generate cmov on x86, a vastly better option than a completely unpredictable branch. Hopefully this carries over to newer versions and other CPUs with conditionals. ~5 cycles saved per call on a Core i7. Originally committed as revision 23921 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
2e6ed48d6e
commit
36d6b545a1
@ -199,12 +199,8 @@ static inline int vp56_rac_get_prob(VP56RangeCoder *c, uint8_t prob)
|
|||||||
int bit = c->code_word >= low_shift;
|
int bit = c->code_word >= low_shift;
|
||||||
int shift;
|
int shift;
|
||||||
|
|
||||||
if (bit) {
|
c->high = bit ? c->high - low : low;
|
||||||
c->high -= low;
|
c->code_word = bit ? c->code_word - low_shift : c->code_word;
|
||||||
c->code_word -= low_shift;
|
|
||||||
} else {
|
|
||||||
c->high = low;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* normalize */
|
/* normalize */
|
||||||
shift = ff_h264_norm_shift[c->high] - 1;
|
shift = ff_h264_norm_shift[c->high] - 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user