[vlc-commits] direct3d11: clean the range adjustment when the source has less range than display

Steve Lhomme git at videolan.org
Tue Jan 23 14:12:15 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jan 23 13:37:28 2018 +0100| [a821690b95c6941e64ef00ca0e18e2ef54d52014] | committer: Steve Lhomme

direct3d11: clean the range adjustment when the source has less range than display

Ref #19127

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

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

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 168e112a28..82e79304a3 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1860,11 +1860,16 @@ static HRESULT CompilePixelShader(vout_display_t *vd, const d3d_format_t *format
         }
     }
 
-    int range_adjust = sys->display.colorspace->b_full_range;
+    int range_adjust = 0;
+    if (sys->display.colorspace->b_full_range) {
+        if (!src_full_range)
+            range_adjust = 1; /* raise the source to full range */
+    } else {
+        if (src_full_range)
+            range_adjust = -1; /* lower the source to studio range */
+    }
     if (!IsRGBShader(format))
         range_adjust--; /* the YUV->RGB conversion already output full range */
-    if (src_full_range)
-        range_adjust--;
 
     if (range_adjust != 0)
     {



More information about the vlc-commits mailing list