]> git.sesse.net Git - s573compress/commitdiff
In the fast compressor, update the hash match table during matches; helps ~180 kB...
authorSteinar H. Gunderson <steinar+ddr@gunderson.no>
Tue, 3 Dec 2019 08:25:56 +0000 (09:25 +0100)
committerSteinar H. Gunderson <steinar+ddr@gunderson.no>
Tue, 3 Dec 2019 08:25:56 +0000 (09:25 +0100)
compress_fast.cpp

index 95a042e862fba9ecb11597168bc2a98f0300d3e6..e6da2cbd3884774179ede8000c418bb79e685ae0 100644 (file)
@@ -166,6 +166,12 @@ string compress_konamilz77(const string &input)
                                output.emit_literal(&input[pos - unemitted_literal_bytes], unemitted_literal_bytes);
                                unemitted_literal_bytes = 0;
                        }
+
+                       // Update the match table.
+                       for (int i = 1; i < best_match_length; ++i) {
+                               match_to_pos[read24(&input[pos + i])] = pos + i;
+                       }
+
                        output.emit_match(best_match_length, best_match_distance);
                        pos += best_match_length - 1;
                }