diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2010-10-21 22:44:51 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2010-10-21 22:44:51 +0000 |
commit | a2d4dfd493020cd15489991776eb2c7c504965d4 (patch) | |
tree | 55fcc8cbddacefbd87adc869987b72c722c3cfd2 /libavcodec | |
parent | e4463f21eed164413d9bb8904d0a78ce6d7fdb72 (diff) | |
download | ffmpeg-a2d4dfd493020cd15489991776eb2c7c504965d4.tar.gz |
Optimize EOB check in mjpeg decode_block() by adjusting the VLC symbol.
Originally committed as revision 25548 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mjpegdec.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 242d0208e4..2fae64f872 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -57,6 +57,8 @@ static int build_vlc(VLC *vlc, const uint8_t *bits_table, const uint8_t *val_tab 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(MJpegDecodeContext *s, DCTELEM *block, 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){ |