-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log2Lin's lin2log math might be incorrect #76
Comments
There is definitely an inconsistency between the two formulas.
I can't find where I got these formulas from. Do you have a reference? Maybe the log2lin formula is wrong, and not the lin2log? |
This doc, which is to be the foundation to Cineon, seems to imply that log2lin is wrong, rather than lin2log: |
Does this look good to you? c89ac63 |
The inverse math and the spec make sense to me! I thought the lin2log was wrong because the log2lin matches nuke. But the spec implies nuke's math is wrong
they shuffled a couple things around, divides instead of multiplies
The minus offset is happening before the gain. am I crazy? |
@markreidvfx I see that python colour' version refers to This formula in Sony's code which implies that lin2log is wrong, as you initially said. Do we agree on this? (sorry, I need you as a reviewer) Edit: There's also this code in ACES |
Yes I agree, I think it might be best fix the lin2log like I initially suggested. python colour's lin2log version seems to also match the one I formulated by inverting the log2lin. I still find it a bit un-nerving that the spec says otherwise, but I guess it is better to be compatible other implementations. |
Does #79 look right? |
* Lin2Log: fix inconsistency between log2lin and lin2log See #76
closed by #79 |
sorry, I missed this, looks good to me! |
Hi,
I was looking at the implementation of log2lin for reference and I think the lin2log math might be incorrect.
https://github.com/NatronGitHub/openfx-misc/blob/master/Log2Lin/Log2Lin.cpp#L146
the comment there says
To me, the should cineon lin2log expression be
v/gain + offset
instead of(v + offset)/gain
Also the comment shows up twice in the file and the first one is different
The text was updated successfully, but these errors were encountered: