|
From: | Florian Kainz |
Subject: | Re: [Openexr-devel] B44 question |
Date: | Tue, 31 Jul 2007 18:24:30 -0700 |
User-agent: | Mozilla Thunderbird 1.0 (X11/20041207) |
The document at http://www.openexr.com/openexrfilelayout.pdf describes the on-disk format of OpenEXR files. The document should be enough to calculate how much space is used by the file header and other auxiliary data. The source code and comments in file ImfB44Compressor.cpp are currently the only detailed description of how B44 compression works. It will take a bit of work, but you should be able to derive a relatively formula that tells you exactly how big the compressed pixel data are. If you work out an exact formula for the file sizes, would you mind publishing it? Hai Nguyen wrote:
Thanks, Florian.That information was actually on the web site - I should have been more paying more attention. :)What I'm trying to do is to compress an image in memory to B44 and save it off in a chunk of memory. Then derive something form IStream to read it back during play back. I think someone was trying to do something similarsometime ago - I saw it in the archives.The motivation for my initial question was to avoid having to write out to a temporary file and read it back in. This requires me to make a guess at what the maximum size of the compressed data would be.Do you have any recommendations/suggestions for a process like this? - Hai Florian Kainz wrote:Hai, the B44 compression rate is fixed; it does not depend on image content. If you store the pixels as RGB data, the compression rate for the raw pixels is 32:14 (approximately 2.28:1). If you store the pixels asluminance/chroma data, the compression rate is 32:7 (approximately 4.57:1). In addition to the pixels, the file contains header data and some padding,so the overall compression rate will be slightly less. Since the compression rate is fixed, the easiest way to determine the size of a file with given dimensions, is to compress one image; other images will have the same size. I don't have an exact formula for the size of B44-compressed files, but if necessary, we can probably work it out. Florian Hai Nguyen wrote:Hi,I am wondering if there was a formula of some type of find the maximum size of a B44 compressed image give its dimensions? I briefly looked through the header files but I couldn't find what type the final compresseddata is stored in. Thanks, - Hai _______________________________________________ Openexr-devel mailing list address@hidden http://lists.nongnu.org/mailman/listinfo/openexr-devel_______________________________________________ Openexr-devel mailing list address@hidden http://lists.nongnu.org/mailman/listinfo/openexr-devel
[Prev in Thread] | Current Thread | [Next in Thread] |