Skip to content
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

incorrect PQ tracking for .hdr images in "no effect" mode #51

Open
gerritS234 opened this issue May 24, 2022 · 5 comments
Open

incorrect PQ tracking for .hdr images in "no effect" mode #51

gerritS234 opened this issue May 24, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@gerritS234
Copy link

I did some tests using HDR + WCG viewer using one of our NVIDIA GSYNC HDR10 monitor prototypes. Our debug tools can observe the exact HDR PQ12 codes coming in from the PC to the monitor. And it looks like brightness of a .hdr image displayed by HDR + WCG is about 8.5x too high at default brightness and when selecting Render Effect = No Effect (all other settings have special transformations we don’t want for our tests).

Consider the attached 4k ‘simultaneous contrast’ style test image we use. It has a 1400 nits bright bar at top. At bottom it has a greyscale with 14 steps, starting with 0.02 nits and increasing by 1.5x for every step to the right. We verified that the .hdr brightness is as we want it with 'tev' (see table).

When we display this with an in-house viewer, we get PQ12 values that translate to the correct nits (within RGBE quantization accuracy). Table below shows PQ12 values/nits values we get with HDR+WCG viewer.

We’d be very interested to see a fix, so we can recommend use of this viewer for our partners/monitor makers.

image

image
ContrastTest_0p02_1p5_3840_2160.zip

PS: we did these experiments with Win10 21H2 (19044.1706), and a 27” 4k 144 Hz 1000 nits GSYNC Ultimate monitor (max 1107 nits).

@13thsymphony 13thsymphony self-assigned this Dec 27, 2022
@13thsymphony
Copy link
Owner

Thanks for your patience and for reporting this!

Tentative findings from my initial investigation:

From the RGBE file format spec, there is an EXPOSURE header variable:

EXPOSURE
A single floating point number indicating a multiplier that has
been applied to all the pixels in the file. EXPOSURE values are
cumulative, so the original pixel values (i.e., radiances in
watts/steradian/m^2) must be derived by taking the values in the
file and dividing by all the EXPOSURE settings multiplied
together. No EXPOSURE setting implies that no exposure
changes have taken place.

In this file, that value is:
EXPOSURE=0.11713
which corresponds to a multiplier of about 8.5, the discrepancy between the two apps.

This isn't my area of expertise, but from my reading of the spec, a decoder does need to divide color values by the EXPOSURE, i.e. the 8.5x higher values produced by the HDR image viewer are indeed correct. I am relying on directxtex for RGBE radiance decoding, and it looks like it is applying this divider.

However, I'm not an expert on the RGBE format. It's entirely possible that the EXPOSURE directive isn't widely used so it practically should be ignored; however I need to do further research on how to achieve this while using DirectXTex.

@13thsymphony
Copy link
Owner

Attaching a quick and dirty hex-edited version of the repro image with
EXPOSURE=1.00000
ContrastTest_0p02_1p5_3840_2160-exposure1.zip

When loading this image, my MaxCLL histogram calculation gives 1517 nits, which is within the expected 10% margin of error to 1400 nits design point.

@gerritS234
Copy link
Author

gerritS234 commented Dec 27, 2022 via email

@13thsymphony 13thsymphony added the bug Something isn't working label Dec 27, 2022
@gerritS234
Copy link
Author

gerritS234 commented Dec 29, 2022 via email

@13thsymphony
Copy link
Owner

That's great to hear, let me know how it turns out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants