diff options
author | Haihao Xiang <haihao.xiang@intel.com> | 2022-10-06 10:35:34 +0300 |
---|---|---|
committer | Haihao Xiang <haihao.xiang@intel.com> | 2022-10-10 04:31:34 +0300 |
commit | 3f28116ea26a87fbe1c807248effaf449008d979 (patch) | |
tree | 7f6804ae26e2aa980b6c49cc5c916faf5c6466cf /libavcodec/qsvenc.c | |
parent | 1496e7c1732f6f2e2e8d9c6a1866c13756e54ac4 (diff) |
lavc/qsv: specify Shift for each format too
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Diffstat (limited to 'libavcodec/qsvenc.c')
-rw-r--r-- | libavcodec/qsvenc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 398fa6ff22..dc5479d0f3 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -553,7 +553,7 @@ static int init_video_param_jpeg(AVCodecContext *avctx, QSVEncContext *q) if (!desc) return AVERROR_BUG; - ret = ff_qsv_map_pixfmt(sw_format, &q->param.mfx.FrameInfo.FourCC); + ret = ff_qsv_map_pixfmt(sw_format, &q->param.mfx.FrameInfo.FourCC, &q->param.mfx.FrameInfo.Shift); if (ret < 0) return AVERROR_BUG; @@ -567,7 +567,6 @@ static int init_video_param_jpeg(AVCodecContext *avctx, QSVEncContext *q) !desc->log2_chroma_w + !desc->log2_chroma_h; q->param.mfx.FrameInfo.BitDepthLuma = desc->comp[0].depth; q->param.mfx.FrameInfo.BitDepthChroma = desc->comp[0].depth; - q->param.mfx.FrameInfo.Shift = desc->comp[0].depth > 8; q->param.mfx.FrameInfo.Width = FFALIGN(avctx->width, 16); q->param.mfx.FrameInfo.Height = FFALIGN(avctx->height, 16); @@ -653,7 +652,7 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q) if (!desc) return AVERROR_BUG; - ret = ff_qsv_map_pixfmt(sw_format, &q->param.mfx.FrameInfo.FourCC); + ret = ff_qsv_map_pixfmt(sw_format, &q->param.mfx.FrameInfo.FourCC, &q->param.mfx.FrameInfo.Shift); if (ret < 0) return AVERROR_BUG; @@ -667,7 +666,6 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q) !desc->log2_chroma_w + !desc->log2_chroma_h; q->param.mfx.FrameInfo.BitDepthLuma = desc->comp[0].depth; q->param.mfx.FrameInfo.BitDepthChroma = desc->comp[0].depth; - q->param.mfx.FrameInfo.Shift = desc->comp[0].depth > 8; // If the minor version is greater than or equal to 19, // then can use the same alignment settings as H.264 for HEVC |