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

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


Author: michael
Date: Fri Oct 22 00:44:51 2010
New Revision: 25548

Log:
Optimize EOB check in mjpeg decode_block() by adjusting the VLC symbol.

Modified:
   trunk/libavcodec/mjpegdec.c

Modified: trunk/libavcodec/mjpegdec.c
==============================================================================
--- trunk/libavcodec/mjpegdec.c	Fri Oct 22 00:44:47 2010	(r25547)
+++ trunk/libavcodec/mjpegdec.c	Fri Oct 22 00:44:51 2010	(r25548)
@@ -57,6 +57,8 @@ static int build_vlc(VLC *vlc, const uin
     for(i=0; i<256; i++)
         huff_sym[i]= i + 16*is_ac;
 
+    if(is_ac) huff_sym[0]= 16*256;
+
     return init_vlc_sparse(vlc, 9, nb_codes, huff_size, 1, 1, huff_code, 2, 2, huff_sym, 2, 2, use_static);
 }
 
@@ -415,9 +417,6 @@ static int decode_block(MJpegDecodeConte
         UPDATE_CACHE(re, &s->gb);
         GET_VLC(code, re, &s->gb, s->vlcs[1][ac_index].table, 9, 2)
 
-        /* EOB */
-        if (code == 0x10)
-            break;
         i += ((unsigned)code) >> 4;
             code &= 0xf;
         if(code){



More information about the ffmpeg-cvslog mailing list