aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/qsv.c
diff options
context:
space:
mode:
authorHaihao Xiang <haihao.xiang@intel.com>2022-09-06 12:53:38 +0800
committerHaihao Xiang <haihao.xiang@intel.com>2022-09-07 14:04:40 +0800
commitdb85e01fd7976150a522a1881f3479661d8c1a79 (patch)
tree81efabe354b767d936d82550c4f3c83e6d0ae332 /libavcodec/qsv.c
parentb7dbffe69801d15cd1ba59223f94b449c2ac8dbc (diff)
downloadffmpeg-db85e01fd7976150a522a1881f3479661d8c1a79.tar.gz
lavc/qsv: Add support for decoding & encoding 8bit 4:4:4 content
AV_PIX_FMT_VUYX is used in FFmpeg and MFX_FOURCC_AYUV is used in the SDK Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Diffstat (limited to 'libavcodec/qsv.c')
-rw-r--r--libavcodec/qsv.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 3449789a2c..51aac16695 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -211,6 +211,7 @@ enum AVPixelFormat ff_qsv_map_fourcc(uint32_t fourcc)
#if CONFIG_VAAPI
case MFX_FOURCC_YUY2: return AV_PIX_FMT_YUYV422;
case MFX_FOURCC_Y210: return AV_PIX_FMT_Y210;
+ case MFX_FOURCC_AYUV: return AV_PIX_FMT_VUYX;
#endif
}
return AV_PIX_FMT_NONE;
@@ -243,6 +244,9 @@ int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc)
case AV_PIX_FMT_Y210:
*fourcc = MFX_FOURCC_Y210;
return AV_PIX_FMT_Y210;
+ case AV_PIX_FMT_VUYX:
+ *fourcc = MFX_FOURCC_AYUV;
+ return AV_PIX_FMT_VUYX;
#endif
default:
return AVERROR(ENOSYS);
@@ -277,6 +281,16 @@ int ff_qsv_map_frame_to_surface(const AVFrame *frame, mfxFrameSurface1 *surface)
surface->Data.U16 = (mfxU16 *)frame->data[0] + 1;
surface->Data.V16 = (mfxU16 *)frame->data[0] + 3;
break;
+
+ case AV_PIX_FMT_VUYX:
+ surface->Data.V = frame->data[0];
+ surface->Data.U = frame->data[0] + 1;
+ surface->Data.Y = frame->data[0] + 2;
+ // Only set Data.A to a valid address, the SDK doesn't
+ // use the value from the frame.
+ surface->Data.A = frame->data[0] + 3;
+ break;
+
default:
return AVERROR(ENOSYS);
}