webp-lossless-bitstream-spec: fix code blocks

+ change "> 19" to "greater than 19" as it's referred to in prose

Bug: webp:611
Change-Id: I644d7d39f9c4a19050ff0256114873057aee95ef
This commit is contained in:
James Zern 2023-07-25 22:06:41 -07:00
parent cd436142f6
commit 67a7cc2b07

View File

@ -336,7 +336,7 @@ for each ARGB component as follows:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Clamp the input value between 0 and 255.
int Clamp(int a) {
return (a < 0) ? 0 : (a > 255) ? 255 : a;
return (a < 0) ? 0 : (a > 255) ? 255 : a;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -594,9 +594,9 @@ After reading this transform, `image_width` is subsampled by `width_bits`. This
affects the size of subsequent transforms. The new size can be calculated using
`DIV_ROUND_UP`, as defined [earlier](#predictor-transform).
```
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
image_width = DIV_ROUND_UP(image_width, 1 << width_bits);
```
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 Image Data
------------
@ -788,14 +788,14 @@ int color_cache_code_bits = ReadBits(4);
int color_cache_size = 1 << color_cache_code_bits;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
`color_cache_code_bits` defines the size of the color_cache (1 <<
`color_cache_code_bits`). The range of allowed values for
`color_cache_code_bits` defines the size of the color_cache (`1 <<
color_cache_code_bits`). The range of allowed values for
`color_cache_code_bits` is \[1..11\]. Compliant decoders must indicate a
corrupted bitstream for other values.
A color cache is an array of size `color_cache_size`. Each entry stores one ARGB
color. Colors are looked up by indexing them by (0x1e35a7bd * `color`) >> (32 -
`color_cache_code_bits`). Only one lookup is done in a color cache; there is no
color. Colors are looked up by indexing them by `(0x1e35a7bd * color) >> (32 -
color_cache_code_bits)`. Only one lookup is done in a color cache; there is no
conflict resolution.
In the beginning of decoding or encoding of an image, all entries in all color
@ -904,7 +904,7 @@ First, `num_code_lengths` specifies the number of code lengths.
int num_code_lengths = 4 + ReadBits(4);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If `num_code_lengths` is > 19, the bitstream is invalid.
If `num_code_lengths` is greater than 19, the bitstream is invalid.
The code lengths are themselves encoded using prefix codes; lower-level code
lengths, `code_length_code_lengths`, first have to be read. The rest of those