Repository navigation
Conversation
The Fixed method is the existing curve and stays the default. The Metadata method builds the curve from the content's peak and the SDR display nits: MaxCLL, then the mastering display peak, then 1000 nits. Dolby Vision profile 5 has no HDR10 metadata, so its RPU supplies the same values, from level 6 or source_max_pq. It works the same on Direct3D 9 and 11, through the video processor or the shaders, for PQ, HLG and Dolby Vision.
With the Metadata method, SdrMeasurePeak takes the content peak from each frame instead of the metadata. Direct3D 11 builds a histogram in a compute shader. Direct3D 9 has none, so the frame is reduced in ps_3_0 to a single texel. Both smooth the peak over a window. The settings are only read from the registry, with no controls on the page: SdrMeasurePeak, SdrPeakWindowMs (default 3000), SdrPeakFloorNits (default 640) and SdrPeakSceneCuts. The statistics show the peak in use.
|
That is definitely not necessary. No one is going to enable it via the registry, and 99.99% of users don't need it anyway. |
|
Enabling this can be done by adding extra choice in dropdown after other patch is added first that gives the fixed/metadata choices. |
|
Why go to such lengths and write so much code just for SDR conversion? Anyone who wants HDR watches it on a screen that supports HDR output. |
|
There are plenty of people who don't have a HDR screen. And the measuring of peak nits can probably also be utilized for the local tonemapping to further improve that quality as well. |
|
What’s wrong with local tone mapping? It works based on metadata—the same way media players and TVs do. |
|
Metadata with a single peak value for entire movie does not give optimal result. It is is same reason why HDR10+ with dynamic metadata is better than basic HDR10. The metadata is adjusted per frame/scene. |
|
I know. |
|
Thanks for looking at it. On the one hand you don't see the point but on the other hand you understand the gap it closes. On my office monitor I have disabled HDR because I don't like the levels it puts out. Tone mapping is very useful in that case, and better tone mapping is better. :) |
|
Alright—go ahead and add it as an option to the current dropdown list. |
I split this out of #290 so that one can go in without it. It builds on #290, and only the top commit is new here.
This takes the content peak from each frame instead of the metadata, when the Metadata method is selected. It has no controls on the settings page, only registry values:
SdrMeasurePeak, off by default.SdrPeakWindowMs, 3000. The peak is averaged over this window.SdrPeakFloorNits, 640. The peak never goes below this.SdrPeakSceneCuts, off. Restarts the window at a scene change.Direct3D 11 builds a histogram in a compute shader. Direct3D 9 has no compute shader, so it reduces the frame to one texel in
ps_3_0. The statistics show the frame peak and the peak in use.It only runs where the conversion is a correction pass after the video processor. When the shaders do the conversion it falls back to the metadata.
A flat PQ 0.65 field (390 nits,
MaxCLL2000) at 200 nits goes to the 640 floor. It should be 235.2 and it reads 235.5 on Direct3D 11 and 234.1 on Direct3D 9.