[vlc-commits] direct3d11: fix the dynamic luminance for some sources

Steve Lhomme git at videolan.org
Thu Feb 8 16:54:32 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Feb  8 16:30:45 2018 +0100| [e34fa4af77749debb133ba1d6b7479ba8b058825] | committer: Jean-Baptiste Kempf

direct3d11: fix the dynamic luminance for some sources

It should be it thousand nits but sometimes it's much smaller
(Sony HDR sample for example).
UHD Blu-Ray have the proper values.

(cherry picked from commit d7aade4fd1a3b59c816ddecb572691dc7eeb30f7)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/video_output/win32/direct3d11.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index c3b8f6d95a..1ac0765627 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1190,7 +1190,10 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
 
     if (picture->format.mastering.max_luminance)
     {
-        UpdateQuadLuminanceScale(vd, &sys->picQuad, (float) picture->format.mastering.max_luminance / sys->display.luminance_peak);
+        if ( picture->format.mastering.max_luminance < 10000)
+            UpdateQuadLuminanceScale(vd, &sys->picQuad, (float) picture->format.mastering.max_luminance / sys->display.luminance_peak);
+        else
+            UpdateQuadLuminanceScale(vd, &sys->picQuad, (float) picture->format.mastering.max_luminance / (1000 * sys->display.luminance_peak));
 
         if (sys->dxgiswapChain4)
         {



More information about the vlc-commits mailing list