[vlc-commits] direct3d11: handle output to a SMPTE ST 2084 display

Steve Lhomme git at videolan.org
Fri Mar 10 19:40:44 CET 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Tue Mar  7 16:39:06 2017 +0100| [0cc11fcbc2f70ade06b84ca597eec0389d3b1483] | committer: Jean-Baptiste Kempf

direct3d11: handle output to a SMPTE ST 2084 display

This is especially important for sub pictures that are not HDR but displayed on
HDR display.

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

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

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

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 0718e99..9fafc53 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1644,8 +1644,25 @@ static HRESULT CompilePixelShader(vout_display_t *vd, const d3d_format_t *format
                             rgb = hable(32.0 * rgb) / HABLE_DIV;\
                             return rgb";
                     }
-                    break;
                 }
+                else
+                    msg_Warn(vd, "don't know how to transfer from %d to sRGB", src_transfer);
+                break;
+
+            case TRANSFER_FUNC_SMPTE_ST2084:
+                if (src_transfer == TRANSFER_FUNC_LINEAR)
+                {
+                    /* Linear to ST2084 */
+                    psz_src_transform =
+                           ST2084_PQ_CONSTANTS
+                           "rgb = pow(rgb, m1);\
+                            rgb = (ST2084_c1 + ST2084_c2 * rgb) / (1 + ST2084_c3 * rgb);\
+                            rgb = pow(rgb, ST2084_m3);\
+                            return rgb";
+                }
+                else
+                    msg_Warn(vd, "don't know how to transfer from %d to SMPTE ST 2084", src_transfer);
+                break;
             default:
                 msg_Warn(vd, "don't know how to transfer from %d to %d", src_transfer, sys->display_transfer);
                 break;



More information about the vlc-commits mailing list