]> git.sesse.net Git - fjl/blobdiff - driver.c
Add un-zigzag table.
[fjl] / driver.c
index 08b684a0715162f058a12fe920c7e9c4fb90fd62..dd1b1ae8d8796840a51b7dbd7c4d8119b25fbad9 100644 (file)
--- a/driver.c
+++ b/driver.c
@@ -5,6 +5,7 @@
 #include "choice.h"
 #include "dehuff.h"
 #include "input.h"
+#include "zigzag.h"
 
 struct jpeg_image {
        unsigned precision;
@@ -121,7 +122,7 @@ void read_scan(struct byte_source* source, struct jpeg_image* image, huffman_tab
                                        possibly_refill(&bits, s);
 
                                        i += r;
-                                       zz[i] = extend(read_bits(&bits, s), s);
+                                       zz[unzigzag[i]] = extend(read_bits(&bits, s), s);
                                }
                                
                                for (unsigned i = 0; i < 63; ++i) {