]> git.sesse.net Git - ffmpeg/commitdiff
Factor code&0xf out of if() in decode_block_progressive().
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 21 Oct 2010 22:44:37 +0000 (22:44 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 21 Oct 2010 22:44:37 +0000 (22:44 +0000)
Originally committed as revision 25544 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/mjpegdec.c

index 5bf9f314f35c7f875679730f10ea65839e584090..7d1aa530e26269b23b63c3dcca521cc8516587a9 100644 (file)
@@ -477,9 +477,9 @@ static int decode_block_progressive(MJpegDecodeContext *s, DCTELEM *block, uint8
         /* Progressive JPEG use AC coeffs from zero and this decoder sets offset 16 by default */
         code -= 16;
         run = ((unsigned) code) >> 4;
-        if(code & 0xF) {
+        code &= 0xF;
+        if(code) {
             i += run;
-            code &= 0xf;
             if(code > MIN_CACHE_BITS - 16){
                 UPDATE_CACHE(re, &s->gb)
             }