libpng is currently single threaded. That is a bottleneck in applications. For instance during conversion of CameraRAW images, including colour conversion, the libpng writer takes the longest time.
Therefore I would like to parallelise through OpenMP like follows:
for(y = 0; y < height; ++y)
{
void * p = getLine( image, y );
png_bytep pointers[2] = {0,0};
pointers[0] = p;
png_write_rows(png_ptr, pointers, 1);
}
Would a per line compression have side effects on compression ration?
Makes threaded PNG reading sense?
Per-line compression would have adverse affects because the zlib dictionary would have to be restarted at the beginning of each line. Per-line decoding could only work with PNG files that are known to have been per-line compressed.
If one is using OpenMP to compress/decompress multiple image files in an application already, OpenMP will not work anymore (no thread in thread in OpenMP possible).
Side effects to thousend of implementations are huge.