From 626fba4a8f76a982c341f08431f8631fb91d16a9 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 19 Aug 2023 18:09:07 -0500 Subject: [PATCH] Fix DXVA2 chroma subsampling assuming interlaced content --- app/streaming/video/ffmpeg-renderers/dxva2.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/streaming/video/ffmpeg-renderers/dxva2.cpp b/app/streaming/video/ffmpeg-renderers/dxva2.cpp index 23a89af7..93919da2 100644 --- a/app/streaming/video/ffmpeg-renderers/dxva2.cpp +++ b/app/streaming/video/ffmpeg-renderers/dxva2.cpp @@ -1109,14 +1109,17 @@ void DXVA2Renderer::renderFrame(AVFrame *frame) switch (frame->chroma_location) { case AVCHROMA_LOC_LEFT: m_Desc.SampleFormat.VideoChromaSubsampling = DXVA2_VideoChromaSubsampling_Horizontally_Cosited | - DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes; + DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes | + DXVA2_VideoChromaSubsampling_ProgressiveChroma; break; case AVCHROMA_LOC_CENTER: - m_Desc.SampleFormat.VideoChromaSubsampling = DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes; + m_Desc.SampleFormat.VideoChromaSubsampling = DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes | + DXVA2_VideoChromaSubsampling_ProgressiveChroma; break; case AVCHROMA_LOC_TOPLEFT: m_Desc.SampleFormat.VideoChromaSubsampling = DXVA2_VideoChromaSubsampling_Horizontally_Cosited | - DXVA2_VideoChromaSubsampling_Vertically_Cosited; + DXVA2_VideoChromaSubsampling_Vertically_Cosited | + DXVA2_VideoChromaSubsampling_ProgressiveChroma; break; default: m_Desc.SampleFormat.VideoChromaSubsampling = DXVA2_VideoChromaSubsampling_Unknown;