Skip to content

Commit

Permalink
remove toe dechroma. it was a bad idea.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jed Smith committed Jul 26, 2021
1 parent acdb07c commit 0b566d7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
10 changes: 3 additions & 7 deletions OpenDRT/nuke/OpenDRT.nk
Expand Up @@ -3,7 +3,7 @@ push $cut_paste_input
Group {
name OpenDRT
addUserKnob {20 OpenDRT}
addUserKnob {26 about_label l " " T "<style> a:link \{ color: #ccc \}</style>\n<font color=#ccc>\n<b>OpenDRT</b> created by Jed Smith\n<br>v0.0.82 | <a href=https://github.com/jedypod/open-display-transform>documentation</a><br>"}
addUserKnob {26 about_label l " " T "<style> a:link \{ color: #ccc \}</style>\n<font color=#ccc>\n<b>OpenDRT</b> created by Jed Smith\n<br>v0.0.83 | <a href=https://github.com/jedypod/open-display-transform>documentation</a><br>"}
addUserKnob {41 gamut l "input gamut" T InGamut_to_XYZ.gamut}
addUserKnob {26 spacer l " " T ""}
addUserKnob {35 presets l " " M {"presets/Rec.1886: 2.4 Power | Rec.709" "knobs this \{Lw 100 c 1.4 surround 1 saturation 1.2 wp 3 eotf 2 display_gamut 4\}" "presets/sRGB Display: 2.2 Power | Rec.709" "knobs this \{Lw 100 c 1.4 surround 0 saturation 1.2 wp 3 eotf 1 display_gamut 4\}" "presets/Apple Display P3: 2.2 Power | P3D65" "knobs this \{Lw 100 c 1.4 surround 0 saturation 1.2 wp 3 eotf 1 display_gamut 1\}" "presets/Rec.2020: 2.4 Power | Rec.2020" "knobs this \{Lw 100 c 1.4 surround 1 saturation 1.2 wp 3 eotf 2 display_gamut 0\}" "presets/Rec.2100: ST 2084 PQ | Rec.2020 | 100 nit" "knobs this \{Lw 100 c 1.4 surround 1 saturation 1.2 wp 3 eotf 4 display_gamut 0\}" "presets/Rec.2100: ST 2084 PQ | Rec.2020 | 600 nit" "knobs this \{Lw 600 c 1.2 surround 2 saturation 1 wp 3 eotf 4 display_gamut 0\}" "presets/Rec.2100: ST 2084 PQ | Rec.2020 | 1000 nit" "knobs this \{Lw 1000 c 1.2 surround 2 saturation 1 wp 3 eotf 4 display_gamut 0\}" "presets/Rec.2100: HLG | Rec.2020 | 1000 nit" "knobs this \{Lw 1000 c 1.2 surround 2 saturation 1 wp 3 eotf 5 display_gamut 0\}" "presets/Rec.2100: ST 2084 PQ | Rec.2020 | 2000 nit" "knobs this \{Lw 2000 c 1.2 surround 2 saturation 1 wp 3 eotf 4 display_gamut 0\}" "presets/Rec.2100: ST 2084 PQ | Rec.2020 | 4000 nit" "knobs this \{Lw 4000 c 1.2 surround 2 saturation 1 wp 3 eotf 4 display_gamut 0\}" "presets/Dolby: ST 2084 PQ | P3D65 | 100 nit" "knobs this \{Lw 100 c 1.4 surround 1 saturation 1.2 wp 3 eotf 4 display_gamut 1\}" "presets/Dolby: ST 2084 PQ | P3D65 | 600 nit" "knobs this \{Lw 600 c 1.2 surround 2 saturation 1 wp 3 eotf 4 display_gamut 1\}" "presets/Dolby: ST 2084 PQ | P3D65 | 1000 nit" "knobs this \{Lw 1000 c 1.2 surround 2 saturation 1 wp 3 eotf 4 display_gamut 1\}" "presets/Dolby: ST 2084 PQ | P3D65 | 2000 nit" "knobs this \{Lw 2000 c 1.2 surround 2 saturation 1 wp 3 eotf 4 display_gamut 1\}" "presets/Dolby: ST 2084 PQ | P3D65 | 4000 nit" "knobs this \{Lw 4000 c 1.2 surround 2 saturation 1 wp 3 eotf 4 display_gamut 1\}" "presets/DCI: 2.6 Power | P3 D60" "knobs this \{Lw 100 c 1.4 surround 2 saturation 1.2 wp 3 eotf 3 display_gamut 2\}" "presets/DCI: 2.6 Power | P3 D65" "knobs this \{Lw 100 c 1.4 surround 2 saturation 1.2 wp 3 eotf 3 display_gamut 1\}" "presets/DCI: 2.6 Power | P3 DCI" "knobs this \{Lw 100 c 1.4 surround 2 saturation 1.2 wp 3 eotf 3 display_gamut 3\}" "presets/DCI: 2.6 Power | DCDM XYZ" "knobs this \{Lw 100 c 1.4 surround 2 saturation 1.2 wp 3 eotf 3 display_gamut 5\}"}}
Expand Down Expand Up @@ -318,10 +318,8 @@ push $Nf55f4100
temp_expr0 Ar
temp_name1 ns
temp_expr1 Br
temp_name2 nt
temp_expr2 (n*n)/(n+t0)
channel0 rgba
expr0 nt==0?0:nt/ns
expr0 nt==0?0:n/ns
channel1 none
channel2 none
channel3 none
Expand Down Expand Up @@ -692,10 +690,8 @@ push $Nf5528100
temp_expr0 Ar
temp_name1 ns
temp_expr1 Br
temp_name2 nt
temp_expr2 (n*n)/(n+t0)
channel0 rgba
expr0 nt==0?0:nt/ns
expr0 nt==0?0:n/ns
channel1 none
channel2 none
channel3 none
Expand Down
6 changes: 3 additions & 3 deletions OpenDRT/resolve/OpenDRT.dctl
@@ -1,6 +1,6 @@
/* OpenDRT
-------------------------------------------------
v0.0.82
v0.0.83
Written by Jed Smith
https://github.com/jedypod/open-display-transform
*/
Expand Down Expand Up @@ -438,7 +438,7 @@ __DEVICE__ float3 transform(int p_Width, int p_Height, int p_X, int p_Y, float p
// Store scaled n for chroma compression factor
float ns = n;
n = n / (n + 1.0f);
float ccf = ((n * n) / (n + t0))/ ns; // include toe compression in ccf
float ccf = n / ns;
n = _powf(n, p);
n = (n * n) / (n + t0);

Expand All @@ -450,7 +450,7 @@ __DEVICE__ float3 transform(int p_Width, int p_Height, int p_X, int p_Y, float p
// Dechroma rgb
rgb = (1.0f - ccf) + rgb * ccf;

// Multiply rgb ratios by compressed norm
// RGB with dechroma
rgb *= n;

// Convert from Truelight LMS to XYZ
Expand Down
5 changes: 3 additions & 2 deletions OpenDRT/resolve/OpenDRT_params.dctl
Expand Up @@ -421,11 +421,12 @@ __DEVICE__ float3 transform(int p_Width, int p_Height, int p_X, int p_Y, float p

float3 rgb = make_float3(p_R, p_G, p_B);


if (invert == 0) {
// Linearize input
rgb = log2lin(rgb, tf);

// input gamut to xyz d65 cat: xyz scaling
// Input gamut to xyz d65 cat: xyz scaling
rgb = mult_f3_f33(rgb, in_to_xyz);

// XYZ to Truelight LMS D65 aligned
Expand All @@ -447,7 +448,7 @@ __DEVICE__ float3 transform(int p_Width, int p_Height, int p_X, int p_Y, float p
// Store scaled n for chroma compression factor
float ns = n;
n = n / (n + 1.0f);
float ccf = ((n * n) / (n + t0))/ ns; // include toe compression in ccf
float ccf = n / ns;
n = _powf(n, p);
n = (n * n) / (n + t0);

Expand Down

0 comments on commit 0b566d7

Please sign in to comment.