diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2010-10-22 02:44:31 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2010-10-22 02:44:31 +0400 |
commit | 614252863d8a0b9e8322453b8b12740e781aa257 (patch) | |
tree | 65205a2051f6e68c0c665ffc70e55bff8a6ec789 /libavcodec/mjpegdec.c | |
parent | 76c80ef5690c6b94ad7468cd170a7519295b8d19 (diff) |
Factorize ((unsigned) code) >> 4 out of decode_block_progressive() in jpeg.
Originally committed as revision 25542 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r-- | libavcodec/mjpegdec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index fe08d7bd88..8b9190cac5 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -476,8 +476,9 @@ static int decode_block_progressive(MJpegDecodeContext *s, DCTELEM *block, uint8 GET_VLC(code, re, &s->gb, s->vlcs[1][ac_index].table, 9, 2) /* Progressive JPEG use AC coeffs from zero and this decoder sets offset 16 by default */ code -= 16; + run = ((unsigned) code) >> 4; if(code & 0xF) { - i += ((unsigned) code) >> 4; + i += run; code &= 0xf; if(code > MIN_CACHE_BITS - 16){ UPDATE_CACHE(re, &s->gb) @@ -502,7 +503,6 @@ static int decode_block_progressive(MJpegDecodeContext *s, DCTELEM *block, uint8 j = s->scantable.permutated[i]; block[j] = level * quant_matrix[j] << Al; }else{ - run = ((unsigned) code) >> 4; if(run == 0xF){// ZRL - skip 15 coefficients i += 15; }else{ |