|
From: | peterh |
Subject: | Re: [Openexr-devel] Floating Point Questions (and a C Question) |
Date: | Sat, 27 Apr 2013 19:23:18 +1200 |
User-agent: | Roundcube Webmail/0.8.4 |
HI Vincent, To vaguely answer your questions:
2. From experience, half float is good enough for storing images without perceptual loss, performing better than 12 bit log encoded data. Non-image data is a different story. half float may not be enough to store depth data, UV maps, motion vectors etc. The best approach is to see what happens! All floating point operations are 'lossy' in that they have finite precision - it's just that 16 bit half float is more lossy than 32 bit float, and much more lossy than 64 bit float. In the same way that sometimes double floats are required to maintain required precision or to represent very large or small numbers, there are times that half float is sufficient for the required precision and data range. Of course, OpenEXR can support storing data as 32 bit float as well, so you can use that for cases which need more precision. 3. I don't follow where the -1 to 1 comes from. Image data can have values which are arbitrarily large, by using a HDR image combiner or in CG. (In fact explosions, lightning etc, rendered in CG can easily max out the range of half). Negative values are often present, too - it can happen due to black level subtraction in cameras, film base subtraction in film scanning, or gamut mapping operations. So the full range of half float is used, even for 'regular' image data. However, in short: yes, the lossless compression schemes do take advantage of the fact that a run of values in a channel are likely to be in a similar range, and use that to help the compression when that is the case. For details see the implementation of the compress and uncompress functions in https://github.com/openexr/openexr/blob/master/OpenEXR/IlmImf/ImfZipCompressor.cpp Peter On 2013-04-27 13:43, Vincent Olivier wrote: Hi guys, |
[Prev in Thread] | Current Thread | [Next in Thread] |