This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 42eb1945e1a916dededcdbd617df22d2ebea6be4 Author: Kacper Michajłow <[email protected]> AuthorDate: Tue Sep 22 11:39:11 2026 +0200 Commit: Kacper Michajłow <[email protected]> CommitDate: Tue Sep 22 21:07:52 2026 +0000 avcodec/dxva2: map 4:2:2 and 4:4:4 surface formats for hwcontext use Since 586c392bc7 av1dec offers AV_PIX_FMT_D3D11 for 8-bit and 10-bit 4:2:2 and 4:4:4 streams, but only the legacy hwaccel_context path could use it. With hw_device_ctx or hw_frames_ctx the shared ff_dxva2_common_frame_params mapped these streams to NV12 and d3d11va_map_sw_to_hw_format had no entry for the packed formats, so the decoder either failed the render target check or was created over surfaces of the wrong format. Map the 4:2:2 and 4:4:4 software formats to YUY2, Y210, Y216, AYUV, Y410 and Y416 as the DXVA specifications define them, so the D3D11 path now works for such streams. Signed-off-by: Kacper Michajłow <[email protected]> --- libavcodec/dxva2.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c index ead5eabb47..4fbb9c5be6 100644 --- a/libavcodec/dxva2.c +++ b/libavcodec/dxva2.c @@ -478,7 +478,16 @@ static DXGI_FORMAT d3d11va_map_sw_to_hw_format(enum AVPixelFormat pix_fmt) switch (pix_fmt) { case AV_PIX_FMT_NV12: return DXGI_FORMAT_NV12; case AV_PIX_FMT_P010: return DXGI_FORMAT_P010; - case AV_PIX_FMT_P012: return DXGI_FORMAT_P016; + case AV_PIX_FMT_P012: + case AV_PIX_FMT_P016: return DXGI_FORMAT_P016; + case AV_PIX_FMT_YUYV422: return DXGI_FORMAT_YUY2; + case AV_PIX_FMT_Y210: return DXGI_FORMAT_Y210; + case AV_PIX_FMT_Y212: + case AV_PIX_FMT_Y216: return DXGI_FORMAT_Y216; + case AV_PIX_FMT_VUYX: return DXGI_FORMAT_AYUV; + case AV_PIX_FMT_XV30: return DXGI_FORMAT_Y410; + case AV_PIX_FMT_XV36: + case AV_PIX_FMT_XV48: return DXGI_FORMAT_Y416; case AV_PIX_FMT_YUV420P: return DXGI_FORMAT_420_OPAQUE; default: return DXGI_FORMAT_UNKNOWN; } @@ -651,6 +660,12 @@ int ff_dxva2_common_frame_params(AVCodecContext *avctx, switch (avctx->sw_pix_fmt) { case AV_PIX_FMT_YUV420P10: frames_ctx->sw_format = AV_PIX_FMT_P010; break; case AV_PIX_FMT_YUV420P12: frames_ctx->sw_format = AV_PIX_FMT_P012; break; + case AV_PIX_FMT_YUV422P: frames_ctx->sw_format = AV_PIX_FMT_YUYV422; break; + case AV_PIX_FMT_YUV422P10: frames_ctx->sw_format = AV_PIX_FMT_Y210; break; + case AV_PIX_FMT_YUV422P12: frames_ctx->sw_format = AV_PIX_FMT_Y212; break; + case AV_PIX_FMT_YUV444P: frames_ctx->sw_format = AV_PIX_FMT_VUYX; break; + case AV_PIX_FMT_YUV444P10: frames_ctx->sw_format = AV_PIX_FMT_XV30; break; + case AV_PIX_FMT_YUV444P12: frames_ctx->sw_format = AV_PIX_FMT_XV36; break; default: frames_ctx->sw_format = AV_PIX_FMT_NV12; break; } frames_ctx->width = FFALIGN(avctx->coded_width, surface_alignment); -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
