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:
Alberto Delmás 2012-09-03 17:32:01 +02:00 committed by Kostya Shishkov
parent 9699b3a2d7
commit 290d1022b2

View File

@ -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);