[vlc-commits] direct3d11: adjust the max luminance when tone mapping to SDR

Steve Lhomme git at videolan.org
Fri Oct 27 17:52:52 CEST 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Fri Oct 27 11:51:44 2017 +0200| [d5db57ddde4a35aaa2b144a52d9309020ff7939d] | committer: Jean-Baptiste Kempf

direct3d11: adjust the max luminance when tone mapping to SDR

The content never reaches 10000 nits also the max luminance in files is often
bogus, HDR TVs don't actually use them but use a hardcoded value instead.

When the display is in HDR mode, let it deal with the luminance. Otherwise
use a value of 5000 that gives a good result with most HDR10 content.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d5db57ddde4a35aaa2b144a52d9309020ff7939d
---

 modules/video_output/win32/direct3d11.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index e393953756..bb4b616bde 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1865,8 +1865,12 @@ static HRESULT CompilePixelShader(vout_display_t *vd, const d3d_format_t *format
     switch (transfer)
     {
         case TRANSFER_FUNC_SMPTE_ST2084:
-            /* TODO ajust this value using HDR metadata ? */
-            src_luminance_peak = MAX_PQ_BRIGHTNESS;
+            if (sys->display.colorspace->transfer == TRANSFER_FUNC_SMPTE_ST2084)
+                /* the display will take care of the meta data if there are some */
+                src_luminance_peak = MAX_PQ_BRIGHTNESS;
+            else
+                /* TODO adjust this value during playback using HDR metadata ? */
+                src_luminance_peak = 5000;
             break;
         case TRANSFER_FUNC_HLG:
             src_luminance_peak = 1000;



More information about the vlc-commits mailing list