Commit 8c2e0162 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

direct3d11: remove dead I420/YV12 code

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent ad8cbfd6
......@@ -203,90 +203,6 @@ static const char* globPixelShaderDefault = "\
}\
";
static const char *globPixelShaderBiplanarI420_BT601_2RGB = "\
Texture2D shaderTextureY;\
Texture2D shaderTextureUV;\
SamplerState SampleType;\
\
struct PS_INPUT\
{\
float4 Position : SV_POSITION;\
float2 Texture : TEXCOORD0;\
float Opacity : OPACITY;\
};\
\
float4 PS( PS_INPUT In ) : SV_TARGET\
{\
float Y;\
float UCb;\
float VCr;\
float2 UCbPos;\
float2 VCrPos;\
float4 rgba;\
\
Y = shaderTextureY.Sample(SampleType, In.Texture).x;\
\
VCrPos = In.Texture / 2;\
VCr = shaderTextureUV.Sample(SampleType, VCrPos).x;\
\
UCbPos = In.Texture / 2;\
UCbPos.y = UCbPos.y + 0.5;\
UCb = shaderTextureUV.Sample(SampleType, UCbPos).x;\
\
Y = 1.164383561643836 * (Y - 0.0625);\
UCb = UCb - 0.5;\
VCr = VCr - 0.5;\
\
rgba.x = saturate(Y + 1.596026785714286 * VCr);\
rgba.y = saturate(Y - 0.812967647237771 * VCr - 0.391762290094914 * UCb);\
rgba.z = saturate(Y + 2.017232142857142 * UCb);\
rgba.a = In.Opacity;\
return rgba;\
}\
";
static const char *globPixelShaderBiplanarI420_BT709_2RGB = "\
Texture2D shaderTextureY;\
Texture2D shaderTextureUV;\
SamplerState SampleType;\
\
struct PS_INPUT\
{\
float4 Position : SV_POSITION;\
float2 Texture : TEXCOORD0;\
float Opacity : OPACITY;\
};\
\
float4 PS( PS_INPUT In ) : SV_TARGET\
{\
float Y;\
float UCb;\
float VCr;\
float2 UCbPos;\
float2 VCrPos;\
float4 rgba;\
\
Y = shaderTextureY.Sample(SampleType, In.Texture).x;\
\
VCrPos = In.Texture / 2;\
VCr = shaderTextureUV.Sample(SampleType, VCrPos).x;\
\
UCbPos = In.Texture / 2;\
UCbPos.y = UCbPos.y + 0.5;\
UCb = shaderTextureUV.Sample(SampleType, UCbPos).x;\
\
Y = 1.164383561643836 * (Y - 0.0625);\
UCb = UCb - 0.5;\
VCr = VCr - 0.5;\
\
rgba.x = saturate(Y + 1.792741071428571 * VCr);\
rgba.y = saturate(Y - 0.532909328559444 * VCr - 0.21324861427373 * UCb);\
rgba.z = saturate(Y + 2.112401785714286 * UCb);\
rgba.a = In.Opacity;\
return rgba;\
}\
";
static const char *globPixelShaderBiplanarYUV_BT601_2RGB = "\
Texture2D shaderTextureY;\
Texture2D shaderTextureUV;\
......@@ -1108,30 +1024,15 @@ static int Direct3D11Open(vout_display_t *vd, video_format_t *fmt)
sys->d3dregion_format = DXGI_FORMAT_UNKNOWN;
}
sys->d3dPxShader = globPixelShaderDefault;
if (sys->picQuadConfig.resourceFormatYRGB == DXGI_FORMAT_R8_UNORM)
{
switch (fmt->i_chroma)
{
case VLC_CODEC_NV12:
case VLC_CODEC_D3D11_OPAQUE:
if( fmt->i_height > 576 )
sys->d3dPxShader = globPixelShaderBiplanarYUV_BT709_2RGB;
else
sys->d3dPxShader = globPixelShaderBiplanarYUV_BT601_2RGB;
break;
case VLC_CODEC_YV12:
case VLC_CODEC_I420:
if( fmt->i_height > 576 )
sys->d3dPxShader = globPixelShaderBiplanarI420_BT709_2RGB;
else
sys->d3dPxShader = globPixelShaderBiplanarI420_BT601_2RGB;
break;
default:
vlc_assert_unreachable();
break;
}
if( fmt->i_height > 576 )
sys->d3dPxShader = globPixelShaderBiplanarYUV_BT709_2RGB;
else
sys->d3dPxShader = globPixelShaderBiplanarYUV_BT601_2RGB;
}
else
sys->d3dPxShader = globPixelShaderDefault;
if (sys->d3dregion_format != DXGI_FORMAT_UNKNOWN)
sys->psz_rgbaPxShader = globPixelShaderDefault;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment