christianlett
New member
- Joined
- Jun 28, 2014
- Messages
- 3
Hello everyone,
I hope someone can help me find the inverse of the following function, which converts a log curve for a video signal into linear space. Actually there are two functions depending on the value of x:
if(x >= 0.08797653958944)
y = 0.21407624633431 * (pow(10.0, (((x - 0.0625) / 0.85630498533724 - 0.616596 - 0.03) / 0.432699)) - 0.037584) / 0.15151515151515 * 0.9
else // if x < 0.08797653958944
y = ((x - 0.0625) / 0.85630498533724 - 0.030001222851889303) / 3.53881278538813 * 0.9;
As you can see the numbers are all constant real numbers, so the only variable is x.
This works in my program to convert from SLog2 space to linear. What I need to do (but can't find anywhere online) is to convert back from linear to SLog2.
So far I've calculated the cutoff (i.e. the if(x >= z) statement for the inverse is:
if(x >= 0.00006341446058)
and the function for this part will require using log10() to reverse it.
Any help will be greatly appreciated. This is for an After Effects plugin I'm writing in C++.
Thanks in advance.
Christian
I hope someone can help me find the inverse of the following function, which converts a log curve for a video signal into linear space. Actually there are two functions depending on the value of x:
if(x >= 0.08797653958944)
y = 0.21407624633431 * (pow(10.0, (((x - 0.0625) / 0.85630498533724 - 0.616596 - 0.03) / 0.432699)) - 0.037584) / 0.15151515151515 * 0.9
else // if x < 0.08797653958944
y = ((x - 0.0625) / 0.85630498533724 - 0.030001222851889303) / 3.53881278538813 * 0.9;
As you can see the numbers are all constant real numbers, so the only variable is x.
This works in my program to convert from SLog2 space to linear. What I need to do (but can't find anywhere online) is to convert back from linear to SLog2.
So far I've calculated the cutoff (i.e. the if(x >= z) statement for the inverse is:
if(x >= 0.00006341446058)
and the function for this part will require using log10() to reverse it.
Any help will be greatly appreciated. This is for an After Effects plugin I'm writing in C++.
Thanks in advance.
Christian