summaryrefslogtreecommitdiff
path: root/libavcodec/mjpegdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-10-21 22:44:34 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-10-21 22:44:34 +0000
commit7f4a1e8f6ce203b8d7f0a9e65254e3ab931d44ff (patch)
tree767cbbf0d6599b10c83eaa636df36bb5f3b1887f /libavcodec/mjpegdec.c
parent614252863d8a0b9e8322453b8b12740e781aa257 (diff)
downloadffmpeg-7f4a1e8f6ce203b8d7f0a9e65254e3ab931d44ff.tar.gz
Cleanup decode_block_progressive()
Originally committed as revision 25543 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r--libavcodec/mjpegdec.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 8b9190cac5..5bf9f314f3 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -506,13 +506,13 @@ static int decode_block_progressive(MJpegDecodeContext *s, DCTELEM *block, uint8
if(run == 0xF){// ZRL - skip 15 coefficients
i += 15;
}else{
- val = run;
- run = (1 << run);
- UPDATE_CACHE(re, &s->gb);
- run += (GET_CACHE(re, &s->gb) >> (32 - val)) & (run - 1);
- if(val)
- LAST_SKIP_BITS(re, &s->gb, val);
- *EOBRUN = run - 1;
+ val = (1 << run);
+ if(run){
+ UPDATE_CACHE(re, &s->gb);
+ val += NEG_USR32(GET_CACHE(re, &s->gb), run);
+ LAST_SKIP_BITS(re, &s->gb, run);
+ }
+ *EOBRUN = val - 1;
break;
}
}