Kodi DSPlayer – DirectShow Player for Windows
Dynamic Display Target Nits (Continued...)

HDR to SDR Display Target Nits Waveforms with DaVinci Resolve

To provide some visual examples of what occurs to the distribution of pixel luminance on the display curve after before and after HDR to SDR tone mapping is applied, some movie scenes will be plotted as waveform graphs using popular color grading software DaVinci Resolve. A considerable amount of the HDR10 (as well as HDR10+ and Dolby Vision) content available today is color graded with DaVinci Resolve Studio software. Resolve is available for purchase as a complete video mastering and color grading editing suite or can be downloaded for free as a stripped-down version offering the most basic functionality.

A video waveform graph is a visual representation of pixel luminance in a single video frame based on mastered PQ values. All pixels in each frame are graphed as a 2D representation that plots the luminance of each pixel (as indicted by its mastered PQ code value) relative to its precise position within the frame. These waveforms plots produce a continuous wave shape that provides a quick visual reference of the overall brightness of each frame along with some indication of the relative PQ luminance and positioning of the shadows, midtones and highlights within each frame. Video waveforms are used when color grading to allow the colorist to easily visualize where pixel luminance is distributed within a given frame and to control the mastered brightness of the video by observing changes to mastered code values, or bits, as the image tone controls are adjusted within the editor.

DaVinci Resolve provides labeled HDR waveforms in the scopes panel for the active video frame in the editor window. The HDR scopes separate each pixel in each frame into its individual red, green and blue color channels along with its corresponding PQ luminance on the PQ (Perceptual Quantizer) source scale. A typical HDR waveform from Resolve is shown below with labels indicating the luminance of notable 10-bit PQ values on the graph.

DaVinci Resolve Waveform Legend (10-bit PQ Values): 
Image

The sample display used has a real display peak nits of 100 nits (a typical calibrated peak luminance for an HDR front projector).

Three test scenes from the Avengers: Infinity War UHD Blu-ray are used as the sample scenes to produce waveform graphs by importing a single frame from each scene into DaVinci Resolve. HDR waveforms were produced by using lossless SDR BT.709 PNG screenshots from MPC-BE that were imported into the Resolve Timeline. Because an SDR screenshot is used in these examples, some precision is lost in the conversion back to ST.2084 PQ HDR values. For example, if the two waveforms are layered on top of each other, it is possible to see very slight differences in pixel distributions beyond those caused by converting from ST.2084 PQ to BT.709 SDR gamma. However, the minor differences between the before and after luminance waveforms are slight enough to consider the sample waveforms to be accurate representations of the HDR to SDR tone mapping curve applied by madVR.

Scene #1

real display peak nits: 100 nits (dynamic tuning: 100)

madVR OSD:
measured frame 100 nits, tone map 111 nits
frame FALL 1.759 nits
HDR -> SDR using shaders, BT.2390 (100nits), no hue shift


Note: To see the measured frame FALL (1.759 nits) and selected display target nits (100nits) for each video frame in the madVR OSD during playback, create a blank folder named "ShowHdrMode" and place it in the madVR installation folder.

Frame Peak 100 nits:
Image

Tone Mapping — Before & After:
Image

Frame Peak and Reference White — Before & After:
Image

The first frame has a frame peak of 100 nits with a low frame FALL of 1.759 nits.

Because the scene peak in this case is 100 nits and the assumed peak luminance of the target display (or its real display peak nits) is also 100 nits, no tone mapping is required for this scene. The display is capable of rendering all source values 1:1, so the input and output HDR waveforms are unchanged from the mastered PQ values.

In this case, it doesn't matter that the original mastering display has a stated peak brightness of 1,000 nits and the end display is only capable of 100 peak nits. The dynamic display target nits acknowledges that the scene is within the display's capabilities and selects 100 display target nits to present the scene as it was originally mastered.

Many scenes in HDR videos with low frame peaks tend to also have low frame FALLs with low mastered source levels. So avoiding display target nits values optimized for brighter HDR scenes is typically necessary to preserve the prominent shadow detail that is often present in these low frame FALL scenes.

Compressing Brighter HDR Scenes by Increasing the Display Target Nits

The next two examples see mastered brightness levels rise well above 100 nits. In these cases, tone mapping becomes necessary in order to lower the brightness of source levels mastered brighter than the available light output of the target display.

The display target nits is increased above the real display peak nits of 100 nits when the measured frame (nits level) is higher than the real display peak nits entered in madVR.

Raising the display target nits above the actual display peak nits creates some additional headroom at the top of the display range to better render the specular highlights without clipping. This increase to the display target nits has the effect of lowering the Average Picture Level (APL) to increase displayed contrast. This better creates the illusion of a high dynamic range images at much lower levels of peak brightness.

The amount the display target nits is increased above the real display peak nits (which is 100 nits in this case) depends on the measured frame FALL as reported by the dynamic luminance and hue histograms.

The higher the frame FALL, the higher the display target nits and the more dynamic range compression is applied. The lower the frame FALL, the more gradual the increase in display target nits to avoid pushing large amounts of the image down towards black that would otherwise have low and mid FALL scene appear overly dark and compressed.

Scene #2 

madVR OSD:

measured frame 1073 nits, tone map 1073 nits
frame FALL 10.614 nits
HDR -> SDR using shaders, BT.2390 (211nits), no hue shift


Frame Peak 1,073 nits:
Image

Tone Mapping — Before & After:
Image

Frame Peak and Reference White — Before & After:
Image

The second frame has a frame peak of 1,073 nits with an average frame FALL of 10.614 nits.

With the frame peak now above the available display peak nits of 100 nits, the display target nits is raised to 211 nits. This adds additional contrast at a 2.11:1 ratio:

211 display target nits / 100 real display peak nits = 2.11:1 Display Gamma Compression Ratio

If you look at the before and after waveforms, this 2.11:1 contrast enhancements helps to alleviate some of the stress placed on the specular highlights in the frame when the scene is compressed to the 100 nits real display peak. In this case, the specular focus of the scene is the glowing, blue Tesseract cube in the hands of Ebony Maw that is represented directly in the middle of the waveform and peaks at 1,073 PQ nits.  

Compressing only 211 display target nits of the original 1,073 scene nits does lead to some loss of the brightest details in the Tesseract. You can observe this clipping of detail in the waveform by looking at the change in waveform shape that occurs in the center of the graph. The top level of the original (Before) waveform becomes noticeably flatter when aggressively compressed to the 100 nits real display peak (After) waveform. If you look closely at the glowing cube, you will notice that some detail is indeed slightly blown out towards the center of the Tesseract.

Any specular highlight clipping caused by tone mapping is considered a trade-off to prevent the bulk of the scene from being compressed by an unnecessarily high display target nits. Despite having a steep frame peak of 1,073 nits, the frame FALL of scene this is actually average at 10.614 nits. The dynamic display target nits chooses a value that compresses the scene enough to add some much needed contrast between the compressed frame peak (100 nits) and reference white (47.39 nits) to come closer to the original 10.73:1 ratio of between the original 1.073 nits frame peak and reference white without making the overall scene darker than Scene #1 (which has a very limited frame FALL of 1.759 nits).

The chosen display target nits of 211 nits lowers the frame FALL from 10.614 nits to 5.010 nits:

10.614 nits Original frame FALL / 2.11:1 Display Gamma Compression Ratio = 5.010 nits Tone Mapped frame FALL

This is 2.11:1 gamma compression ratio provides a good balance of brightness and contrast to better represent the high contrast of this scene without pushing too much of the source levels into the lowest part of the display range.

Extreme Example — Too Much Dynamic Range Compression

Extreme cases are a way to show how the display target nits can erode shadow detail when the target is a mismatch for the scene. This most often occurs when a scene has an extreme combination of a high frame FALL with high levels of specular highlight detail matched with large patches of near black shadow detail. These mixed brightness scenes cause the FALL Algo to select a high display target nits for the scene.

This scene from Black Hawk Down is a good example of an obvious display target nits / scene FALL mismatch. A very bright patch of sky detail is matched with a dark helicopter interior that leads to the selection of an aggressive 1,500 display target nits to compress the highlights in the scene.

Black Hawk Down Helicopter Interior (Extensive Shadow Detail Loss):
Black Hawk Down 1500 display target nits
Black Hawk Down 1500 display target nits with shadow detail recovery

*Screenshots courtesy of madshi.

This frame clearly shows the limitations of capturing all scenes with a simple display target nits value. At 1,500 display target nits, compression on a 100 true nits display would be 15:1 (1500 display target nits / 100 real display peak nits = 15:1 gamma compression ratio). If two nearby pixels were encoded at 0.1 nits and 0.2 nits (a difference of 0.1 nits), a display target nits of 1,500 nits would compress these two pixels to 0.006 nits and 0.01 nits (a difference of only 0.007 nits). This would erase any visible difference between the two pixels resulting in near black crush. To counter this, madVR includes some protection for shadow detail loss by reversing some of this compression with the final Histogram-Based tone adjustments and a shadow detail recovery filter that is activated for bright HDR scenes.

Scene #3

madVR OSD:

measured frame 850 nits, tone map 850 nits
frame FALL 240.890 nits
HDR -> SDR using shaders, BT.2390 (809nits), no hue shift


Frame Peak 850 nits:
Image

Tone Mapping — Before & After:
Image

Frame Peak and Reference White — Before & After:
Image

The third frame has a frame peak of 850 nits with a high frame FALL of 240.890 nits.

The very high frame FALL of this frame means most the source levels are above 100 nits and a large amount of range compression will be necessary to move the entire waveform back into the display range without losing large amounts of highlight detail at the top of the display curve.

A high gamma compression ratio is used for this frame by using a display target nits of 809 nits. This increases displayed contrast at a 8.09:1 ratio:

809 display target nits / 100 real display peak nits = 8.09:1 Display Gamma Compression Ratio

The 8.09:1 compression ratio means the image will be rendered 8.09x darker by the display than mastered. While this would make most scenes uncomfortably dark, 809 display target nits when applied to this scene is barely able to maintain the uniform level of bright highlight detail present in the scene.

If you look at the after waveform, you'll notice the large, flat shape of the original HDR waveform is almost entirely preserved by the 809 display target nits. The shapes of the top of the before and after waveforms are almost identical. This means no detail is lost to clipping, and despite the 8.09:1 display gamma compression ratio and lowering reference white to a mere 12.36 nits, the entire waveform for the scene still remains well above the bottom black floor.

Tone mapping lowers the frame FALL from 240.890 nits to 29.776 nits:

240.890 nits Original frame FALL / 8.09:1 Display Gamma Compression Ratio = 29.776 nits Tone Mapped frame FALL

While this drop in frame FALL means the scene has been dimmed significantly by tone mapping, the frame FALL after tone mapping manages to stay higher than Scene #1 (1.759 nits) and Scene #2 (5.010 nits). So Scene #3 will see a visible lowering of gamma, but the scene will still appear appropriately brighter than less bright scenes with lower frame FALLs.

Extreme Example —  Too Little Dynamic Range Compression

Occasionally, scenes or movies will feature very high frame FALL values that can demonstrate how much detail is lost to range clipping. One such example is the outdoor-shot The Meg that features consistent scenes with mastered frame FALLs greater than 1,000 nits where even moderate display target nits such as 500 nits will fail to avoid widespread losses of highlight detail that wash out detail from the image.

For example, this oceanic scene from The Meg necessitates using a display target nits of greater than 2,000 nits to adequately compress the highlights in the scene and retain the fine detail in the sky, ocean and characters in the foreground. Lower display target nits present this scene as a hazy mess pushing contrast to the extreme and losing visible texture detail everywhere to blown out highlights in various parts of the image. 

The Meg Bright Outdoor Scene (Excessive Highlight Loss):
The Meg 500 display target nits
The Meg 3000 display target nits

*Screenshots courtesy of NEO-XP.

Movies like The Meg that are primarily based around outdoor-lit shots with copious amounts of bright sunlight are not common. But any scene with a high frame FALL requires a high display target nits to keep texture detail from disappearing from the scene.

Summary of the Results of Tone Mapping

The figures below summarize the different amounts of dynamic range compression applied by each display target nits. As the scene frame FALL increases, so too does the amount of tone compression applied by the gamma curve through increases to the display target nits.

Scene #1:

FALL Before: 1.759 nits
FALL After: 1.759 nits

Frame Peak: 100 nits
Display Target Nits: 100 nits
Reference White: 100 nits

Scene #2:

FALL Before: 10.614 nits
FALL After: 5.010 nits

Frame Peak: 1,073 nits
Display Target Nits: 211 nits
Reference White: 47.39 nits

Scene #3:

FALL Before: 240.890 nits
FALL After: 29.776 nits

Frame Peak: 850 nits
Display Target Nits: 809 nits
Reference White: 12.36 nits

While each scene is mapped to a lower brightness than originally encoded, the frame FALL after tone mapping remains higher for brighter scenes than less bright scenes and all scenes are compressed to be closer in average brightness. This keeps contrast consistent throughout the presentation and helps to hide changes to the display target nits as scene changes occur.

A dynamic display target nits offers finer control over the use of contrast to ensure every scene in a movie has similar perceived brightness and contrast that is appropriate for the scene's brightness and contrast. If the real display peak nits entered in madVR is an accurate estimate of the actual display peak nits, brightness at the end display should always remain in the "sweet spot" of the display curve where no scene is ever too bright or too dark relative to the peak nits of the display.
Reply


Messages In This Thread
Lockup on STOP issue resolved! - by MKANET - 2015-04-11, 21:59
RE: Kodi DSPlayer – DirectShow Player for Windows - by Warner306 - 2015-04-20, 03:40
RE: 4G aware patch - by MagikMark - 2015-09-08, 03:27
Alt-F4 no longer quits - by JeffA - 2015-10-31, 20:38
H265 playback - by rew88 - 2017-11-04, 00:41
RE: H265 playback - by ashlar - 2017-11-04, 16:21
RE: H265 playback - by rew88 - 2017-11-05, 01:34
RE: H265 playback - by ashlar - 2017-11-05, 16:48
RE: H265 playback - by rew88 - 2017-11-05, 23:08
RE: H265 playback - by ashlar - 2017-11-06, 12:00
Leia 18 - by terpsarlington - 2017-11-21, 03:51
RE: Leia 18 - by spencerjford - 2017-11-21, 06:24
Display Modes / Refresh Rates - by goofer69 - 2019-09-20, 00:19
RE: Display Modes / Refresh Rates - by ashlar - 2019-09-20, 00:39
RE: Display Modes / Refresh Rates - by ashlar - 2019-09-20, 19:35
DSPlayer 23.810 to 23.976 - by Runakanta - 2018-05-09, 03:24
RE: DSPlayer 23.810 to 23.976 - by Warner306 - 2018-05-10, 01:32
Logout Mark Read Team Forum Stats Members Help
Kodi DSPlayer – DirectShow Player for Windows47