]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Add comment regarding long match distance bit costs.
authorHans Kristian Rosbach <hk-git@circlestorm.org>
Fri, 1 Nov 2019 10:47:50 +0000 (11:47 +0100)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Wed, 18 Mar 2020 10:04:05 +0000 (11:04 +0100)
deflate_medium.c

index 8283a08a042ed5a704070bce0a4fc2d370a60423..07ce71fe3376c15547547b9e623f0e3371383e93 100644 (file)
@@ -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;