It computes the following formulas:
Code:
a = 0.05
x1 = (x - 32768) / 32768 ; x1 in -1...1
x2 = 1.5 * x1 - 0.5 * x1^3 ; 1st S curve
x3 = (1 + a) * x2 - a * x2^3 ; 2nd S curve
y = x3 * 32768 + 32768 ; Back to 0...65535
First formula converts x from 0–65535 range to -1–+1.
Second formula is the main S curve, keeping x2 in the same range as x1.
Third formula is a second S curve, because the first curve was not enough. The formula is actually the same as the main one, but with a smaller curvature coefficient (0.05 instead of 0.5).
Finally, the fourth formula converts the value back to the 16-bit scale.
Given the CineStyle doc and the provided LUT, the curve works on RGB components, however it's not very clear if they are linear or gamma-compressed. I'd say it's most likely the latter. Working on the Y' signal would not give the expected results.