Merge changes I2d317c4b,I9e77f6db into main

* changes:
  webp-lossless-bitstream-spec,cosmetics: normalize range syntax
  webp-lossless-bitstream-spec,cosmetics: fix code typo
This commit is contained in:
James Zern 2022-05-16 17:17:22 +00:00 committed by Gerrit Code Review
commit 11bc8410bd

View File

@ -866,7 +866,7 @@ stream. This may be inefficient, but it is allowed by the format.
\[AMENDED2\] \[AMENDED2\]
This variant is used in the special case when only 1 or 2 Huffman symbols are This variant is used in the special case when only 1 or 2 Huffman symbols are
in the range \[0, 255\] with code length `1`. All other Huffman code lengths in the range \[0..255\] with code length `1`. All other Huffman code lengths
are implicitly zeros. are implicitly zeros.
The first bit indicates the number of symbols: The first bit indicates the number of symbols:
@ -877,8 +877,8 @@ int num_symbols = ReadBits(1) + 1;
Following are the symbol values. Following are the symbol values.
This first symbol is coded using 1 or 8 bits depending on the value of This first symbol is coded using 1 or 8 bits depending on the value of
`is_first_8bits`. The range is \[0, 1\] or \[0, 255\], respectively. `is_first_8bits`. The range is \[0..1\] or \[0..255\], respectively.
The second symbol, if present, is always assumed to be in the range \[0, 255\] The second symbol, if present, is always assumed to be in the range \[0..255\]
and coded using 8 bits. and coded using 8 bits.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -920,7 +920,7 @@ int kCodeLengthCodes = 19;
int kCodeLengthCodeOrder[kCodeLengthCodes] = { int kCodeLengthCodeOrder[kCodeLengthCodes] = {
17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
}; };
int code_lengths[kCodeLengthCodes] = { 0 }; // All zeros. int code_length_code_lengths[kCodeLengthCodes] = { 0 }; // All zeros.
for (i = 0; i < num_code_lengths; ++i) { for (i = 0; i < num_code_lengths; ++i) {
code_length_code_lengths[kCodeLengthCodeOrder[i]] = ReadBits(3); code_length_code_lengths[kCodeLengthCodeOrder[i]] = ReadBits(3);
} }