[FFmpeg-cvslog] r25542 - trunk/libavcodec/mjpegdec.c

michael subversion
Fri Oct 22 00:44:31 CEST 2010


Author: michael
Date: Fri Oct 22 00:44:31 2010
New Revision: 25542

Log:
Factorize  ((unsigned) code) >> 4 out of decode_block_progressive() in jpeg.

Modified:
   trunk/libavcodec/mjpegdec.c

Modified: trunk/libavcodec/mjpegdec.c
==============================================================================
--- trunk/libavcodec/mjpegdec.c	Fri Oct 22 00:44:28 2010	(r25541)
+++ trunk/libavcodec/mjpegdec.c	Fri Oct 22 00:44:31 2010	(r25542)
@@ -476,8 +476,9 @@ static int decode_block_progressive(MJpe
         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(MJpe
             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{



More information about the ffmpeg-cvslog mailing list