[Ffmpeg-cvslog] r8699 - trunk/libavcodec/lzwenc.c

michael subversion
Tue Apr 10 00:18:09 CEST 2007


Author: michael
Date: Tue Apr 10 00:18:09 2007
New Revision: 8699

Modified:
   trunk/libavcodec/lzwenc.c

Log:
simplify


Modified: trunk/libavcodec/lzwenc.c
==============================================================================
--- trunk/libavcodec/lzwenc.c	(original)
+++ trunk/libavcodec/lzwenc.c	Tue Apr 10 00:18:09 2007
@@ -232,13 +232,12 @@ int ff_lzw_encode(LZWEncodeState * s, co
     for (i = 0; i < insize; i++) {
         uint8_t c = *inbuf++;
         int code = findCode(s, c, code_prefix);
-        if (s->tab[code].hash_prefix != LZW_PREFIX_FREE) {
-            code_prefix = s->tab[code].code;
-        } else {
+        if (s->tab[code].hash_prefix == LZW_PREFIX_FREE) {
             writeCode(s, code_prefix);
             addCode(s, c, code_prefix, code);
-            code_prefix = s->tab[hash(0, c)].code;
+            code= hash(0, c);
         }
+        code_prefix = s->tab[code].code;
         if (s->tabsize >= s->maxcode - 1) {
             clearTable(s);
         }




More information about the ffmpeg-cvslog mailing list