Difference between incremental and scanline image decoding

152 views
Skip to first unread message

Hasan

unread,
Sep 18, 2018, 8:13:25 AM9/18/18
to skia-discuss
I am going through the skia image encode and decode for last few days. While reading the skcodec, i could not find the basic difference between incremental decode and scanline decode.

Where i can use incremental decode where i can not.

Hal Canary

unread,
Sep 18, 2018, 9:57:07 AM9/18/18
to skia-discuss
For 95% of use cases, you probably just want SkImage::MakeFromEncoded().

On Tue, Sep 18, 2018 at 8:13 AM Hasan <ahmo...@gmail.com> wrote:
I am going through the skia image encode and decode for last few days. While reading the skcodec, i could not find the basic difference between incremental decode and scanline decode.

Where i can use incremental decode where i can not.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

Leon Scroggins

unread,
Sep 18, 2018, 11:43:42 AM9/18/18
to skia-d...@googlegroups.com
Hal is correct, but read on if you're still curious.

Scanline decoding allows you to only decode some lines of an image. If you only want a subset of the whole image, or you want to skip say every other line to quickly get a smaller version of the image without decoding the entire image into memory, you can use scanline decoding. Android uses it for these reasons.

Incremental decoding is designed for a browser use case: we only have part of the data, so we decode what we have, and then we resume decoding once more data has been received. In order to share code and (eventually) keep the API smaller, incremental decoding replaces scanline decoding for the codecs that I've updated. At the moment, this means that only incremental decoding is supported for png and gif, while the others (minus webp) support only scanline decoding. 

On Tue, Sep 18, 2018 at 9:56 AM, 'Hal Canary' via skia-discuss <skia-d...@googlegroups.com> wrote:
For 95% of use cases, you probably just want SkImage::MakeFromEncoded().
On Tue, Sep 18, 2018 at 8:13 AM Hasan <ahmo...@gmail.com> wrote:
I am going through the skia image encode and decode for last few days. While reading the skcodec, i could not find the basic difference between incremental decode and scanline decode.

Where i can use incremental decode where i can not.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss+unsubscribe@googlegroups.com.

To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss+unsubscribe@googlegroups.com.

To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.



--

 •  Leon Scroggins

 •  scr...@google.com


Message has been deleted

Hasan

unread,
Sep 18, 2018, 11:50:24 PM9/18/18
to skia-discuss
I don't find incremental decoding in skjpegcodec. Does skia have any support for incremental decoding for jpeg???

Leon Scroggins

unread,
Sep 20, 2018, 9:11:41 AM9/20/18
to skia-d...@googlegroups.com
Not yet.

On Tue, Sep 18, 2018 at 11:50 PM, Hasan <ahmo...@gmail.com> wrote:
I don't find incremental decoding in skjpegcodec. Does skia have any support for incremental decoding for jpeg???
--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.



--

 •  Leon Scroggins

 •  scr...@google.com


Hasan

unread,
Sep 20, 2018, 9:47:07 AM9/20/18
to skia-discuss
Is there any difference between incremental decoding and progressive decoding? or incremental uses progressive decoding??

Leon Scroggins

unread,
Sep 20, 2018, 10:08:31 AM9/20/18
to skia-d...@googlegroups.com
SkCodec's incremental decoding could be described as progressive decoding, and it's possible it's referred to that way in some places. But are you asking about progressive jpegs? SkJpegCodec decodes progressive jpegs.

On Thu, Sep 20, 2018 at 9:47 AM, Hasan <ahmo...@gmail.com> wrote:
Is there any difference between incremental decoding and progressive decoding? or incremental uses progressive decoding??
--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.



--

 •  Leon Scroggins

 •  scr...@google.com


Reply all
Reply to author
Forward
0 new messages