diff options
author | Seungha Yang <seungha@centricular.com> | 2021-06-21 00:19:17 +0900 |
---|---|---|
committer | Seungha Yang <seungha@centricular.com> | 2021-07-29 22:33:30 +0900 |
commit | 554855f87fca8acd9b18c5374bd2cbaff61d8dc5 (patch) | |
tree | 6598ca5dfe2c560028e0090f2b4460b12454f856 /gst-libs | |
parent | 0f8631c476763a7de7e1537d8432a003edfbe60d (diff) | |
download | gstreamer-plugins-bad-554855f87fca8acd9b18c5374bd2cbaff61d8dc5.tar.gz |
d3d11: Disable packed and subsampled YUV formats
Direct3D11 sampler doesn't support them very well, and conversion
outputs usually result in poor visual quality with our shader code.
Should disable support for such formats for now
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2344>
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/d3d11/gstd3d11device.cpp | 17 | ||||
-rw-r--r-- | gst-libs/gst/d3d11/gstd3d11format.h | 2 |
2 files changed, 17 insertions, 2 deletions
diff --git a/gst-libs/gst/d3d11/gstd3d11device.cpp b/gst-libs/gst/d3d11/gstd3d11device.cpp index 0b03a0aa0..5eba00aba 100644 --- a/gst-libs/gst/d3d11/gstd3d11device.cpp +++ b/gst-libs/gst/d3d11/gstd3d11device.cpp @@ -95,7 +95,7 @@ enum #define DEFAULT_ADAPTER 0 #define DEFAULT_CREATE_FLAGS 0 -#define GST_D3D11_N_FORMATS 29 +#define GST_D3D11_N_FORMATS 25 struct _GstD3D11DevicePrivate { @@ -547,6 +547,20 @@ gst_d3d11_device_setup_format_table (GstD3D11Device * self) priv->format_table[n_formats].dxgi_format = DXGI_FORMAT_UNKNOWN; n_formats++; + /* FIXME: d3d11 sampler doesn't support packed-and-subsampled formats + * very well (and it's really poorly documented). + * As per observation, d3d11 samplers seems to be dropping the second + * Y componet from "Y0-U0-Y1-V0" pair which results in bad visual quality + * than 4:2:0 subsampled formats. We should revisit this later */ + + /* TODO: The best would be using d3d11 compute shader to handle this kinds of + * samples but comute shader is not implemented yet by us. + * + * Another simple approach is using d3d11 video processor, + * but capability will be very device dependent because it depends on + * GPU vendor's driver implementation, moreover, software fallback does + * not support d3d11 video processor. So it's not reliable in this case */ +#if 0 /* NOTE: packted yuv 4:2:2 YUY2, UYVY, and VYUY formats are not natively * supported render target view formats * (i.e., cannot be output format of shader pipeline) */ @@ -586,6 +600,7 @@ gst_d3d11_device_setup_format_table (GstD3D11Device * self) else priv->format_table[n_formats].dxgi_format = DXGI_FORMAT_UNKNOWN; n_formats++; +#endif priv->format_table[n_formats].format = GST_VIDEO_FORMAT_Y410; priv->format_table[n_formats].resource_format[0] = diff --git a/gst-libs/gst/d3d11/gstd3d11format.h b/gst-libs/gst/d3d11/gstd3d11format.h index de0bb38ab..2c7e93556 100644 --- a/gst-libs/gst/d3d11/gstd3d11format.h +++ b/gst-libs/gst/d3d11/gstd3d11format.h @@ -33,7 +33,7 @@ G_BEGIN_DECLS "GRAY8, GRAY16_LE" #define GST_D3D11_EXTRA_IN_FORMATS \ - "YUY2, UYVY, VYUY, Y210, Y410" + "Y410" #define GST_D3D11_SINK_FORMATS \ "{ " GST_D3D11_COMMON_FORMATS " ," GST_D3D11_EXTRA_IN_FORMATS " }" |