[Ffmpeg-cvslog] r8510 - trunk/libavcodec/lzw.c

michael subversion
Sun Mar 25 16:02:55 CEST 2007


Author: michael
Date: Sun Mar 25 16:02:54 2007
New Revision: 8510

Modified:
   trunk/libavcodec/lzw.c

Log:
factorize


Modified: trunk/libavcodec/lzw.c
==============================================================================
--- trunk/libavcodec/lzw.c	(original)
+++ trunk/libavcodec/lzw.c	Sun Mar 25 16:02:54 2007
@@ -192,13 +192,12 @@ int ff_lzw_decode(LZWState *p, uint8_t *
     oc = s->oc;
     fc = s->fc;
 
-    while (sp > s->stack) {
-        *buf++ = *(--sp);
-        if ((--l) == 0)
-            goto the_end;
-    }
-
     for (;;) {
+        while (sp > s->stack) {
+            *buf++ = *(--sp);
+            if ((--l) == 0)
+                goto the_end;
+        }
         c = lzw_get_code(s);
         if (c == s->end_code) {
             s->end_code = -1;
@@ -242,11 +241,6 @@ int ff_lzw_decode(LZWState *p, uint8_t *
                     s->curmask = mask[++s->cursize];
                 }
             }
-            while (sp > s->stack) {
-                *buf++ = *(--sp);
-                if ((--l) == 0)
-                    goto the_end;
-            }
         }
     }
   the_end:




More information about the ffmpeg-cvslog mailing list