Stream Format
A Deflate stream consists of a series of blocks. Each block is preceded by a 3-bit header:
- 1 bit: Last-block-in-stream marker:
1
: this is the last block in the stream.0
: there are more blocks to process after this one.
- 2 bits: Encoding method used for this block type:
00
: a stored/raw/literal section, between 0 and 65,535 bytes in length.01
: a static Huffman compressed block, using a pre-agreed Huffman tree.10
: a compressed block complete with the Huffman table supplied.11
: reserved, don't use.
Most blocks will end up being encoded using method 10
, the dynamic Huffman encoding, which produces an optimised Huffman tree customised for each block of data individually. Instructions to generate the necessary Huffman tree immediately follow the block header.
Compression is achieved through two steps
- The matching and replacement of duplicate strings with pointers.
- Replacing symbols with new, weighted symbols based on frequency of use.
Read more about this topic: DEFLATE
Famous quotes containing the word stream:
“I have ventured
Like little wanton boys that swim on bladders,
This many summers in a sea of glory,
But far beyond my depth. My high-blown pride
At length broke under me and now has left me,
Weary and old with service, to the mercy
Of a rude stream that must forever hide me.”
—William Shakespeare (15641616)
Main Site Subjects
Related Phrases
Related Words