Unit 1: PCL Emulation
Page 1-36 SATO D512 PCL Programming Manual
ZLIB
Zlib is a generic compression method. It refers to a standard for compression
as well as the library that implements the standard.
The zlib compression method uses the deflate algorithm. This same algorithm
is used by more widely known compression utilities such as PKZIP and GZIP.
Compressed data is a series of variably-sized blocks. An encoder determines
how to break the data into blocks and finds the best compression method to
use for each block.
An encoder works based on the following principles. The encoder creates a
dictionary containing different characters in a set of data. Short strings of bits
represent more commonly occurring characters, and long strings of bits
represent less frequently used characters. A probability tree determines
which characters are frequently used. Repeated patterns in a string of
characters are identified and stored, so the string doesn’t have to be stored
multiple times.
A three-bit zlib header is added to the beginning of a block to describe the
type of compression used and indicates whether the block is a final block.
Other information in the header includes checksums, compression algorithm
used, and the level of compression. In compression all checksums are set to
zero and in decompression the checksums are ignored.
The memory required for zlib compression and decompression is
independent of the size of the data to be compressed or decompressed.
The number 999 does not conflict with other compression types, so it is used
to represent zlib compression. See “Raster Compression Mode” in this
section for more information.