Commit Graph

16 Commits

Author SHA1 Message Date
Mika Lindqvist
53204685c0 Avoid hashing same memory location twice by truncating overlapping byte ranges,
it's speed optimization as the inner code also checks that previous hash value
is not same as new hash value. Essentially those two checks together makes the
compression a little more efficient as it can remember matches further apart.
As far as I remember from my tests, the secondary path was triggered only twice
in very long uncompressed file, but the gain in compression rate was still noticeable.
2017-02-16 11:19:57 +01:00
Hans Kristian Rosbach
317e8824c9 Fix missing insert_string change from merge conflict 2017-01-30 13:18:07 +01:00
Mika Lindqvist
f111d5cb42 Merge insert_string and bulk_insert_str.
** Partial merge of this commit, based on a8c94e9f5a3b9d3c62182bcf84e72304a3c1a6e5
Excludes changes to fill_window_sse.c, changes to fill_window_c() in deflate.c
and several unrelated changes in the commit.
2017-01-30 12:07:06 +01:00
Mika Lindqvist
e80a18b6e9 Use bulk_insert_str when adding more than one byte.
** Partial merge of this commit, based on f8ad48ab17571c730b743c925f0e13ff83cf487f
Excluding changes to fill_window_sse.c, deflate.c and deflate_p.h
2017-01-30 11:50:58 +01:00
Mika Lindqvist
9c3a280877 Type cleanup. 2015-12-14 11:00:22 +02:00
Jim Kukunas
6901ac1f8f Fix for intels zlib fork, fixes their issues #2 and #3 2015-11-03 20:46:36 +01:00
Hans Kristian Rosbach
04a039de2b Whitespace cleanup 2015-06-26 15:43:09 +02:00
Hans Kristian Rosbach
6d91b4ae5a Make bulk_insert implementation of insert_match behave more like
the original code, this also lets us optimize the match_length=1 case.
2015-06-26 15:22:36 +02:00
Hans Kristian Rosbach
785a1ec85f No need to update hash_head.
Plus a single style change to match the other deflate algorithms.
2015-06-25 22:34:06 +02:00
Mika Lindqvist
84eecff6bc Use bulk_insert_str() in deflate_medium.c too. 2015-06-24 20:37:48 +02:00
Mika Lindqvist
fc1d0be4bb Split deflate.c
* Separate common inlines and macros to deflate_p.h
* Separate deflate_fast related code to deflate_fast.c
* Separate deflate_medium related code to deflate_medium.c
* Separate deflate_slow related code to deflate_slow.c
2015-06-24 20:34:55 +02:00
Hans Kristian Rosbach
d3c96f12e3 Style cleanup for deflate code 2015-05-25 23:01:26 +02:00
Hans Kristian Rosbach
2b6fd3880e Remove unused hash_head input parameter from function emit_match 2015-05-23 21:04:39 +02:00
hansr
1eecc12f19 Clean up likely/unlikely definitions 2014-10-09 15:10:33 +02:00
Nathan Kidd
86694e8231 deflate: avoid use of uninitialized variable
(Note emit_match() doesn't currently use the value at all.)

Fixes #4
2014-07-26 15:53:17 -07:00
Jim Kukunas
0a225b19f8 deflate: add new deflate_medium strategy
From: Arjan van de Ven <arjan@linux.intel.com>

As the name suggests, the deflate_medium deflate strategy is designed
to provide an intermediate strategy between deflate_fast and deflate_slow.
After finding two adjacent matches, deflate_medium scans left from
the second match in order to determine whether a better match can be
formed.

Fixes #2
2014-07-26 15:53:17 -07:00