aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-03-29 08:41:53 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-03-29 08:41:53 +0000
commit7d2b787daa8237480cee619e3d22bd6cf9740db4 (patch)
treef9407da43307c954a1392dc02a12a6d031e85a54 /libavcodec
parentc17be817637ade85fb5d8138e8f402e67b51ac23 (diff)
downloadffmpeg-7d2b787daa8237480cee619e3d22bd6cf9740db4.tar.gz
minor optimization of decode_block()
Originally committed as revision 5237 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mjpeg.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c
index e6cb52a4f5..79caa9bf7b 100644
--- a/libavcodec/mjpeg.c
+++ b/libavcodec/mjpeg.c
@@ -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);