[FFmpeg-cvslog] lavu/hwcontext_qsv: add support for UYVY

Haihao Xiang git at videolan.org
Tue Feb 7 03:54:52 EET 2023


ffmpeg | branch: master | Haihao Xiang <haihao.xiang at intel.com> | Thu Mar 10 14:34:22 2022 +0800| [f1355ec9f6125ff8eb644e5beb3e3ccd6e35da28] | committer: Haihao Xiang

lavu/hwcontext_qsv: add support for UYVY

The SDK supports UYVY from version 1.17, and VPP may support UYVY
input on Linux [1]

$ ffmpeg -loglevel verbose -init_hw_device qsv=intel -f lavfi -i \
yuvtestsrc -vf \
"format=uyvy422,hwupload=extra_hw_frames=32,vpp_qsv=format=nv12" \
-f null -

[1] https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/samples/readme-vpp_linux.md

Signed-off-by: Haihao Xiang <haihao.xiang at intel.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f1355ec9f6125ff8eb644e5beb3e3ccd6e35da28
---

 libavutil/hwcontext_qsv.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c
index ec0f72b329..42851d4fd5 100644
--- a/libavutil/hwcontext_qsv.c
+++ b/libavutil/hwcontext_qsv.c
@@ -118,6 +118,8 @@ static const struct {
 #if CONFIG_VAAPI
     { AV_PIX_FMT_YUYV422,
                        MFX_FOURCC_YUY2, 0 },
+    { AV_PIX_FMT_UYVY422,
+                       MFX_FOURCC_UYVY, 0 },
     { AV_PIX_FMT_Y210,
                        MFX_FOURCC_Y210, 1 },
     // VUYX is used for VAAPI child device,
@@ -1556,6 +1558,11 @@ static int map_frame_to_surface(const AVFrame *frame, mfxFrameSurface1 *surface)
         // use the value from the frame.
         surface->Data.A = frame->data[0] + 6;
         break;
+    case AV_PIX_FMT_UYVY422:
+        surface->Data.Y = frame->data[0] + 1;
+        surface->Data.U = frame->data[0];
+        surface->Data.V = frame->data[0] + 2;
+        break;
 #endif
     default:
         return MFX_ERR_UNSUPPORTED;



More information about the ffmpeg-cvslog mailing list