aces-docs icon indicating copy to clipboard operation
aces-docs copied to clipboard

ACEScct decoding equation creates ambiguity by using `\leq` twice

Open nick-shaw opened this issue 8 months ago • 0 comments

https://github.com/ampas/aces-docs/blob/b1e27c75c3d6bb26736ccf80f854afbcf2fe4b03/mkdocs/docs/specifications/acescct/index.md?plain=1#L150

The logarithmic portion of ACEScct is given here as being used if 0.155251141552511 <= ACEScct. But the linear portion is used if ACEScct <= 0.155251141552511. This creates ambiguity when ACEScct == 0.155251141552511.

I believe the logarithmic portion should begin with a less than symbol, not less than or equal to. That is what is used in the CSC CTL.

I note also that the CSC does not clamp at 65504 as is defined in the spec. It makes logical sense not to clamp in a float32 implementation, but that is not what the space says. I would think that either the CTL should follow the spec, or (probably preferably) the clamp should be removed from the spec, and a note added that implementations should ensure that if writing output to a half-float EXR it is advisable to pre-clamp to 65504 if a clamp is not implemented in the EXR writer.

In any case, clamping the output of the ACEScct to linear function to 65504 does not guarantee that values written to a half float EXR will be within the representable range. The AP1 to AP0 matrix could still push values beyond 65504.

e.g.

AP1 = [0, 0, 65504]
AP0 = [10734.07905124,   6257.87998005,  65602.30003517]

nick-shaw avatar Apr 13 '25 16:04 nick-shaw