diff options
Diffstat (limited to 'third_party/aom/aom_dsp/bitreader_buffer.c')
-rw-r--r-- | third_party/aom/aom_dsp/bitreader_buffer.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/third_party/aom/aom_dsp/bitreader_buffer.c b/third_party/aom/aom_dsp/bitreader_buffer.c index e51b1cc3a..68fc381f2 100644 --- a/third_party/aom/aom_dsp/bitreader_buffer.c +++ b/third_party/aom/aom_dsp/bitreader_buffer.c @@ -8,8 +8,9 @@ * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent. */ -#include "./aom_config.h" -#include "./bitreader_buffer.h" +#include "config/aom_config.h" + +#include "aom_dsp/bitreader_buffer.h" size_t aom_rb_bytes_read(struct aom_read_bit_buffer *rb) { return (rb->bit_offset + 7) >> 3; @@ -35,9 +36,13 @@ int aom_rb_read_literal(struct aom_read_bit_buffer *rb, int bits) { return value; } -int aom_rb_read_signed_literal(struct aom_read_bit_buffer *rb, int bits) { - const int value = aom_rb_read_literal(rb, bits); - return aom_rb_read_bit(rb) ? -value : value; +uint32_t aom_rb_read_unsigned_literal(struct aom_read_bit_buffer *rb, + int bits) { + uint32_t value = 0; + int bit; + for (bit = bits - 1; bit >= 0; bit--) + value |= (uint32_t)aom_rb_read_bit(rb) << bit; + return value; } int aom_rb_read_inv_signed_literal(struct aom_read_bit_buffer *rb, int bits) { |