zlib lz77 sliding window and max match length

2.2k Views Asked by At

I'm trying to find two parameters (sliding window size and max match length) in the LZ77 algorithm (source code: http://www.zlib.net/) in order to analyse different levels of compression. At first, I found the CHUNK value in zpipe.c to be the max match length parameter, and the sliding window to be the parameter windowBits in the function deflateInit2 in deflate.c The problem is that the compressed files in different compression levels according to these parameters are identical no matter the parameters are.

if someone used this source code and already recognized theses parameters in the code, it will be very helpful for me.

Thanks!

1

There are 1 best solutions below

11
On

By default zlib uses a 32K sliding window. The maximum match length is 258.

The amount of data fed to deflate at a time (e.g. CHUNK in zpipe.c) has no bearing on the compression whatsoever. You could feed in the data a byte at a time and you would get the same output.