1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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@intel.com>
This commit is contained in:
Haihao Xiang 2022-03-10 14:34:22 +08:00
parent 3b3a321fed
commit f1355ec9f6

View File

@ -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;