Commit 290d1022 authored by Alberto Delmás's avatar Alberto Delmás Committed by Kostya Shishkov
Browse files

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: default avatarKostya Shishkov <kostya.shishkov@gmail.com>
parent 9699b3a2
...@@ -335,8 +335,7 @@ static int decode_rle(GetBitContext *gb, uint8_t *pal_dst, int pal_stride, ...@@ -335,8 +335,7 @@ static int decode_rle(GetBitContext *gb, uint8_t *pal_dst, int pal_stride,
else else
repeat = get_bits(gb, b); repeat = get_bits(gb, b);
while (b--) repeat += (1 << b) - 1;
repeat += 1 << b;
if (last_symbol == -2) { if (last_symbol == -2) {
int skip = FFMIN(repeat, pal_dst + w - pp); int skip = FFMIN(repeat, pal_dst + w - pp);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment