[FFmpeg-cvslog] lavfi/vf_vpp_qsv: support UYVY in system memory

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


ffmpeg | branch: master | Haihao Xiang <haihao.xiang at intel.com> | Thu Mar 10 14:39:06 2022 +0800| [36016c55967622a1475e5ec9cade39543921915c] | committer: Haihao Xiang

lavfi/vf_vpp_qsv: support UYVY in system memory

It only works on Linux

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

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

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

 libavfilter/qsvvpp.c     | 9 +++++++++
 libavfilter/vf_vpp_qsv.c | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index 7e64944f2c..e181e7b584 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -247,6 +247,10 @@ static int pix_fmt_to_mfx_fourcc(int format)
         return MFX_FOURCC_RGB4;
     case AV_PIX_FMT_P010:
         return MFX_FOURCC_P010;
+#if CONFIG_VAAPI
+    case AV_PIX_FMT_UYVY422:
+        return MFX_FOURCC_UYVY;
+#endif
     }
 
     return MFX_FOURCC_NV12;
@@ -276,6 +280,11 @@ static int map_frame_to_surface(AVFrame *frame, mfxFrameSurface1 *surface)
         surface->Data.R = frame->data[0] + 2;
         surface->Data.A = frame->data[0] + 3;
         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;
     default:
         return MFX_ERR_UNSUPPORTED;
     }
diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c
index 010b69943a..65484fa091 100644
--- a/libavfilter/vf_vpp_qsv.c
+++ b/libavfilter/vf_vpp_qsv.c
@@ -703,6 +703,9 @@ static int vpp_query_formats(AVFilterContext *ctx)
         AV_PIX_FMT_YUYV422,
         AV_PIX_FMT_RGB32,
         AV_PIX_FMT_P010,
+#if CONFIG_VAAPI
+        AV_PIX_FMT_UYVY422,
+#endif
         AV_PIX_FMT_QSV,
         AV_PIX_FMT_NONE
     };



More information about the ffmpeg-cvslog mailing list