]> git.sesse.net Git - fjl/blobdiff - dehuff.c
Remove an increment from the fast path of the AC coefficient decoding.
[fjl] / dehuff.c
index 50fb53e1633746622aa2fbc28977420fef912928..8cdc2c8feb33fb675dcafb6bbb3ca8b64c98a204 100644 (file)
--- a/dehuff.c
+++ b/dehuff.c
@@ -135,14 +135,14 @@ void read_huffman_tables(huffman_tables_t* dst, input_func_t* input_func, void*
                                // End of block.
                                tbl->ac_table_codes[i] = AC_END_OF_BLOCK;
                                tbl->ac_table_length[i] = length;
-                               tbl->ac_table_skip[i] = 0;
+                               tbl->ac_table_skip[i] = 1;
                                continue;
                        }
                        if (rs == 0xf0) {
                                // 16 zero coefficients.
                                tbl->ac_table_codes[i] = AC_SIXTEEN_ZEROS;
                                tbl->ac_table_length[i] = length;
-                               tbl->ac_table_skip[i] = 15;
+                               tbl->ac_table_skip[i] = 16;
                                continue;
                        }
                        
@@ -157,7 +157,7 @@ void read_huffman_tables(huffman_tables_t* dst, input_func_t* input_func, void*
 
                        tbl->ac_table_codes[i] = extend(bits, s);
                        tbl->ac_table_length[i] = length + s;
-                       tbl->ac_table_skip[i] = r;
+                       tbl->ac_table_skip[i] = r + 1;
 
                        assert(tbl->ac_table_length[i] <= DEHUF_AC_TABLE_BITS);
                }