projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9699b3a
)
mss2: simplify loop in decode_rle()
author
Alberto Delmás
<adelmas@gmail.com>
Mon, 3 Sep 2012 15:32:01 +0000
(17:32 +0200)
committer
Kostya Shishkov
<kostya.shishkov@gmail.com>
Thu, 6 Sep 2012 18:48:07 +0000
(20:48 +0200)
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>
libavcodec/mss2.c
patch
|
blob
|
history
diff --git
a/libavcodec/mss2.c
b/libavcodec/mss2.c
index
9914562
..
fbdc72c
100644
(file)
--- a/
libavcodec/mss2.c
+++ b/
libavcodec/mss2.c
@@
-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);