Kodi DSPlayer – DirectShow Player for Windows
HDR to SDR: Choosing a Gamma Curve

Tip: When watching HDR content, it is always a good idea to increase the backlight or lamp mode of your display, even slightly, to give HDR content additional room to present its high range of contrast. HDR content requires much higher available peak brightness than SDR to keep the image bright and viewable and avoid dimming the image through aggressive high dynamic range compression.

The selection of a gamma curve in madVR and at the display panel is the most important choice in using the HDR to SDR conversion. PQ values represent absolute brightness and the conversion from PQ to gamma is designed to output absolute, not relative PQ luminance.

If the display gamma matches the output gamma from madVR, mapping PQ values to any power-law gamma will result in the identical displayed luminances. So HDR converted to SDR should not change the display gamma at all if both madVR and the display are adjusted to use the same calibrated power-law gamma.

Maintaining the original source luminance of the PQ EOTF 1:1 on dimmer displays simply won't be possible, so your primary concern should be attempting to avoid having the image appear too dark after tone mapping is applied rather than precisely replicating the full brightness of the source levels.

Possible Gamma Conversion Steps:

No 3D LUT:
(madVR) 2.20 -> 2.20 (display): Input and Output Luminances Match;
(madVR) 2.40 -> 2.40 (display): Input and Output Luminances Match;
(madVR) 2.40 -> 2.20 (display): Output Luminance Increased by the Display;
(madVR) 2.20 -> 2.40 (display): Output Luminance Decreased by the Display.

(madVR) 2.20 -> 2.20 (3D LUT): Input and Output Luminances Match;
(madVR) 2.20 -> 2.40 (3D LUT): Output Luminance Decreased by the Display.

You can see madVR always converts to gamma 2.20 when a 3D LUT is present. Output values are meant to be absolute, so choosing a 2.40 display LUT may result in an image that is too dark by lowering the brightness of the source too much after the 3D LUT is applied (2.20 input -> 2.40 display).

If you are getting the best black clipping with madVR set to 2.40, it can be acceptable to set the display gamma to 2.20. The 2.40 input will be pulled up by the 2.20 display curve, which will make the displayed image brighter as opposed to darker. To limit any raising of black or washed out images, you may compensate by reporting a higher real display peak nits to madVR. This is preferable to taking any output from madVR and making it any darker at the end display.

Choosing an Output Gamma in madVR

The first step in configuring a display for HDR to SDR tone mapping is to set 16-235 SDR black and white clipping using the instructions provided in the devices section. Once this is accurate, calibrating for HDR playback will be much easier. Your mileage with HDR to SDR tone mapping will vary a lot depending on the accuracy of your display's gamma curve.

You will need these HDR10 test patterns:
  • Black Level 8-bit & 10-bit Combined;
  • Black Level 10-bit v1;
  • Black Level 10-bit v2;
  • White Level 240-1000 nits;
  • White Level 900-4000 nits;
  • White Level 3600-10000 nits.

Download Mehanik HDR10 Test Patterns


The white clipping patterns are only available for general curiosity more than any required calibration. The average user can disregard these patterns.

Black Level

The first test pattern, Black Level 8-bit & 10-bit Combined, should be opened with any media player that uses madVR.

You will get the following image:

There are two settings in madVR that require adjustment with this video:
  • transfer function / gamma;
  • real display peak nits.

devices -> calibration -> this display is already calibrated:

Note: This black clipping video is very short, so consider pausing it while making any control panel adjustments.

The example above shows what happens when the wrong gamma curve is used. Most of the bars past Bar 64 are completely black that means shadow detail is being badly crushed.

If enable gamma processing is not selected in the control panel, the gamma setting in calibration only applies when HDR is converted to SDR. So you may have been unaware of any gamma-related issues when using madVR until you attempted to playback HDR sources. Accurate display gamma mapping is most critical for preserving near black shadow detail.

Most displays will be calibrated to either 2.20 or 2.40. If your display hasn't undergone a full grayscale calibration with a colorimeter and appropriate test patterns, its gamma tracking could be slightly off, or way off the gamma set in its picture options like the example Samsung LED below. Finding a detailed review for your display online is not a bad idea to reference its expected factory-calibrated SDR gamma accuracy.

Example Display: Samsung Q8FN 2.20 Gamma Tracking Before Calibration

Reading the test pattern:
You want a smooth, grey gradient from right-to-left all the way to the very edge of Bar 64. Values at 10-bits are indicated at the top of the pattern with reference black starting at Bar 64. And values at 8-bits are represented as thicker bars along the bottom of the pattern with reference black starting at Bar 16.

You should see a faint, grey gradient that extends from the right of the screen to the left of the screen. Bar 64 is meant to be completely black (reference black). Black level too highBar 64 is visible. Black level too lowBar 65 is black and not visible.

Start with the gamma curve you know or believe is the most accurate for your display (typically, 2.20 or 2.40). To move the gradient closer to Bar 64, you may consider a value of 2.15 to 2.25, or 2.35 to 2.45. I would recommend a base setting of 2.40 if you find you are seeing some black crush at other gamma values. What you lose in black clipping, you gain in color saturation. 

real display peak nits should only impact the black clipping pattern if you use values that are below the actual peak brightness of your display, or values that are too far above the actual display peak nits. This can either raise black if set too low, or crush black slightly if raised especially high. The chosen lower limit for the real display peak nits should not raise black at all.

Black Level 10-bit v1 and Black Level 10-bit v2 are included in the pattern set as additional 10-bit test patterns that will work with most 10-bit or 8-bit display panels. These patterns can also be used to test black clipping using the same instructions as provided above.

White Clipping

The white clipping patterns are included as optional reference patterns. White clipping patterns may be used to configure a static target nits that clips correctly for 1,000 nits, 4,000 nits or 10,000 nits HDR content. The higher the real display peak nits / display target nits set in madVR, the more levels of contrast from the source are preserved by the tone curve.

real display peak nits is the only setting that requires any adjustment if you have set black clipping correctly.

Note: highlight recovery strength could impact the white clipping tests and should temporarily be set to "none."

The availability of a dynamic display target nits and HDR profile rules that automate the selection of a display target nits for each source, or that select the best display target nits for each movie scene, should make setting white clipping points and desired static target nits values unnecessary.

These white clipping patterns are better used to test the tone mapping performance of any HDR display panel video processing. A display that avoids clipping specular highlight detail at the indicated peak white luminance of the pattern will show all visible flashing bars from left-to-right up to the last number on the pattern.

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-05-14, 23:42
RE: 4G aware patch - by MagikMark - 2015-09-08, 03:27
Alt-F4 no longer quits - by JeffA - 2015-10-31, 20:38