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

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>
This commit is contained in:
Haihao Xiang 2022-10-06 15:35:36 +08:00
parent aba25b391c
commit 1898dbddd5
4 changed files with 13 additions and 0 deletions

View File

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

View File

@ -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, \

View File

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

View File

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