-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add utility functions for converting between PQ and HLG at 1000nits
* add base functions to Utilities_Color * add standalone utility functions that call the base functions in Utilities_Color
- Loading branch information
Showing
3 changed files
with
167 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
transforms/ctl/utilities/ACESutil.DolbyPQ_to_HLG_1000nits.ctl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
// <ACEStransformID>ACESutil.DolbyPQ_to_HLG_1000nits.a1.1</ACEStransformID> | ||
// <ACESuserName>Dolby PQ to HLG</ACESuserName> | ||
|
||
|
||
|
||
import "ACESlib.Utilities_Color"; | ||
|
||
|
||
|
||
// Conversion of PQ signal to HLG, as detailed in Section 7 of ITU-R BT.2390-0 | ||
void main | ||
( | ||
input varying float rIn, | ||
input varying float gIn, | ||
input varying float bIn, | ||
input varying float aIn, | ||
output varying float rOut, | ||
output varying float gOut, | ||
output varying float bOut, | ||
output varying float aOut | ||
) | ||
{ | ||
float PQ[3] = { rIn, gIn, bIn}; | ||
|
||
float HLG[3] = ST2084_2_HLG_1000nits_f3( PQ); | ||
|
||
rOut = HLG[0]; | ||
gOut = HLG[1]; | ||
bOut = HLG[2]; | ||
aOut = aIn; | ||
} |
32 changes: 32 additions & 0 deletions
32
transforms/ctl/utilities/ACESutil.HLG_to_DolbyPQ_1000nits.ctl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
// <ACEStransformID>ACESutil.HLG_to_DolbyPQ_1000nits.a1.1</ACEStransformID> | ||
// <ACESuserName>HLG to Dolby PQ</ACESuserName> | ||
|
||
|
||
|
||
import "ACESlib.Utilities_Color"; | ||
|
||
|
||
|
||
// Conversion from HLG to PQ signal as detailed in Section 7 of ITU-R BT.2390-0 | ||
void main | ||
( | ||
input varying float rIn, | ||
input varying float gIn, | ||
input varying float bIn, | ||
input varying float aIn, | ||
output varying float rOut, | ||
output varying float gOut, | ||
output varying float bOut, | ||
output varying float aOut | ||
) | ||
{ | ||
float HLG[3] = { rIn, gIn, bIn}; | ||
|
||
float PQ[3] = HLG_2_ST2084_1000nits_f3( HLG); | ||
|
||
rOut = PQ[0]; | ||
gOut = PQ[1]; | ||
bOut = PQ[2]; | ||
aOut = aIn; | ||
} |