WebPIDecoder* idec = WebPINewDecoder(NULL, NULL, &config);
// Question1: In libwebp, WEBP_EXTERN(WebPIDecoder*) WebPINewDecoder(WebPDecBuffer* output_buffer);
// It takes only one parameter "WebPDecBuffer", but the doc takes 3.
CHECK(idec != NULL);
// Question2: What is bytes_remaining? If I'm downloading an image, and whenever I received some data, should I process the data?
// Or must I do the decoding after the whole data for the image is downloaded?(Because I don't know the byte_remaining until it is fully downloaded)
while (bytes_remaining > 0) {
// Question3: what is the input parameter? What is bytes_read?
VP8StatusCode status = WebPIAppend(idec, input, bytes_read);
if (status == VP8_STATUS_OK || status == VP8_STATUS_SUSPENDED) {
bytes_remaining -= bytes_read;
} else {
break;
}
// generate image
}
WebPIDelete(idec);
I have read the Doc for decoding progressive webp. But I have some questions.
WebPIDecoder* idec = WebPINewDecoder(NULL, NULL, &config);
// Question1: In libwebp, WEBP_EXTERN(WebPIDecoder*) WebPINewDecoder(WebPDecBuffer* output_buffer);
// It takes only one parameter "WebPDecBuffer", but the doc takes 3.
CHECK(idec != NULL);
// Question2: What is bytes_remaining? If I'm downloading an image, and whenever I received some data, should I process the data?
// Or must I do the decoding after the whole data for the image is downloaded?(Because I don't know the byte_remaining until it is fully downloaded)
// WebPInitDecBuffer(&buffer); | |
// buffer.colorspace = mode; | |
// ... | |
// WebPIDecoder* idec = WebPINewDecoder(&buffer); | |
// while (has_more_data) { | |
// // ... (get additional data) | |
// status = WebPIAppend(idec, new_data, new_data_size); | |
// if (status != VP8_STATUS_SUSPENDED || | |
// break; | |
// } | |
// | |
// // The above call decodes the current available buffer. | |
// // Part of the image can now be refreshed by calling to | |
// // WebPIDecGetRGB()/WebPIDecGetYUVA() etc. | |
// } | |
// WebPIDelete(idec); |
while (bytes_remaining > 0) {
// Question3: what is the input parameter? What is bytes_read?
Could you please help me figure out the Questions above?
VP8StatusCode status = WebPIAppend(idec, input, bytes_read);
if (status == VP8_STATUS_OK || status == VP8_STATUS_SUSPENDED) {
bytes_remaining -= bytes_read;
} else {
break;
}
// generate image
}
WebPIDelete(idec);And I would be grateful if you can attach sample code here...
Thanks a lot! By the way, is all webp images support progressively decode? Or only those are encoded "progressively"?
--
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+unsubscribe@webmproject.org.
To post to this group, send email to webp-d...@webmproject.org.
Visit this group at https://groups.google.com/a/webmproject.org/group/webp-discuss/.
For more options, visit https://groups.google.com/a/webmproject.org/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to webp-discuss...@webmproject.org.
It's great. And for decoding, there are three types: interlaced, baseline, progressive.
Is there any option to choose the progressive decoding?
Actually I am trying to adopting the interlaced or progressive decoding to make better experience in our app. Baseline decoding may be helpful but interlaced or progressive decodings are better(For example: apply blur before the final image is downloaded).
To unsubscribe from this group and stop receiving emails from it, send an email to webp-discuss+unsubscribe@webmproject.org.
Finally, I tested decoding progressively. Is it the "raster order" you mentioned?
😂It's sad... Will webp format support 'interlaced' encoding and decoding?Or for some reason it won't?
在 2016年11月9日星期三 UTC+8下午3:45:12,skal写道:Hi,On Tue, Nov 8, 2016 at 12:56 AM, 蔡哲人 <caiz...@gmail.com> wrote:Finally, I tested decoding progressively. Is it the "raster order" you mentioned?This 'raster order' corresponds to the 'baseline' case:One trick, to experience incremental refresh using Chrome, is to force a slow connection with the developer tools:If you open the 'Developer Tools', in the Network tab, you can disable the cache and select a GPRS connection.Then, if you try to upload a webp image like this one http://www.gstatic.com/webp/gallery/5.webpyou should see the image being incrementally displayed as bytes arrive.skal/
--
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+unsubscribe@webmproject.org.
Hi,
To unsubscribe from this group and stop receiving emails from it, send an email to webp-discuss...@webmproject.org.