Commit Graph

83 Commits

Author SHA1 Message Date
James Zern
84628e5611 webp-lossless-bitstream-spec: clarify image width changes
After processing the Color Indexing Transform the image width is
subsampled by the transform's width_bits.

Bug: webp:611
Change-Id: If8d2d47dbe05e5c8085fb3fb4c1b63552be9028b
2023-07-20 17:54:20 -07:00
James Zern
982c177c8a webp-lossless-bitstream-spec: fix struct member refs
remove trailing '_' to match the definition of ColorTransformElement

Bug: webp:611
Change-Id: I741213b389fc88473c72c64090a4733f51d87925
2023-07-14 15:13:27 -07:00
James Zern
56cf562570 webp-lossless-bitstream-spec: use RFC 7405 for ABNF
This allows for case sensitive literals.

Bug: webp:611
Change-Id: I5258c67ab12c48593d433449328fd85d461a05d2
2023-07-14 15:13:27 -07:00
James Zern
6c6b3fd317 webp-lossless-bitstream-spec,cosmetics: delete blank lines
This normalizes the spacing between sections and quiets some lint
warnings.

Bug: webp:611
Change-Id: Ic36eb08d55a566def74f746e2ec225c67ff8aecf
2023-07-14 15:12:35 -07:00
James Zern
e4fc2f78c7 webp-lossless-bitstream-spec: add validity note for max_symbol
Bug: webp:611
Change-Id: Id56ca4fd0ad3cfc17c9c971281ccfb8ce7eaa2f4
2023-07-07 15:54:34 -07:00
James Zern
71916726b6 webp-lossless-bitstream-spec: fix max_symbol definition
If ReadBits(0) == 0, the value of max_symbol is set to the alphabet size
for each symbol type.

See vp8l_dec.c, ReadHuffmanCode(), which passes alphabet_size to
ReadHuffmanCodeLengths() as num_symbols, and ReadHuffmanCodeLengths()
then sets max_symbol to that.

Bug: webp:611
Change-Id: I662bd1d7f372e7f2e9c71cc86f87aefd02f36647
2023-07-07 15:54:34 -07:00
James Zern
4298e9765c webp-lossless-bitstream-spec: add PredictorTransformOutput
Describe the addition of the residual value to the predicted value.

Bug: webp:611
Change-Id: Id0300937eeebbafec3b2cd15376c56418c98a3bf
2023-06-26 12:51:36 -07:00
James Zern
cd7e02bece webp-lossless-bitstream-spec: fix RIFF-header ABNF
0x2f is a part of the image header, not RIFF header

Bug: webp:611
Change-Id: I5dba5ccfebeb25586723a1f3e00eebc317806928
2023-06-26 12:51:36 -07:00
James Zern
6c3845f9e0 webp-lossless-bitstream-spec: split LZ77 Backward Ref section
Make Distance Mapping its section for ease of reference.

Bug: webp:611
Change-Id: I57bb68e0fcf4d23ce0013f327adce93c6377be3a
2023-06-26 12:51:36 -07:00
James Zern
7f1b6799db webp-lossless-bitstream-spec: split Meta Prefix Codes section
Make Entropy Image and Interpretation of Meta Prefix Codes their own
section for ease of reference.

Bug: webp:611
Change-Id: I2dba7b4efd02d8bb250810ebff42ac1687262804
2023-06-26 12:51:36 -07:00
James Zern
7b634d8f0c webp-lossless-bitstream-spec: note transform order
transforms are applied in reverse bitstream order.

Bug: webp:611
Change-Id: I172aca36bbd5c3358a71b0acb49c5704ceee63d7
2023-06-26 12:51:36 -07:00
James Zern
6d6d4915ce webp-lossless-bitstream-spec: update transformations text
follow up to:
29c9f2d4 webp-lossless-bitstream-spec: minor wording updates

Universally use 'transform' over 'transformation'. The doc generally
uses 'transform' to talk about the individual transforms themselves as
well as their related data.

Bug: webp:611
Change-Id: I097701873bbc440bd399ab5440a914a14f7c62f6
2023-06-26 12:50:39 -07:00
James Zern
08d60d6006 webp-lossless-bitstream-spec: split code length section
Make Simple / Normal Code Length Code their own section for ease of
reference.

Bug: webp:611
Change-Id: I1e6ed50d98f9258cacb163d2059716b5356e8b6f
2023-06-21 19:20:12 -07:00
James Zern
7a12afcc54 webp-lossless-bitstream-spec: rm unused anchor
The last use of #decoding-the-code-lengths was removed in:
86f94ee0 Update lossless spec with Huffman codes.

Also remove the redundant section header associated with it.

Bug: webp:611
Change-Id: I7f6bb1a1b75255324f185f4591313d9e6d49d1e9
2023-06-21 19:16:39 -07:00
James Zern
14a9dbfba0 webp-lossless-bitstream-spec: refine single node text
Remove the ambiguous 'should' which in other contexts might result in
questions as to whether it is a SHOULD or a MUST.

Change-Id: I9b396187ebde5ea5a0dbaf42daee6acf541258cd
2023-06-20 19:30:20 -07:00
James Zern
03a7a04892 webp-lossless-bitstream-spec: rm redundant statement
Within the 'Entropy image' subsection, its clear this is what is being
described in the following paragraphs. Remove 'as described below' from
the first sentence.

Bug: webp:611
Change-Id: I365d69c8f6963cd826849ebdd96e46206d38b55d
2023-06-08 11:22:10 -07:00
James Zern
c437c7aace webp-lossless-bitstream-spec: mv up prefix code group def
Move this to the top-level of the "Details" section as prefix codes are
discussed in both "Decoding and Building the Prefix Codes" and "Decoding
of Meta Prefix Codes"

Bug: webp:611
Change-Id: Ide2dfedf081d6c94122ac16ecded968ed760f90c
2023-06-08 11:22:10 -07:00
James Zern
e4f17a31a7 webp-lossless-bitstream-spec: fix section reference
in the Transformations section describing decoding of the transform
data followed by the image data. The section numbers were adjusted by 1
in:
337cf69f webp-lossless-bitstream-spec: mv Nomenclature after Intro

Bug: webp:611
Change-Id: I4eede0d068fabdef51a140a0268436ab6629e8bb
2023-06-08 11:22:10 -07:00
James Zern
e2ecd5e937 webp-lossless-bitstream-spec: clarify ABNF syntax
Give some examples of repetition and binary value notation to limit the
need to follow the ABNF reference.

Bug: webp:611
Change-Id: I5b5a7632f011e1523b4a528653fe3630afba3e3e
2023-06-08 11:22:10 -07:00
James Zern
8b55425a56 webp-lossless-bitstream-spec: refine pixel copy text
in 6.2.3 Decoding Entropy-Coded Image Data.

The copying of distance code pixels cause some confusion during the
AUTH48 portion of the RFC review process.

Bug: webp:611
Change-Id: I78f547ae10c95f180355a4c93ec6d48acdc09141
2023-06-08 11:22:10 -07:00
James Zern
29c9f2d410 webp-lossless-bitstream-spec: minor wording updates
Mostly grammatical and addition/subtraction of commas from the AUTH48
portion of the RFC review process.

The serial comma changes are based on the Chicago Manual of Style
(CMOS), 17th edition.

Bug: webp:611
Change-Id: I5ae2d1cc0196009dbf3a4c2195cc73c2ef809b49
2023-06-08 11:21:55 -07:00
James Zern
c369c4bf0b doc/webp-lossless-bitstream-spec: improve link text
Reference the section by number, rather than 'this section'. Fixes a
lint warning:

Style notice: Write unique, descriptive link text that makes sense
without the surrounding text. Don't use phrases such as this document,
this article, or click here.
https://developers.google.com/style/link-text?hl=en#write-link-text

Change-Id: Iab33e4980528dddb5eed4404d25a4a746705131a
2023-05-26 15:48:28 -07:00
James Zern
9f38b71e01 doc/webp-lossless-bitstream-spec: prefer present tense
https://developers.google.com/style/tense

Change-Id: I1151ad0f585afd388920e6910a30aca4c2d0cc32
2023-05-26 15:48:17 -07:00
James Zern
4967e7cd78 doc/webp-lossless-bitstream-spec: avoid i.e. & e.g.
Using 'that is' or 'for example' is recommended:
https://developers.google.com/style/abbreviations#dont-use

Change-Id: I5d0dad2ee7ae5ebaf73661d5d79a4a2f1dc1802a
2023-05-26 15:48:09 -07:00
Jyrki Alakuijala
428588ef90 clarify single leaf node trees and use of canonical prefix coding
remove AMENDED-notes (the last functional spec change to match with the
implementation is from 2014, other amendments are clarifications)

Bug: webp:581
Change-Id: Ic47739be0fd5a975fd734d6813567ca615304f1d
2023-05-25 17:25:48 -07:00
James Zern
17e0ef1da5 webp-lossless-bitstream-spec: remove use of 'dynamics'
when bit width or precision are meant.

Change-Id: I89c2279e99b02c3e8a3bf39860364d2ce6d909c8
2023-05-12 15:10:30 -07:00
James Zern
84d04c4845 webp-lossless-bitstream-spec: add missing bits to ABNF
alpha-is-used and the version number were missing before 'image-stream'

spotted by thakis@

Change-Id: I7a4f1d2e0f0962bb1a79a0400c229738159d88a5
2023-04-13 12:13:34 -07:00
James Zern
4c3d7018c0 webp-lossless-bitstream-spec: condense normal-prefix-code
Have this match simple-prefix-code and redirect to "Normal Code Length
Code" as the added indirection to 'code-length-code' and the undefined
'encoded-code-lengths' doesn't add much.

spotted by thakis@

Change-Id: Icd6b64a47c4e0001e93271d9ae5585be4a6d5906
2023-04-10 17:22:55 -07:00
James Zern
a6a09b3296 webp-lossless-bitstream-spec: fix 2 code typos
- add missing '(' in DIV_ROUND_UP
- in 6.2.2, rename 'pos' variable reference to match definition
  ('position')

spotted by thakis@

Change-Id: Ida3ed281c2c753ebbb0e1eb3c4ed04dadc79ca24
2023-04-10 17:18:52 -07:00
James Zern
e5fe2cfc1b webp-lossless-bitstream-spec,cosmetics: reflow paragraphs
Change-Id: Ifd7472fe0678b45efc62faa66de8e8dc2e9931e3
2022-11-22 11:38:01 -08:00
James Zern
0ceeeab987 webp-lossless-bitstream-spec: add amendment note
for fixes to the distance_map pseudo-code, the inverse color transform
description and the num_code_lengths check.

Bug: webp:448
Bug: webp:551
Change-Id: Id7e791b97704dd64bb9519657ce48b92cb457ae4
2022-11-22 11:38:01 -08:00
James Zern
f853685e13 lossless: SUBTRACT_GREEN -> SUBTRACT_GREEN_TRANSFORM
this makes the name of the TransformType enum value match the other
members

Bug: webp:448
Change-Id: I85b2f615f97b40fc6d544197cccfb7189dcf4fc0
2022-11-21 16:48:51 -08:00
James Zern
786497e48a webp-lossless-bitstream-spec: fix inv color txfm description
The prose describing the process was missed in:
44dd765d webp-lossless-bitstream-spec: fix ColorTransform impl

Bug: webp:448
Bug: webp:551
Change-Id: If5fb95103ffedeed113e3ad62510f3a19bfd280e
2022-11-21 16:48:51 -08:00
James Zern
c6ac672dbc webp-lossless-bitstream-spec: fix num_code_lengths check
in the 'Normal Code Length Code' description the number of valid code
lengths is 19, not 18.

Bug: webp:448
Bug: webp:551
Change-Id: Id929604e1d771cb09b2d0ac617e83f21077f21de
2022-11-21 16:48:51 -08:00
James Zern
b5700efb70 webp-lossless-bitstream-spec,cosmetics: grammar/capitalization
Bug: webp:448
Change-Id: I2d6cc66b45342716fdba7792c570510601432109
2022-11-21 16:48:41 -08:00
James Zern
e3ba2b1f5b webp-lossless-bitstream-spec,cosmetics: reflow abstract
Bug: webp:448
Change-Id: Ie975dbb52687c6c068b029fc8f84db8cf189523a
2022-11-17 18:25:13 -08:00
James Zern
1e8e3ded21 webp-lossless-bitstream-spec: reword abstract re alpha
'zero alpha pixels' was a bit hard to parse; replace this with something
more explicit

Bug: webp:448
Change-Id: Ifc8c93af5520ffdafc58e3fc311dfb4cb19626e9
2022-11-17 18:22:56 -08:00
James Zern
f6a4684ba8 webp-lossless-bitstream-spec,cosmetics: normalize range syntax
[N-M], [N, M] -> [N..M]

these were missed in:
e74f8a62 webp-lossless-bitstream-spec,cosmetics: normalize range syntax

Bug: webp:448
Change-Id: I6ca7c5d6b0473fdf3de0c6dba00b0f1e3da46a23
2022-11-17 18:06:49 -08:00
James Zern
54ebd5a375 webp-lossless-bitstream-spec: limit dist map lut to 69 cols
this is similar to an earlier change for most of the code examples:
  7a0a9935 doc/*.txt: restrict code to 69 columns

some renderers may limit output to 72 and use a 3 space indent; this
avoids overflowing into the margin

Bug: webp:448
Change-Id: I2e8d66f598889c7bd824e911ea01fd70f98a4130
2022-11-17 18:06:45 -08:00
James Zern
44741f9c58 webp-lossless-bitstream-spec: fix dist mapping example
The distance code read from the bitstream is reduced by 1 before doing
the lookup. The prose describing the lookup was correct, the pseudocode
failed to subtract 1 and used x/y instead of xi/yi from the lookup.

Bug: webp:448
Change-Id: I152477b888c26a0473a35373d3d331fddd14237f
2022-11-17 18:06:31 -08:00
James Zern
d34f9b99b9 Merge "webp-lossless-bitstream-spec: convert BNF to ABNF" into main 2022-10-15 02:01:48 +00:00
James Zern
57101d3fc5 webp-lossless-bitstream-spec: improve 'small' color table stmt
this is defined earlier as 16 or fewer unique values

based on comments from:
https://datatracker.ietf.org/doc/draft-zern-webp/ballot/#draft-zern-webp_lars-eggert

Bug: webp:448
Change-Id: If9e18e5aaec3641e477c2bb68dacc0a4fd029cfb
2022-10-13 19:34:54 -07:00
James Zern
8a6185dd27 doc/webp-*: fix some punctuation, grammar
based on comments from:
https://datatracker.ietf.org/doc/draft-zern-webp/ballot/#draft-zern-webp_lars-eggert

Bug: webp:448
Change-Id: I0a410b28b7b62fb4552ea3db444743be61469fe8
2022-10-13 19:34:54 -07:00
James Zern
72776530d8 webp-lossless-bitstream-spec: convert BNF to ABNF
this has a better canonical reference [1] and is preferred in IETF docs

[1] https://www.rfc-editor.org/rfc/rfc5234

Bug: webp:448
Change-Id: I3f0bd34d3ca4c62b255d5d6cbae0c55e2940dfb5
2022-10-12 16:55:46 -07:00
James Zern
7a0a9935ed doc/*.txt: restrict code to 69 columns
some renderers may limit output to 72 and use a 3 space indent; this
avoids overflowing into the margin

Change-Id: Iaf4e8b71be27ef00fccd1d82b79bf96c01040f10
2022-08-04 19:35:24 -07:00
James Zern
01d7d378d1 webp-lossless-bitstream-spec: number all sections
this makes the structure more consistent

Change-Id: Ie6c8b42506be73e565cfc4d39108eb4d8c038003
2022-08-02 19:03:51 -07:00
James Zern
337cf69f58 webp-lossless-bitstream-spec: mv Nomenclature after Intro
Change-Id: I3337513e48a8e604b154d91993bd7ff84d6c55ad
2022-08-02 18:50:59 -07:00
Vincent Rabaud
e91451b69b Fix the lossless specs a bit more.
Bug: webp:551

Change-Id: I03f729f69d660f17e27cc601e91c703b241f1b83
2022-07-25 22:36:51 +02:00
James Zern
d01c1eb309 webp-lossless-bitstream-spec,cosmetics: normalize capitalization
in section headings

Change-Id: I43b2208f5e0efa32029d519ac9805e871eb51ed3
2022-07-20 10:36:23 -07:00
Jyrki Alakuijala
404c1622f8 Rename Huffman coding to prefix coding in the bitstream spec
... since no guarantee of Huffman coding can be introduced at decoding
time and encoding didn't actually use Huffman coding in the first place

Bug: webp:551
Change-Id: I400466bb3b4a1d5506353eb3f287d658603164ee
2022-06-16 10:56:03 -07:00