From 1f45d0b36a01df2dc2ae3601901e40d4b865f47e Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Fri, 31 Dec 2021 16:04:49 -0600 Subject: [PATCH] deflate_constants: define constant for window order --- lib/deflate_compress.c | 8 ++------ lib/deflate_constants.h | 3 +++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/deflate_compress.c b/lib/deflate_compress.c index 3255968..b2d6b5d 100644 --- a/lib/deflate_compress.c +++ b/lib/deflate_compress.c @@ -49,12 +49,8 @@ */ #define USE_FULL_OFFSET_SLOT_FAST SUPPORT_NEAR_OPTIMAL_PARSING -/* - * DEFLATE uses a 32768 byte sliding window; set the matchfinder parameters - * appropriately. - */ -#define MATCHFINDER_WINDOW_ORDER 15 - +/* Include the needed matchfinders. */ +#define MATCHFINDER_WINDOW_ORDER DEFLATE_WINDOW_ORDER #include "hc_matchfinder.h" #if SUPPORT_NEAR_OPTIMAL_PARSING # include "bt_matchfinder.h" diff --git a/lib/deflate_constants.h b/lib/deflate_constants.h index 5556aaf..5982c15 100644 --- a/lib/deflate_constants.h +++ b/lib/deflate_constants.h @@ -17,6 +17,9 @@ /* Maximum supported match offset (in bytes) */ #define DEFLATE_MAX_MATCH_OFFSET 32768 +/* log2 of DEFLATE_MAX_MATCH_OFFSET */ +#define DEFLATE_WINDOW_ORDER 15 + /* Number of symbols in each Huffman code. Note: for the literal/length * and offset codes, these are actually the maximum values; a given block * might use fewer symbols. */