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

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 <>
Signed-off-by: 's avatarKostya Shishkov <>
parent 9699b3a2
......@@ -335,8 +335,7 @@ static int decode_rle(GetBitContext *gb, uint8_t *pal_dst, int pal_stride,
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);
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