From 8d4a5ae15c4b0775fe1a182614486b60a95f210a Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Fri, 31 Dec 2021 16:04:49 -0600 Subject: [PATCH] deflate_compress: strengthen levels 10-12 slightly With deflate_compress_near_optimal(), some data benefits more than originally thought from larger values of max_search_depth and nice_match_length. Some data even needs these parameters to be fairly high for deflate_compress_near_optimal() to compress more than deflate_compress_lazy2(). Bump these parameters up a bit. --- lib/deflate_compress.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/deflate_compress.c b/lib/deflate_compress.c index ba9a0ff..556ada6 100644 --- a/lib/deflate_compress.c +++ b/lib/deflate_compress.c @@ -3004,21 +3004,21 @@ libdeflate_alloc_compressor(int compression_level) #if SUPPORT_NEAR_OPTIMAL_PARSING case 10: c->impl = deflate_compress_near_optimal; - c->max_search_depth = 30; - c->nice_match_length = 50; + c->max_search_depth = 35; + c->nice_match_length = 75; c->p.n.num_optim_passes = 2; break; case 11: c->impl = deflate_compress_near_optimal; - c->max_search_depth = 60; - c->nice_match_length = 80; + c->max_search_depth = 70; + c->nice_match_length = 150; c->p.n.num_optim_passes = 3; break; case 12: default: c->impl = deflate_compress_near_optimal; - c->max_search_depth = 100; - c->nice_match_length = 133; + c->max_search_depth = 150; + c->nice_match_length = DEFLATE_MAX_MATCH_LEN; c->p.n.num_optim_passes = 4; break; #endif /* SUPPORT_NEAR_OPTIMAL_PARSING */