Animated WebP: add "do no blend" option to spec

Marking certain frames as "do not blend" helps avoiding alpha-blending
at decode/render time.

It also helps inserting I-frames (frames which can be independently
decoded) into the animation.

Change-Id: Iaa222805db88d2f1c81104ce9d882e7c7ff8cfdb
This commit is contained in:
Urvang Joshi 2013-08-09 14:02:39 -07:00
parent f486aaa9f8
commit d5bad03328
2 changed files with 17 additions and 6 deletions

1
NEWS
View File

@ -6,6 +6,7 @@
time-to-first-decoded-pixel. time-to-first-decoded-pixel.
* WebPIterator has a new member 'has_alpha' denoting whether the frame * WebPIterator has a new member 'has_alpha' denoting whether the frame
contains transparency. contains transparency.
* Container spec amended with new 'blending method' for animation.
- 6/13/13: version 0.3.1 - 6/13/13: version 0.3.1
This is a binary compatible release. This is a binary compatible release.

View File

@ -419,7 +419,7 @@ If the _Animation flag_ is not set, then this chunk SHOULD NOT be present.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
... | Frame Height Minus One | ... | Frame Height Minus One |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Frame Duration | Reserved |D| | Frame Duration | Reserved |B|D|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Frame Data | | Frame Data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@ -448,10 +448,24 @@ Frame Duration: 24 bits (_uint24_)
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 multiple
areas of the canvas at once during the animation. areas of the canvas at once during the animation.
Reserved: 7 bits Reserved: 6 bits
: SHOULD be 0. : SHOULD be 0.
Blending method (B): 1 bit
: Indicates how transparent pixels of _the current frame_ are to be blended with
corresponding pixels of the previous canvas:
* `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 does not have an alpha channel, assume alpha value of 255,
effectively replacing the rectangle.
* `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.
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 displayed
@ -463,10 +477,6 @@ Disposal method (D): 1 bit
by the _current frame_ with background color specified in the by the _current frame_ with background color specified in the
[ANIM chunk](#anim_chunk). [ANIM chunk](#anim_chunk).
After disposing the current frame, render the next frame on the canvas using
[alpha-blending](#alpha-blending). If the next frame does not have an alpha
channel, assume alpha value of 255, effectively replacing the rectangle.
**Notes**: **Notes**:
* The frame disposal only applies to the _frame rectangle_, that is, the * The frame disposal only applies to the _frame rectangle_, that is, the