Skip to content

Commit

Permalink
remove redudant re-calculation of JMcusp and focusJ in getReachBounda…
Browse files Browse the repository at this point in the history
…ry() function, instead passing them in as already calculated
  • Loading branch information
scottdyer committed Aug 17, 2024
1 parent 5f0c3a9 commit feb97bd
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/Lib.Academy.OutputTransform.ctl
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,8 @@ float[3] getReachBoundary(float J,
float M,
float h,
ODTParams PARAMS,
float gamutCuspTable[][3],
float JMcusp[2],
float focusJ,
float reachTable[])
{
float limitJmax = PARAMS.limitJmax;
Expand All @@ -868,10 +869,6 @@ float[3] getReachBoundary(float J,

const float reachMaxM = reachMFromTable(h, reachTable);

float JMcusp[2] = cuspFromTable(h, gamutCuspTable);
float focusJ = lerp(JMcusp[0],
midJ,
min(1.0, cuspMidBlend - (JMcusp[0] / limitJmax)));
float slope_gain = limitJmax * focusDist * getFocusGain(J, JMcusp[0], limitJmax);

float intersectJ = solve_J_intersect(J, M, focusJ, limitJmax, slope_gain);
Expand Down Expand Up @@ -938,7 +935,8 @@ float[3] compressGamut(float JMh[3],
JMboundary[1],
JMh[2],
PARAMS,
gamutCuspTable,
JMcusp,
focusJ,
reachTable);

float difference = max(1.0001, reachBoundary[1] / JMboundary[1]);
Expand Down

0 comments on commit feb97bd

Please sign in to comment.