Pre-Review: Op Collapsing


Jeremy Selan <jeremy...@...>
 

I have some development under progress, not yet ready for review, but I thought it may interest people:
https://github.com/imageworks/OpenColorIO/pull/218

During processor creation, this branch adds an internal optimization pass that makes for more efficient color processing.
https://github.com/jeremyselan/OpenColorIO/blob/opt/src/core/OpOptimizers.cpp

But the most interesting consequence is that this allows for transforms which were not previously possible:

Say you have 2 colorspaces: A and B.  Both of these these colorspaces apply the same 3D lut, but B then also applies an additional matrix.

Previously, it would not have been possible to compute the processor to go directly from A to B because an inverse 3d lut is needed.
old op chain:   LUT3D (inv) -> LUT3D (forward) -> matrix

However, the new optimizer will detect that the same 3dlut is being applied in a row in both an inverse and forward direction, and they will cancel out! (This works even if the nesting is deep.)

new op chain: matrix

Remaining tasks:
- substantially more unit tests
- matrix concatenation.

-- Jeremy


Join ocio-dev@lists.aswf.io to automatically receive all group messages.