-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify use of transfer functions #222
Changes from 6 commits
1ee4611
055a327
7be4f2e
622b438
335eaf8
f158b4d
8f18ab5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1014,6 +1014,45 @@ Still, `KHR_DF_PRIMARIES_BT709` / `KHR_DF_PRIMARIES_SRGB` is recommended | |
for standard dynamic range, standard gamut images. | ||
==== | ||
|
||
==== Use of Transfer Functions | ||
The majority of transfer functions listed in Chapter 13 _Transfer | ||
functions_ of <<KDF13>>, with corresponding enumerators given in | ||
Chapter 5 _transferFunction_, have a linear opto-optical transfer | ||
function (OOTF). That is the opto-electrical transfer function | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpick: the EOTF or OETF doesn't "have" an OOTF - they are defined in specifications which define an OOTF. |
||
(OETF) is the inverse of the electro-optical transfer function | ||
(EOTF). When a KTX file has one of these transfer functions | ||
|
||
* applications should use the EOTF to decode prior to sampling and | ||
filtering; | ||
* mipmap generation should use the path EOTF → scaling → OETF. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By definition, if the OOTF is linear, the EOTF is the OETF-1 and the OETF is the EOTF-1. If they're symmetrical, they also have the same enum. That does mean this processing path is correct, although I would find it a little confusing to state it that way. |
||
|
||
These transfer functions have no suffix in their enumerator names. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The KDFS enumerators without a disambiguating either EOTF or OETF in the name indicate that the originating specification defines only an EOTF (such as sRGB), only an OETF (such as BT.709), or there is a linear OOTF. The proposed updated enum aliases clarify this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think this is the only thing KTX cares about in practice. |
||
|
||
The sRGB transfer function is one of these, defining an EOTF. EOTF^-1^ | ||
is used as the OETF. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not true (there is no OETF in sRGB, and no defined OOTF, unless combined with a scene-referred standard such as BT.709). |
||
|
||
Some transfer functions have a non-linear OOTF. That is the OETF | ||
is not the inverse of the EOTF. These have two separate enumerators, | ||
one with an `OETF` suffix, the other with an `EOTF` suffix. When a | ||
KTX file has an explicit OETF | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Has an explicit OETF" means the enum chosen corresponds to the OETF defined by the specification, yes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It means that the DFD enum has the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think "some transfer functions have a non-linear OOTF" read strangely to me - the OOTF is one transfer function, the OETF is another, the EOTF is a third, so they don't "have" each other. Perhaps "some color spaces", or "some standards"? |
||
|
||
* the images are _scene referred_ and intended to be decoded to | ||
scene-linear values; | ||
* applications should use OETF^-1^ to decode prior to sampling and | ||
filtering; | ||
* mipmap generation should use the path OETF^-1^ → scaling → OETF. | ||
|
||
When a KTX file has an explicit EOTF | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correspondingly, this means the enum identifies the EOTF defined by a specification? I think it's sufficient to say that KTX tools will process in the display-linear space or scene-linear space, determined by the enum encoding (for any enum that identifies either an EOTF or OETF; it would require additional information to specify the corresponding function for specifications that only define one transfer function). Applications creating a KTX file should indicate the authoring space that they used to create the content, whether that is scene- or display-referred. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ditto. It means that the DFD enum has the _EOTF suffix.
The KTX header defines how to process the file, not how it was created. The intention is to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'm expecting it to affect the tooling, on the assumption that any mip chain generation probably shouldn't change the colour space identifiers and that this is a useful way to pass that information to the tool chain. If this documents how user applications might wish to receive similar instructions, sure. For an application converting content to screen space for display, it should always find an EOTF to use, whatever that EOTF may be. If converting to content that is part of a LDR video stream, it should be following the OETF instead. Hopefully the application knows what it's doing, and can make that decision. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes and that's out of the KTX scope. Remember that KTX is not a general-purpose image or video format related to cameras or screens. One could say that |
||
|
||
* the images are _display referred_ and intended to be decoded to | ||
display-linear values; | ||
* applications should use the EOTF (often derived from the OOTF) to | ||
decode prior to sampling and filtering; | ||
* mipmap generation should use the path EOTF → scaling → EOTF^-1^. | ||
|
||
OETF and EOTF formulae are given in Chapter 13 _Transfer functions_ in | ||
<<KDF13>> | ||
MarkCallow marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
==== Providing additional information | ||
There are several cases where the _dfDescriptorBlock_ is used to | ||
provide information beyond that given by <<_vkformat,`vkFormat`>>. | ||
|
@@ -2471,6 +2510,8 @@ include::appendices/vendor-metadata.adoc[] | |
- Remove requirement for bytesPlane | ||
0 in DFDs of supercompressed | ||
files. | ||
- Add rules for use of transfer | ||
functions. | ||
|=== | ||
|
||
[discrete] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's true. Most of the transfer functions correspond only to either the OETF or the EOTF, with a small number of exceptions where the two are the same. BT.601/709/2020 don't comment on the reference display, for example - that's what BT.1886 does. Equally, while the sRGB description does talk about how it can be integrated into a BT.709-based authoring environment, it is of itself only documenting the EOTF - it is for displaying computer content, so there is no concept of a camera capturing a scene in sRGB itself.