doc/webp-container-spec: cosmetics

partially normalize indent, vertical whitespace and capitalization with
the copy used on developers.google.com/speed/webp

Change-Id: I8044418eeb9eaf5bd5c799675c74f6f845d503d6
This commit is contained in:
James Zern 2015-02-06 14:50:49 -08:00
parent be6635e91d
commit e7d3df2314

View File

@ -91,8 +91,10 @@ _1-based_
: An unsigned integer field storing values offset by `-1`. e.g., Such a field : An unsigned integer field storing values offset by `-1`. e.g., Such a field
would store value _25_ as _24_. would store value _25_ as _24_.
RIFF file format
RIFF File Format
---------------- ----------------
The WebP file format is based on the RIFF (resource interchange file format) The WebP file format is based on the RIFF (resource interchange file format)
document format. document format.
@ -132,7 +134,8 @@ _ChunkHeader('ABCD')_
chunks that apply to any RIFF file format, while FourCCs specific to a file chunks that apply to any RIFF file format, while FourCCs specific to a file
format are all lowercase. WebP does not follow this convention. format are all lowercase. WebP does not follow this convention.
WebP file header
WebP File Header
---------------- ----------------
0 1 2 3 0 1 2 3
@ -165,7 +168,8 @@ the 'WEBP' FourCC. The file SHOULD NOT contain anything after it. As the size
of any chunk is even, the size given by the RIFF header is also even. The of any chunk is even, the size given by the RIFF header is also even. The
contents of individual chunks will be described in the following sections. contents of individual chunks will be described in the following sections.
Simple file format (lossy)
Simple File Format (Lossy)
-------------------------- --------------------------
This layout SHOULD be used if the image requires _lossy_ encoding and does not This layout SHOULD be used if the image requires _lossy_ encoding and does not
@ -203,7 +207,8 @@ width and height. That is assumed to be the width and height of the canvas.
The VP8 specification describes how to decode the image into Y'CbCr The VP8 specification describes how to decode the image into Y'CbCr
format. To convert to RGB, Rec. 601 SHOULD be used. format. To convert to RGB, Rec. 601 SHOULD be used.
Simple file format (lossless)
Simple File Format (Lossless)
----------------------------- -----------------------------
**Note:** Older readers may not support files using the lossless format. **Note:** Older readers may not support files using the lossless format.
@ -241,7 +246,8 @@ The current specification of the VP8L bitstream can be found at
contains the VP8L image width and height. That is assumed to be the width contains the VP8L image width and height. That is assumed to be the width
and height of the canvas. and height of the canvas.
Extended file format
Extended File Format
-------------------- --------------------
**Note:** Older readers may not support files using the extended format. **Note:** Older readers may not support files using the extended format.
@ -366,9 +372,9 @@ animation.
Background Color: 32 bits (_uint32_) Background Color: 32 bits (_uint32_)
: The default background color of the canvas in \[Blue, Green, Red, Alpha\] : The default background color of the canvas in \[Blue, Green, Red, Alpha\]
byte order. This color MAY be used to fill the unused space on the canvas around byte order. This color MAY be used to fill the unused space on the canvas
the frames, as well as the transparent pixels of the first frame. Background around the frames, as well as the transparent pixels of the first frame.
color is also used when disposal method is `1`. Background color is also used when disposal method is `1`.
**Note**: **Note**:
@ -389,7 +395,6 @@ This chunk MUST appear if the _Animation_ flag in the VP8X chunk is set.
If the _Animation_ flag is not set and this chunk is present, it If the _Animation_ flag is not set and this chunk is present, it
SHOULD be ignored. SHOULD be ignored.
ANMF chunk: ANMF chunk:
For animated images, this chunk contains information about a _single_ frame. For animated images, this chunk contains information about a _single_ frame.
@ -432,8 +437,8 @@ Frame Height Minus One: 24 bits (_uint24_)
Frame Duration: 24 bits (_uint24_) Frame Duration: 24 bits (_uint24_)
: The time to wait before displaying the next frame, in 1 millisecond units. : The time to wait before displaying the next frame, in 1 millisecond units.
In particular, frame duration of 0 is useful when one wants to update multiple In particular, frame duration of 0 is useful when one wants to update
areas of the canvas at once during the animation. multiple areas of the canvas at once during the animation.
Reserved: 6 bits Reserved: 6 bits
@ -441,13 +446,13 @@ Reserved: 6 bits
Blending method (B): 1 bit Blending method (B): 1 bit
: Indicates how transparent pixels of _the current frame_ are to be blended with : Indicates how transparent pixels of _the current frame_ are to be blended
corresponding pixels of the previous canvas: with corresponding pixels of the previous canvas:
* `0`: Use alpha blending. After disposing of the previous frame, render the * `0`: Use alpha blending. After disposing of the previous frame, render the
current frame on the canvas using [alpha-blending](#alpha-blending). If the current frame on the canvas using [alpha-blending](#alpha-blending). If
current frame does not have an alpha channel, assume alpha value of 255, the current frame does not have an alpha channel, assume alpha value of
effectively replacing the rectangle. 255, effectively replacing the rectangle.
* `1`: Do not blend. After disposing of the previous frame, render the * `1`: Do not blend. After disposing of the previous frame, render the
current frame on the canvas by overwriting the rectangle covered by the current frame on the canvas by overwriting the rectangle covered by the
@ -455,13 +460,13 @@ corresponding pixels of the previous canvas:
Disposal method (D): 1 bit Disposal method (D): 1 bit
: Indicates how _the current frame_ is to be treated after it has been displayed : Indicates how _the current frame_ is to be treated after it has been
(before rendering the next frame) on the canvas: displayed (before rendering the next frame) on the canvas:
* `0`: Do not dispose. Leave the canvas as is. * `0`: Do not dispose. Leave the canvas as is.
* `1`: Dispose to background color. Fill the _rectangle_ on the canvas covered * `1`: Dispose to background color. Fill the _rectangle_ on the canvas
by the _current frame_ with background color specified in the covered by the _current frame_ with background color specified in the
[ANIM chunk](#anim_chunk). [ANIM chunk](#anim_chunk).
**Notes**: **Notes**:
@ -585,8 +590,8 @@ Alpha bitstream: _Chunk Size_ - `1` bytes
: Encoded alpha bitstream. : Encoded alpha bitstream.
This optional chunk contains encoded alpha data for this frame. A This optional chunk contains encoded alpha data for this frame. A frame
frame containing a 'VP8L' chunk SHOULD NOT contain this chunk. containing a 'VP8L' chunk SHOULD NOT contain this chunk.
**Rationale**: The transparency information is already part of the 'VP8L' **Rationale**: The transparency information is already part of the 'VP8L'
chunk. chunk.
@ -624,8 +629,8 @@ significant fourth-character space) as its tag _or_ (ii) a VP8L chunk, using
"VP8L" as its tag. "VP8L" as its tag.
The formats of VP8 and VP8L chunks are as described in sections The formats of VP8 and VP8L chunks are as described in sections
[Simple file format (lossy)](#simple-file-format-lossy) [Simple File Format (Lossy)](#simple-file-format-lossy)
and [Simple file format (lossless)](#simple-file-format-lossless) respectively. and [Simple File Format (Lossless)](#simple-file-format-lossless) respectively.
#### Color profile #### Color profile
@ -673,7 +678,6 @@ EXIF Metadata: _Chunk Size_ bytes
: image metadata in EXIF format. : image metadata in EXIF format.
XMP chunk: XMP chunk:
0 1 2 3 0 1 2 3
@ -755,7 +759,8 @@ for loop = 0..loop_count - 1
Show the contents of the canvas for frame_params.frameDuration * 1ms. Show the contents of the canvas for frame_params.frameDuration * 1ms.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Example file layouts
Example File Layouts
-------------------- --------------------
A lossy encoded image with alpha may look as follows: A lossy encoded image with alpha may look as follows: