minor optimization of decode_block()

Originally committed as revision 5237 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2006-03-29 08:41:53 +00:00
parent c17be81763
commit 7d2b787daa
1 changed files with 2 additions and 6 deletions

View File

@ -1268,17 +1268,13 @@ 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)
if (code < 0) {
dprintf("error ac\n");
return -1;
}
/* EOB */
if (code == 0)
break;
if (code == 0xf0) {
i += 16;
} else {
i += code >> 4;
i += ((unsigned)code) >> 4;
code &= 0xf;
UPDATE_CACHE(re, &s->gb)
@ -1289,7 +1285,7 @@ static int decode_block(MJpegDecodeContext *s, DCTELEM *block,
level = - NEG_USR32(~GET_CACHE(re,&s->gb),code);
}
SKIP_BITS(re, &s->gb, code)
LAST_SKIP_BITS(re, &s->gb, code)
if (i >= 64) {
dprintf("error count: %d\n", i);