changeset 3226:e3ddc57c2d6e libavcodec

minor optimization of decode_block()
author michael
date Wed, 29 Mar 2006 08:41:53 +0000
parents a0d2d5053c9d
children ea0ca798d389
files mjpeg.c
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mjpeg.c	Wed Mar 29 01:59:24 2006 +0000
+++ b/mjpeg.c	Wed Mar 29 08:41:53 2006 +0000
@@ -1268,17 +1268,13 @@
         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 @@
                 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);