Commit Graph

61 Commits

Author SHA1 Message Date
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
James Zern
e74f8a62b2 webp-lossless-bitstream-spec,cosmetics: normalize range syntax
[N, M] -> [N..M] the latter is more common in this doc

Bug: webp:551
Change-Id: I2d317c4b8bb31d313123e981f93cd1feb346a98a
2022-05-14 20:51:43 -07:00
James Zern
5a709ec0d7 webp-lossless-bitstream-spec,cosmetics: fix code typo
code_lengths -> code_length_code_lengths
after:
86f94ee0 Update lossless spec with Huffman codes.

Bug: webp:551
Change-Id: I9e77f6db0fca6fe8294cb31a3015e723050094b5
2022-05-14 20:51:34 -07:00
James Zern
a2093acc4b webp-lossless-bitstream-spec: add amendment note
for recent changes to color transform, simple code length code, image
structure and details of decoding prefix codes

Bug: webp:551
Change-Id: I36a4d1ee3e25b8a56f5d926f4770374ace99bc2f
2022-05-13 18:50:55 -07:00
James Zern
86c669303a webp-lossless-bitstream-spec: fix BNF
color cache info precedes the meta huffman info

Bug: webp:551
Change-Id: Ibb69b4ffad6bff5693015be3fe6c600c53fd06c0
2022-05-13 18:41:30 -07:00
James Zern
232f22da5a webp-lossless-bitstream-spec: fix 'simple code' snippet
based on https://crbug.com/webp/551#c3 & https://crbug.com/webp/551#c4

Bug: webp:551
Change-Id: I4bcc19643b0bdda999247e9c3457d6954a49e35f
2022-05-13 18:41:20 -07:00
James Zern
44dd765def webp-lossless-bitstream-spec: fix ColorTransform impl
and the corresponding InverseTransform(); the operations were swapped.
The forward transform subtracts the deltas, the inverse adds them.

Bug: webp:551
Change-Id: Ieb90a24f843cee7cdfe46cbb15ec7d716ca9d269
2022-05-13 18:33:16 -07:00
James Zern
7a7e33e977 webp-lossless-bitstream-spec: fix TR-pixel right border note
the value of the TR-pixel on the right border is the leftmost pixel on
the current row, not the previous one

Bug: webp:551
Change-Id: I157e8c16ce43a9f52c36aa880be1be3bef19c063
2022-05-13 16:48:23 -07:00
vrabaud@google.com
86f94ee010 Update lossless spec with Huffman codes.
Bug: webp:551
Change-Id: I28b57c8e87a8023b727fe8359c2e2809cf92752d
2022-05-13 16:42:00 -07:00
James Zern
f0e9351cce webp-lossless-bitstream-spec,cosmetics: fix some typos
Bug: webp:551
Change-Id: I9ff90601b77deb9034ed7bef9cfd421d1f6e2e2b
2022-03-15 17:57:31 -07:00
Maryla
54e61a3864 Markdownify libwebp docs and reorganize them.
Break the main README into into multiple pages in the doc/ directory,
except for the tests, swig and webp_js docs which are in the corresponding
directories.
The webp mux doc is merged into the API doc and the tools doc.

Change-Id: Ia407617dd88094f4662841d37947cfef80799914
2022-02-15 15:31:56 +00:00
James Zern
b6f756e82b update http links
- prefer https

- metadataworkinggroup.org/com seem to be offline; the web archive link
  was obtained from exiftool: https://exiftool.org/TagNames/MWG.html

- fix kramdown link, rubyforge has been gone a long time

- fix png/zlib links

Bug: webp:544
Bug: b/202302177
Change-Id: Id69de4553e7baf00393f12a2c1acb262443a1a93
2021-11-23 10:13:40 -08:00
Pascal Massimino
13ae011e4c doc: use two's complement explicitly for uint8->int8 conversion
BUG=webp:225

Change-Id: I6bad131e275dbd992484e95a1b834010121281b8
2016-09-05 10:57:56 -07:00
Pascal Massimino
d7167ff7ce Amend the lossless spec according to issue #205, #206 and #224
http://code.google.com/p/webp/issues/detail?id=205 <- Select()
http://code.google.com/p/webp/issues/detail?id=206 <- out-of-bound colormap index
http://code.google.com/p/webp/issues/detail?id=224 <- version number MUST be 0

Change-Id: I56a575529862dfc8ad189ddcfc47ef59a58f273d
2014-09-18 08:21:02 +02:00
Urvang Joshi
8425aaee8f Formatting fixes in lossless bitstream spec
- Escape brackets for which kramdown was generating a warning.
Note: This only changes this source file; output HTML would look exactly
the same.
- Also write '5' in words ('five').

Change-Id: I472a03c090a12eb7520719ea463469b36a2736b9
2013-01-18 14:35:47 -08:00
Urvang Joshi
f01c2a538c WebP-lossless spec clarifications:
- Clarify the BNF using 'Huffman code groups' and 'Huffman code group'.
- Introduce same terminology in 'Interpretation of meta Huffman codes'.
- Make explicit mention of what is the number of Huffman code groups,
  number of Huffman codes and the relation between the two.

Change-Id: I07aa9b62c1d464cd25dc02ac1a68d338b575bdc2
2013-01-17 15:19:09 -08:00
Urvang Joshi
1f075f89b0 Lossless spec corrections/rewording/clarifications
- Correct BNF for 'predictor-image' and 'color image'
- Correct some references to 'br', 'VP8LReadBits' and 'ReadStream'
- Correct value ranges in distance mapping table.
- Rewrite section 4 (some rearrangement, rewording, adding context etc).
- Similarly, rewrite section 5.

Change-Id: If487490c2553b3f7982b9fcca68d98bab5017e3c
2012-12-20 10:44:42 -08:00
Urvang Joshi
d82a3e3391 More corrections/clarifications in lossless spec:
- Rectify a few BNF descriptions
- Corrections in "Decoding Flow of Image Data" section:
  1. The sequence in case of "S < 256" should be green, red, blue, alpha.
  2. In case of "S >= 256 + 24", the index should be "S - (256 + 24)".
- Provide more description to clarify "Decoding Flow of Image Data" section.
- Some cosmetics: use '1's instead of '1, 2, 3...' sequence, as kramdown takes
  care of sequencing.

Change-Id: I2b76caf72f67aae813522dc1a4115f8ec8ea6db7
2012-12-17 11:40:23 -08:00
Urvang Joshi
bcec339b01 Lossless bitstream clarification:
Clarify what the pixels of a color transform image are.

Change-Id: I720248b5417857468d54952440cf1bae6c091042
2012-12-12 14:03:44 -08:00
Urvang Joshi
931bd516b8 lossless bitstream: block size bits correction
The color transform block size is stored as 3 bits, not 4.
Fixed the description. The code snippet is already correct.

Change-Id: I830d848b54c121cb5426ca06853a3f1184fd9a31
2012-12-05 13:38:05 -08:00
Pascal Massimino
e4fc4c1c63 lossless bitstream: block size bits correction
The prediction block size is stored as 3 bits, not 4.
Fixed the description. The code snippet is already correct.

Change-Id: Iaa66a7e9817b58a2557c9a71c2231cc400b6ae4d
2012-12-05 00:01:28 -08:00
Jyrki Alakuijala
d03b250369 fixing the findings by Frederic Kayser to the bitstream spec
Change-Id: I4bcc428412dd4c21675d90159771e2e0b338ecf3
2012-07-18 22:47:11 -07:00
James Zern
85bff2cdbe Merge "doc: correct lossless prefix coding table & code" 2012-07-13 11:12:14 -07:00