Hi Neall, The RGBA/YCA conversion code is convoluted mostly because of the buffer management that is required to support random access to scan lines in the API with reasonable efficiency. For example, if you read a YCA file, then RGBA scan line n in your frame buffer depends on YCA scan lines n-13 through n+13. If you have already read one scan line, then reading a nearby scan line will be relatively fast because the library can reuse some intermediate results from the YCA to RGBA conversion for the first scan line.
RGBA to sub-sampled YCA conversion is a lot easier - and a bit faster - if you can convert an entire frame at once. The conversion requires the following steps: - convert each RGBA pixel to YCA format - low-pass filter and sub-sample the YCA pixels horizontally - low-pass filter and sub-sample the YCA pixels vertically The public header file ImfRgbaYca.h contains a set of helper functions that perform these steps. The routines have been designed to minimize generational loss when pixels are repeatedly converted back and forth between RGBA and YCA. Florian Neall Verheyde wrote:
To reduce file size for our stereo-pair renders, I'm experimenting with YCA encoded images. Something like this is the goal: channels (type chlist): A, 16-bit floating-point, sampling 1 1 Y, 16-bit floating-point, sampling 1 1 RY, 16-bit floating-point, sampling 2 2 BY, 16-bit floating-point, sampling 2 2 right.A, 16-bit floating-point, sampling 1 1 right.Y, 16-bit floating-point, sampling 1 1 right.RY, 16-bit floating-point, sampling 2 2 right.BY, 16-bit floating-point, sampling 2 2 The problem I'm encountering is the RgbaOutputFile class does not seem to support writing out more than four channels, and it does not support writing out the multi-view prefix. The RgbaReader class seems to have some support for the latter feature, although we are currently using the lower-level Input/OutputFile classes for reading and writing. This suggests we have to pack and unpack the YCA channels, with help from the functions in ImfRgbaYca.h but doing this looks to be complicated if the private RgbaOutputFile::ToYca helper class is any indication. Is there a relatively painless way to create multiview YCA images without having to cut-and-paste swaths of private implementation contained inside ImfRgbaFile.cpp? I'm currently using OpenEXR 1.7.1. Thanks, Neall. Gener8 Digital Media _______________________________________________ Openexr-devel mailing list Openexr-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/openexr-devel
_______________________________________________ Openexr-devel mailing list Openexr-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/openexr-devel