mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-27 21:20:41 +00:00
mss2: simplify loop in decode_rle()
It calculates the sum of power of two series, which can be done in one step. Suggested by Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
This commit is contained in:
parent
9699b3a2d7
commit
290d1022b2
@ -335,8 +335,7 @@ static int decode_rle(GetBitContext *gb, uint8_t *pal_dst, int pal_stride,
|
||||
else
|
||||
repeat = get_bits(gb, b);
|
||||
|
||||
while (b--)
|
||||
repeat += 1 << b;
|
||||
repeat += (1 << b) - 1;
|
||||
|
||||
if (last_symbol == -2) {
|
||||
int skip = FFMIN(repeat, pal_dst + w - pp);
|
||||
|
Loading…
Reference in New Issue
Block a user