changeset 1279:77aafc141a39 libavcodec

cleanup
author michaelni
date Fri, 23 May 2003 12:58:46 +0000
parents 483db104bb7b
children 8623c2e29555
files huffyuv.c
diffstat 1 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/huffyuv.c	Thu May 22 14:12:22 2003 +0000
+++ b/huffyuv.c	Fri May 23 12:58:46 2003 +0000
@@ -237,17 +237,15 @@
     uint32_t bits=0;
 
     for(len=32; len>0; len--){
-        int bit= 1<<(32-len);
         for(index=0; index<256; index++){
-            if(len_table[index]==len){
-                if(bits & (bit-1)){
-                    fprintf(stderr, "Error generating huffman table\n");
-                    return -1;
-                }
-                dst[index]= bits>>(32-len);
-                bits+= bit;
-            }
+            if(len_table[index]==len)
+                dst[index]= bits++;
         }
+        if(bits & 1){
+            fprintf(stderr, "Error generating huffman table\n");
+            return -1;
+        }
+        bits >>= 1;
     }
     return 0;
 }