David | 24 Nov 11:56
Picon
Picon

PIZ-Compression / Multithreading

Hello Everyone,

i've got two little questions:
I'm developping a c++-tool to convert OpenExr-images from Maya to 
OpenExr-images which are optimized for Nuke (the tool creates a data 
window and converts the images into scanline-mode with piz compression).

Question 1: Why is the creation of a Image with piz-compression so slow 
comparing to the zip-compression? (The input-File is a tiled EXR with 
RLE-Compression). Is there a way to optimize the conversion from RLE to 
PIZ? The conversion is really slow (several minutes for a 2k exr with 10 
layers) so multithreading wouldn't fix the problem.

Question 2: I want to use Multithreading for writing an exr. Reading the 
documentation i thought i just have to set the GlobalThreadCount and 
then start the writePixels-function for every 20 scanlines (for example) 
again and again and the interface would do the thread-stuff 
automatically. But i don't see any effect. The writing takes exactly the 
same time. What is the right way to do that?

Thanks for your replies.

David
Florian Kainz | 24 Nov 19:38

Re: PIZ-Compression / Multithreading


David wrote:
> Hello Everyone,
> 
> i've got two little questions:
> I'm developping a c++-tool to convert OpenExr-images from Maya to 
> OpenExr-images which are optimized for Nuke (the tool creates a data 
> window and converts the images into scanline-mode with piz compression).
> 
> Question 1: Why is the creation of a Image with piz-compression so slow 
> comparing to the zip-compression? (The input-File is a tiled EXR with 
> RLE-Compression). Is there a way to optimize the conversion from RLE to 
> PIZ? The conversion is really slow (several minutes for a 2k exr with 10 
> layers) so multithreading wouldn't fix the problem.

For scanline-based files PIZ compression should be faster than ZIP
compression, although ZIP decompresses faster than PIZ.

PIZ does not work well for tiled files, unless the tiles are fairly large,
maybe 256x256 or 512x512 pixels.  For smaller tiles I recommend that you
use ZIP or PXR24.

PIZ generates a fairly large header for every tile.  If the tile is not
very large, then the header and the compressed pixels together are larger
than the raw, uncompressed pixels.  When this is the case, the tile is
stored uncompressed.  In addition to being large, generating the header
is expensive.  If your tiles are small, a large number of headers are
generated, only to be discarded as soon as the IlmImf library notices that
storing the "compressed" tiles are larger than the uncompressed ones.

(Continue reading)


Gmane