0

I am using the Go WebP decoder and it's giving me all the information that I am after except for one.

According to the WebP spec, VP8X signifies the extended file format. As part of this there seems to be a "A bitstream chunk may be either (i) a VP8 chunk, using "VP8 " (note the significant fourth-character space) as its tag or (ii) a VP8L chunk, using "VP8L" as its tag."

The question is, how can I access this? I'd like to extend the go decoder so that if I decode a WebP with VP8X, I wish to know whether the following chunk is VP8 or VP8L.

How would I achieve this?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Tamas
  • 10,953
  • 13
  • 47
  • 77
  • What sort of answer are you looking for? The code you link to has a top-level switch statement that handles the different types of chunk (including VP8L and VP8X), so it's not clear what's stopping you taking the code and editing it to do whatever you want. – Paul Hankin Mar 20 '20 at 08:57
  • I don't know how to find the VP8/VP8L chunk indicator when I receive a VP8X. Bearing in mind I'm also new to Go. – Tamas Mar 20 '20 at 09:31
  • The `decode` function in the webp decoder is reading chunks one at a time. You can set a flag or variable when you see a VP8X chunk, and then record whether you find a VP8 or VP8L chunk, returning it as an extra return parameter or whatever you want. – Paul Hankin Mar 20 '20 at 11:39
  • So essentially my question is how to "record whether you find a VP8 or VP8L chunk". – Tamas Mar 20 '20 at 14:29

0 Answers0