little speed up for VP8BitUpdate()

1% faster on average

Patch by Somnath Banerjee (somnath at google dot com)

Change-Id: I44cbc125024d3b7ba8621643e9161b72f0eac281
This commit is contained in:
Pascal Massimino 2011-05-29 22:35:44 -07:00
parent e71418f899
commit af10db4aa4

View File

@ -61,15 +61,16 @@ static inline uint32_t VP8GetByte(VP8BitReader* const br) {
static inline uint32_t VP8BitUpdate(VP8BitReader* const br, uint32_t split) {
uint32_t bit;
const uint32_t value_split = (split + 1) << 8;
// Make sure we have a least 8 bits in 'value_'
if (br->missing_ > 0) {
br->value_ |= VP8GetByte(br) << br->missing_;
br->missing_ -= 8;
}
bit = ((br->value_ >> 8) > split);
bit = (br->value_ >= value_split);
if (bit) {
br->range_ -= split + 1;
br->value_ -= (split + 1) << 8;
br->value_ -= value_split;
} else {
br->range_ = split;
}