-
Notifications
You must be signed in to change notification settings - Fork 20
Description
This extension introduces restart markers for PNG images with a new chunk and a backward-compatible encoding method, it enables parallel encoding and decoding of image data.
The IDAT stream is split into segments with each segment corresponding to a subset of the image. For compression method 0 (DEFLATE) each segment ends with a full flush marker, allowing each segment of the image data to be decompressed in parallel.
To eliminate data dependencies between segments the first scanline of each segment's filter type is restricted to algorithm's that do not reference the previous scanline, allowing each segment to be encoded and decoded in parallel.
It defines one segmentation method (which basically splits the image horizontally into N
strips) and two segmentation types, one with offsets and one without. I believe there should be only one but for now this will allow to us to implement both and weigh the pros and cons.
https://github.com/libspng/png-restart-marker
The repository includes a RATIONALE.md for some of the design decisions. I also have an implementation but it's for an older revision of this spec, will have that ready soon.
EDIT: and those pesky interlaced images, I can't think of a sane way to split them up beyond 2 segments so I just excluded them entirely from the spec.