mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-09 16:19:35 +00:00
golomb: Simplify get_ur_golomb_jpegls
The loop always consumes the bit read and the new bitstream reader can read 0 bits just fine.
This commit is contained in:
parent
1fe858136b
commit
19c5fa9eea
@ -290,16 +290,12 @@ static inline int get_ur_golomb_jpegls(BitstreamContext *bc, int k, int limit,
|
|||||||
return buf;
|
return buf;
|
||||||
} else {
|
} else {
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < limit && bitstream_peek(bc, 1) == 0 && bitstream_bits_left(bc) > 0; i++)
|
for (i = 0;
|
||||||
bitstream_skip(bc, 1);
|
i < limit && bitstream_read_bit(bc) == 0 && bitstream_bits_left(bc) > 0;
|
||||||
bitstream_skip(bc, 1);
|
i++);
|
||||||
|
|
||||||
if (i < limit - 1) {
|
if (i < limit - 1) {
|
||||||
if (k) {
|
buf = bitstream_read(bc, k);
|
||||||
buf = bitstream_read(bc, k);
|
|
||||||
} else {
|
|
||||||
buf = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return buf + (i << k);
|
return buf + (i << k);
|
||||||
} else if (i == limit - 1) {
|
} else if (i == limit - 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user