diff options
author | Fei Wang <fei.w.wang@intel.com> | 2022-10-06 15:35:38 +0800 |
---|---|---|
committer | Haihao Xiang <haihao.xiang@intel.com> | 2022-10-10 09:31:34 +0800 |
commit | 56a52af12b4a93a4d12f3944dd348d6a6797f615 (patch) | |
tree | de80a92b0208a4def970d2123c2e88695baccc1e /libavcodec/qsvdec.c | |
parent | 201cb35061f2ad34d0effb7f10084cc5148e880c (diff) | |
download | ffmpeg-56a52af12b4a93a4d12f3944dd348d6a6797f615.tar.gz |
lavc/qsv: add support for decoding & encoding 12bit content
AV_PIX_FMT_P012, AV_PIX_FMT_Y212 and AV_PIX_FMT_XV36 are used in
FFmpeg and MFX_FOURCC_P016, MFX_FOURCC_Y216, and MFX_FOURCC_Y416 are used
in the SDK
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Diffstat (limited to 'libavcodec/qsvdec.c')
-rw-r--r-- | libavcodec/qsvdec.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index 912d58965a..73405b5747 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -137,14 +137,19 @@ static int qsv_get_continuous_buffer(AVCodecContext *avctx, AVFrame *frame, frame->linesize[0] = FFALIGN(avctx->width, 128); break; case AV_PIX_FMT_P010: + case AV_PIX_FMT_P012: case AV_PIX_FMT_YUYV422: frame->linesize[0] = 2 * FFALIGN(avctx->width, 128); break; case AV_PIX_FMT_Y210: case AV_PIX_FMT_VUYX: case AV_PIX_FMT_XV30: + case AV_PIX_FMT_Y212: frame->linesize[0] = 4 * FFALIGN(avctx->width, 128); break; + case AV_PIX_FMT_XV36: + frame->linesize[0] = 8 * FFALIGN(avctx->width, 128); + break; default: av_log(avctx, AV_LOG_ERROR, "Unsupported pixel format.\n"); return AVERROR(EINVAL); @@ -156,7 +161,8 @@ static int qsv_get_continuous_buffer(AVCodecContext *avctx, AVFrame *frame, frame->data[0] = frame->buf[0]->data; if (avctx->pix_fmt == AV_PIX_FMT_NV12 || - avctx->pix_fmt == AV_PIX_FMT_P010) { + avctx->pix_fmt == AV_PIX_FMT_P010 || + avctx->pix_fmt == AV_PIX_FMT_P012) { frame->linesize[1] = frame->linesize[0]; frame->data[1] = frame->data[0] + frame->linesize[0] * FFALIGN(avctx->height, 64); @@ -1041,10 +1047,13 @@ const FFCodec ff_##x##_qsv_decoder = { \ .p.priv_class = &x##_qsv_class, \ .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, \ AV_PIX_FMT_P010, \ + AV_PIX_FMT_P012, \ AV_PIX_FMT_YUYV422, \ AV_PIX_FMT_Y210, \ + AV_PIX_FMT_Y212, \ AV_PIX_FMT_VUYX, \ AV_PIX_FMT_XV30, \ + AV_PIX_FMT_XV36, \ AV_PIX_FMT_QSV, \ AV_PIX_FMT_NONE }, \ .hw_configs = qsv_hw_configs, \ |