Browse Source

golomb: Simplify get_ur_golomb_jpegls

The loop always consumes the bit read and the new bitstream reader
can read 0 bits just fine.
tags/n4.0
Luca Barbato 8 years ago
parent
commit
19c5fa9eea
1 changed files with 4 additions and 8 deletions
  1. +4
    -8
      libavcodec/golomb.h

+ 4
- 8
libavcodec/golomb.h View File

@@ -290,16 +290,12 @@ static inline int get_ur_golomb_jpegls(BitstreamContext *bc, int k, int limit,
return buf;
} else {
int i;
for (i = 0; i < limit && bitstream_peek(bc, 1) == 0 && bitstream_bits_left(bc) > 0; i++)
bitstream_skip(bc, 1);
bitstream_skip(bc, 1);
for (i = 0;
i < limit && bitstream_read_bit(bc) == 0 && bitstream_bits_left(bc) > 0;
i++);

if (i < limit - 1) {
if (k) {
buf = bitstream_read(bc, k);
} else {
buf = 0;
}
buf = bitstream_read(bc, k);

return buf + (i << k);
} else if (i == limit - 1) {


Loading…
Cancel
Save