[vlc-commits] d3d11_shaders: add support for VLC_CODEC_I444_16L rendering

Steve Lhomme git at videolan.org
Fri Dec 13 17:28:16 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Dec 13 17:06:29 2019 +0100| [061a86a7a1f41de4791a9ffc0e083fa2e7bb51a1] | committer: Steve Lhomme

d3d11_shaders: add support for VLC_CODEC_I444_16L rendering

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

 modules/video_chroma/dxgi_fmt.c            | 1 +
 modules/video_output/win32/d3d11_shaders.c | 8 ++++++++
 modules/video_output/win32/direct3d11.c    | 4 ++++
 3 files changed, 13 insertions(+)

diff --git a/modules/video_chroma/dxgi_fmt.c b/modules/video_chroma/dxgi_fmt.c
index bf5f31cad1..61ee85b4b0 100644
--- a/modules/video_chroma/dxgi_fmt.c
+++ b/modules/video_chroma/dxgi_fmt.c
@@ -80,6 +80,7 @@ static const d3d_format_t d3d_formats[] = {
     { "I420",     DXGI_FORMAT_UNKNOWN,        VLC_CODEC_I420,          8, 2, 2, { DXGI_FORMAT_R8_UNORM,      DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM } },
     { "I420_10",  DXGI_FORMAT_UNKNOWN,        VLC_CODEC_I420_10L,     10, 2, 2, { DXGI_FORMAT_R16_UNORM,     DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM } },
     { "YUVA",     DXGI_FORMAT_UNKNOWN,        VLC_CODEC_YUVA,          8, 1, 1, { DXGI_FORMAT_R8_UNORM,      DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM } },
+    { "I444_16",  DXGI_FORMAT_UNKNOWN,        VLC_CODEC_I444_16L,     16, 1, 1, { DXGI_FORMAT_R16_UNORM,     DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM } },
     { "B8G8R8A8", DXGI_FORMAT_B8G8R8A8_UNORM, VLC_CODEC_BGRA,          8, 1, 1, { DXGI_FORMAT_B8G8R8A8_UNORM } },
     { "VA_BGRA",  DXGI_FORMAT_B8G8R8A8_UNORM, VLC_CODEC_D3D11_OPAQUE_BGRA,  8, 1, 1, { DXGI_FORMAT_B8G8R8A8_UNORM } },
     { "R8G8B8A8", DXGI_FORMAT_R8G8B8A8_UNORM, VLC_CODEC_RGBA,          8, 1, 1, { DXGI_FORMAT_R8G8B8A8_UNORM } },
diff --git a/modules/video_output/win32/d3d11_shaders.c b/modules/video_output/win32/d3d11_shaders.c
index edb74f96a6..0f37b71fa5 100644
--- a/modules/video_output/win32/d3d11_shaders.c
+++ b/modules/video_output/win32/d3d11_shaders.c
@@ -402,6 +402,14 @@ HRESULT D3D11_CompilePixelShader(vlc_object_t *o, d3d11_handle_t *hd3d, bool leg
                        "sample.z  = shaderTexture[2].Sample(samplerState, coords_2).x * 64;\n"
                        "sample.a  = 1;";
                 break;
+            case VLC_CODEC_I444_16L:
+                psz_sampler[0] =
+                       "float3 coords_2 = float3(coords.x/2, coords.y, coords.z);\n"
+                       "sample.x  = shaderTexture[0].Sample(samplerState, coords_2).x;\n"
+                       "sample.y  = shaderTexture[1].Sample(samplerState, coords_2).x;\n"
+                       "sample.z  = shaderTexture[2].Sample(samplerState, coords_2).x;\n"
+                       "sample.a  = 1;";
+                break;
             case VLC_CODEC_I420:
                 psz_sampler[0] =
                        "sample.x  = shaderTexture[0].Sample(samplerState, coords).x;\n"
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 743b8f7613..5ec9fbcddf 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -877,6 +877,10 @@ static int SetupOutputFormat(vout_display_t *vd, video_format_t *fmt)
             bits_per_channel = 8;
             widthDenominator = heightDenominator = 1;
             break;
+        case VLC_CODEC_NVDEC_OPAQUE_444_16B:
+            bits_per_channel = 16;
+            widthDenominator = heightDenominator = 1;
+            break;
         default:
             {
                 const vlc_chroma_description_t *p_format = vlc_fourcc_GetChromaDescription(fmt->i_chroma);



More information about the vlc-commits mailing list