Skip to content

Commit

Permalink
fix a divide by zero error that can occur in the inverse compression …
Browse files Browse the repository at this point in the history
…function, improving the roundtrip especially for HDR

fix issue ampas#158
  • Loading branch information
scottdyer committed Nov 14, 2024
1 parent 89a10fd commit f95e420
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Lib.Academy.OutputTransform.ctl
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ float compressionFunction(float v,

if (invert)
{
if (v < thr || lim < 1.0001 || v > thr + s)
if (v < thr || lim <= 1.0001 || v > thr + s)
{
vCompressed = v;
}
Expand All @@ -504,7 +504,7 @@ float compressionFunction(float v,
}
else
{
if (v < thr || lim < 1.0001)
if (v < thr || lim <= 1.0001)
{
vCompressed = v;
}
Expand Down

0 comments on commit f95e420

Please sign in to comment.