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. */