aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHaihao Xiang <haihao.xiang@intel.com>2022-10-06 15:35:36 +0800
committerHaihao Xiang <haihao.xiang@intel.com>2022-10-10 09:31:34 +0800
commit1898dbddd5dcf2d3e955b84eeafa91862988dbfa (patch)
tree06e62fd03805bc1a882d998f0118eeda727f0399
parentaba25b391c7f68cea456d1b862a71bcd105b46f3 (diff)
downloadffmpeg-1898dbddd5dcf2d3e955b84eeafa91862988dbfa.tar.gz
lavc/qsv: add support for decoding & encoding 10bit 4:4:4 content
AV_PIX_FMT_XV30 is used in FFmpeg and MFX_FOURCC_Y410 is used in the SDK. Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
-rw-r--r--libavcodec/qsv.c9
-rw-r--r--libavcodec/qsvdec.c2
-rw-r--r--libavcodec/qsvenc_hevc.c1
-rw-r--r--libavcodec/qsvenc_vp9.c1
4 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 4e11b33a7d..f38c617fc3 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -212,6 +212,7 @@ enum AVPixelFormat ff_qsv_map_fourcc(uint32_t fourcc)
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;
+ case MFX_FOURCC_Y410: return AV_PIX_FMT_XV30;
#endif
}
return AV_PIX_FMT_NONE;
@@ -254,6 +255,10 @@ int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc, uint16_t *shi
*fourcc = MFX_FOURCC_AYUV;
*shift = 0;
return AV_PIX_FMT_VUYX;
+ case AV_PIX_FMT_XV30:
+ *fourcc = MFX_FOURCC_Y410;
+ *shift = 0;
+ return AV_PIX_FMT_XV30;
#endif
default:
return AVERROR(ENOSYS);
@@ -298,6 +303,10 @@ int ff_qsv_map_frame_to_surface(const AVFrame *frame, mfxFrameSurface1 *surface)
surface->Data.A = frame->data[0] + 3;
break;
+ case AV_PIX_FMT_XV30:
+ surface->Data.U = frame->data[0];
+ break;
+
default:
return AVERROR(ENOSYS);
}
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index 0254a394bd..912d58965a 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -142,6 +142,7 @@ static int qsv_get_continuous_buffer(AVCodecContext *avctx, AVFrame *frame,
break;
case AV_PIX_FMT_Y210:
case AV_PIX_FMT_VUYX:
+ case AV_PIX_FMT_XV30:
frame->linesize[0] = 4 * FFALIGN(avctx->width, 128);
break;
default:
@@ -1043,6 +1044,7 @@ const FFCodec ff_##x##_qsv_decoder = { \
AV_PIX_FMT_YUYV422, \
AV_PIX_FMT_Y210, \
AV_PIX_FMT_VUYX, \
+ AV_PIX_FMT_XV30, \
AV_PIX_FMT_QSV, \
AV_PIX_FMT_NONE }, \
.hw_configs = qsv_hw_configs, \
diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c
index a5bf915954..1e1574a6f2 100644
--- a/libavcodec/qsvenc_hevc.c
+++ b/libavcodec/qsvenc_hevc.c
@@ -316,6 +316,7 @@ const FFCodec ff_hevc_qsv_encoder = {
AV_PIX_FMT_BGRA,
AV_PIX_FMT_X2RGB10,
AV_PIX_FMT_VUYX,
+ AV_PIX_FMT_XV30,
AV_PIX_FMT_NONE },
.p.priv_class = &class,
.defaults = qsv_enc_defaults,
diff --git a/libavcodec/qsvenc_vp9.c b/libavcodec/qsvenc_vp9.c
index 044a882d1a..d0340ef94b 100644
--- a/libavcodec/qsvenc_vp9.c
+++ b/libavcodec/qsvenc_vp9.c
@@ -115,6 +115,7 @@ const FFCodec ff_vp9_qsv_encoder = {
AV_PIX_FMT_P010,
AV_PIX_FMT_VUYX,
AV_PIX_FMT_QSV,
+ AV_PIX_FMT_XV30,
AV_PIX_FMT_NONE },
.p.priv_class = &class,
.defaults = qsv_enc_defaults,