Extended WebP file header

38 views
Skip to first unread message

popov.sta...@gmail.com

unread,
Apr 24, 2015, 3:06:21 PM4/24/15
to webp-d...@webmproject.org
Hi!
The documentation states that information on the expansion and the height comes after the reserved 24 bits, but in fact the file is present between 4 bytes, the figure shown in Red square, what kind of bytes?
Thanks in advance!
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                   WebP file header (12 bytes)                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      ChunkHeader('VP8X')                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Rsv|I|L|E|X|A|R|                   Reserved                    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Canvas Width Minus One               |             ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
...  Canvas Height Minus One    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Link documentation: https://developers.google.com/speed/webp/docs/riff_container
Link to file https://www.gstatic.com/webp/gallery3/1_webp_a.webp

Urvang Joshi

unread,
Apr 24, 2015, 3:21:44 PM4/24/15
to webp-d...@webmproject.org
Hi,

On Fri, Apr 24, 2015 at 12:06 PM <popov.sta...@gmail.com> wrote:
Hi!
The documentation states that information on the expansion and the height comes after the reserved 24 bits, but in fact the file is present between 4 bytes, the figure shown in Red square, what kind of bytes?
Thanks in advance! 
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                   WebP file header (12 bytes)                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      ChunkHeader('VP8X')                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Rsv|I|L|E|X|A|R|                   Reserved                    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Canvas Width Minus One               |             ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
...  Canvas Height Minus One    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Notice that the the diagram shows the information in little-endian order.
So, its  'flags' byte, followed by 3 reserved bytes, followed by width & height.
So, in the red square:
10 <-- flags [Only alpha flag is on in this case].
00 00 00 <-- 3 reserved bytes

Hope that answers your question.
 

--
You received this message because you are subscribed to the Google Groups "WebP Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webp-discuss...@webmproject.org.
To post to this group, send email to webp-d...@webmproject.org.
Visit this group at http://groups.google.com/a/webmproject.org/group/webp-discuss/.
For more options, visit https://groups.google.com/a/webmproject.org/d/optout.
Message has been deleted

Stanislav

unread,
Apr 25, 2015, 9:28:51 AM4/25/15
to webp-d...@webmproject.org
Thank you!
In this case it is not clear that the green square mean The first program in the image (0a 00 00 00)?

Urvang Joshi

unread,
Apr 27, 2015, 2:49:19 PM4/27/15
to webp-d...@webmproject.org
On Sat, Apr 25, 2015 at 6:28 AM Stanislav <popov.sta...@gmail.com> wrote:
Thank you!
In this case it is not clear that the green square mean The first program in the image (0a 00 00 00)?

As described in this section: https://developers.google.com/speed/webp/docs/riff_container#riff_file_format, "ChunkHeader('ABCD')" includes a 4 byte fourcc and a byte chunk size.

So, in your diagram, "ChunkHeader(VP8X)" means "VP8X" followed by 4 byte size of VP8X chunk (which is 10) -- this is what the green square "0a 00 00 00" shows.

Stanislav

unread,
Apr 27, 2015, 3:19:20 PM4/27/15
to webp-d...@webmproject.org
Thank you!

Stanislav

unread,
Apr 28, 2015, 3:26:40 PM4/28/15
to webp-d...@webmproject.org
Excuse me, even 1 question ...)
After the title ALPH 4 byte size too (e5 0e 00 00)?

Urvang Joshi

unread,
Apr 28, 2015, 3:31:40 PM4/28/15
to webp-d...@webmproject.org
Yes, this applies to all the chunks.
In this case size of ALPH chunk is 0x00000ee5, that is 3813 bytes.

Stanislav

unread,
Apr 29, 2015, 1:30:50 PM4/29/15
to webp-d...@webmproject.org
Excellent! Thank you!
Reply all
Reply to author
Forward
0 new messages