Small update to brotli specification.

Clarify how to recover from error conditions caused by overflowing
block types and symbol values.
This commit is contained in:
Zoltan Szabadka
2014-01-06 16:35:24 +01:00
parent 40955ce409
commit efbc1a8965
+8 -4
View File
@@ -432,7 +432,9 @@ Abstract
The value of ALPHABET_BITS depends on the alphabet of the Huffman The value of ALPHABET_BITS depends on the alphabet of the Huffman
code: it is the smallest number of bits that can represent all code: it is the smallest number of bits that can represent all
symbols in the alphabet. E.g. for the alphabet of literal bytes, symbols in the alphabet. E.g. for the alphabet of literal bytes,
ALPHABET_BITS is 8. ALPHABET_BITS is 8. The value of each of the NSYM symbols above is
the value of the ALPHABETS_BITS width machine integer representing
the symbol modulo the alphabet size of the Huffman code.
The (non-zero) code lengths of the symbols can be reconstructed as The (non-zero) code lengths of the symbols can be reconstructed as
follows: follows:
@@ -714,9 +716,11 @@ Abstract
alphabet. A block type code 0 means that the block type is the same alphabet. A block type code 0 means that the block type is the same
as the type of the second last block from the same block category, as the type of the second last block from the same block category,
while a block type code 1 means that the block type equals the last while a block type code 1 means that the block type equals the last
block type plus one. Block type codes 2 - 257 represent block types block type plus one. If the last block type is the maximal possible,
0 - 255. The second last and last block types are initialized with 0 then a block type code 1 means block type 0. Block type codes 2 - 257
and 1, respectively, at the beginning of each meta-block. represent block types 0 - 255. The second last and last block types
are initialized with 0 and 1, respectively, at the beginning of each
meta-block.
The first block type of each block category must be 0 and the block The first block type of each block category must be 0 and the block
type of the first block switch command is therefore not encoded in type of the first block switch command is therefore not encoded in