From 43e5fb14483055fa47eb73f79f4810891f2722d1 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 28 May 2019 09:41:45 +0200
Subject: [PATCH] direct3d11: the peak luminance of HLG is officially 1000

---
 modules/video_output/win32/d3d11_shaders.c | 2 +-
 modules/video_output/win32/d3d11_shaders.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/win32/d3d11_shaders.c b/modules/video_output/win32/d3d11_shaders.c
index b1f56303ed84..e516112c60ca 100644
--- a/modules/video_output/win32/d3d11_shaders.c
+++ b/modules/video_output/win32/d3d11_shaders.c
@@ -682,7 +682,7 @@ float GetFormatLuminance(vlc_object_t *o, const video_format_t *fmt)
             /* that's the default PQ value if the metadata are not set */
             return MAX_PQ_BRIGHTNESS;
         case TRANSFER_FUNC_HLG:
-            return 2000;
+            return MAX_HLG_BRIGHTNESS;
         case TRANSFER_FUNC_BT470_BG:
         case TRANSFER_FUNC_BT470_M:
         case TRANSFER_FUNC_BT709:
diff --git a/modules/video_output/win32/d3d11_shaders.h b/modules/video_output/win32/d3d11_shaders.h
index 5af23b394373..576eea64bae0 100644
--- a/modules/video_output/win32/d3d11_shaders.h
+++ b/modules/video_output/win32/d3d11_shaders.h
@@ -28,6 +28,7 @@
 
 #define DEFAULT_BRIGHTNESS         100
 #define DEFAULT_SRGB_BRIGHTNESS    100
+#define MAX_HLG_BRIGHTNESS        1000
 #define MAX_PQ_BRIGHTNESS        10000
 
 typedef struct {
-- 
GitLab