Commit fada6c9b authored by michael's avatar michael

minor optimization of decode_block()


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@5237 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent b099dcb4
...@@ -1268,17 +1268,13 @@ static int decode_block(MJpegDecodeContext *s, DCTELEM *block, ...@@ -1268,17 +1268,13 @@ static int decode_block(MJpegDecodeContext *s, DCTELEM *block,
UPDATE_CACHE(re, &s->gb); UPDATE_CACHE(re, &s->gb);
GET_VLC(code, re, &s->gb, s->vlcs[1][ac_index].table, 9, 2) GET_VLC(code, re, &s->gb, s->vlcs[1][ac_index].table, 9, 2)
if (code < 0) {
dprintf("error ac\n");
return -1;
}
/* EOB */ /* EOB */
if (code == 0) if (code == 0)
break; break;
if (code == 0xf0) { if (code == 0xf0) {
i += 16; i += 16;
} else { } else {
i += code >> 4; i += ((unsigned)code) >> 4;
code &= 0xf; code &= 0xf;
UPDATE_CACHE(re, &s->gb) UPDATE_CACHE(re, &s->gb)
...@@ -1289,7 +1285,7 @@ static int decode_block(MJpegDecodeContext *s, DCTELEM *block, ...@@ -1289,7 +1285,7 @@ static int decode_block(MJpegDecodeContext *s, DCTELEM *block,
level = - NEG_USR32(~GET_CACHE(re,&s->gb),code); 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) { if (i >= 64) {
dprintf("error count: %d\n", i); dprintf("error count: %d\n", i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment