From: Hans Kristian Rosbach Date: Fri, 1 Nov 2019 10:47:50 +0000 (+0100) Subject: Add comment regarding long match distance bit costs. X-Git-Tag: 1.9.9-b1~333 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f21e5071f33bc0ff6e94d5fa0ecf398d6e3fcc3;p=thirdparty%2Fzlib-ng.git Add comment regarding long match distance bit costs. --- diff --git a/deflate_medium.c b/deflate_medium.c index 8283a08a0..07ce71fe3 100644 --- a/deflate_medium.c +++ b/deflate_medium.c @@ -292,6 +292,7 @@ ZLIB_INTERNAL block_state deflate_medium(deflate_state *s, int flush) { } /* short matches with a very long distance are rarely a good idea encoding wise */ + /* distances 8193–16384 take 12 extra bits, distances 16385–32768 take 13 extra bits */ if (next_match.match_length == 3 && (next_match.strstart - next_match.match_start) > 12000) next_match.match_length = 1; s->strstart = current_match.strstart;