webp-lossless-bitstream-spec: fix BNF

color cache info precedes the meta huffman info

Bug: webp:551
Change-Id: Ibb69b4ffad6bff5693015be3fe6c600c53fd06c0
This commit is contained in:
James Zern 2022-03-12 10:52:33 -08:00
parent 232f22da5a
commit 86c669303a

View File

@ -1098,13 +1098,14 @@ of pixels (xsize * ysize).
#### Structure of the Image Data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<spatially-coded image> ::= <meta huffman><entropy-coded image>
<entropy-coded image> ::= <color cache info><huffman codes><lz77-coded image>
<meta huffman> ::= 1-bit value 0 |
(1-bit value 1; <entropy image>)
<entropy image> ::= 3-bit subsample value; <entropy-coded image>
<spatially-coded image> ::= <color cache info><meta huffman><data>
<entropy-coded image> ::= <color cache info><data>
<color cache info> ::= 1 bit value 0 |
(1-bit value 1; 4-bit value for color cache size)
<meta huffman> ::= 1-bit value 0 |
(1-bit value 1; <entropy image>)
<data> ::= <huffman codes><lz77-coded image>
<entropy image> ::= 3-bit subsample value; <entropy-coded image>
<huffman codes> ::= <huffman code group> | <huffman code group><huffman codes>
<huffman code group> ::= <huffman code><huffman code><huffman code>
<huffman code><huffman code>
@ -1123,9 +1124,8 @@ A possible example sequence:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<RIFF header><image size>1-bit value 1<subtract-green-tx>
1-bit value 1<predictor-tx>1-bit value 0<meta huffman>
<color cache info><huffman codes>
<lz77-coded image>
1-bit value 1<predictor-tx>1-bit value 0<color cache info>1-bit value 0
<huffman codes><lz77-coded image>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[canonical_huff]: https://en.wikipedia.org/wiki/Canonical_Huffman_code