[vlc-devel] [PATCH] direct3d11: favor NV12 surfaces for DXVA2 sources

Steve Lhomme robUx4 at videolabs.io
Tue Apr 28 16:58:29 CEST 2015


--
that will avoid using I420 with a slow plane splitting and an average pixel shader
---
 modules/video_output/msw/direct3d11.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/msw/direct3d11.c b/modules/video_output/msw/direct3d11.c
index 8ed4598..4c993cc 100644
--- a/modules/video_output/msw/direct3d11.c
+++ b/modules/video_output/msw/direct3d11.c
@@ -695,10 +695,16 @@ static int Direct3D11Open(vout_display_t *vd, video_format_t *fmt)
 # endif
 #endif
 
+    vlc_fourcc_t i_src_chroma;
+    if (fmt->i_chroma == VLC_CODEC_D3D9_OPAQUE)
+        i_src_chroma = VLC_CODEC_NV12; // favor NV12
+    else
+        i_src_chroma = fmt->i_chroma;
+
     // look for the request pixel format first
     for (unsigned i = 0; d3d_formats[i].name != 0; i++)
     {
-        if( fmt->i_chroma == d3d_formats[i].fourcc)
+        if( i_src_chroma == d3d_formats[i].fourcc)
         {
             UINT i_formatSupport;
             if( SUCCEEDED( ID3D11Device_CheckFormatSupport(sys->d3ddevice,
-- 
2.3.2




More information about the vlc-devel mailing list