mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
lavc/qsvenc: make hevc alignment same as h264 for 1.19+ version
It is to clean up to the code and To-Do list. Signed-off-by: Zhong Li <zhong.li@intel.com>
This commit is contained in:
parent
34cba65557
commit
33df1afe39
@ -446,6 +446,12 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
|
|||||||
int ret;
|
int ret;
|
||||||
mfxVersion ver;
|
mfxVersion ver;
|
||||||
|
|
||||||
|
ret = MFXQueryVersion(q->session,&ver);
|
||||||
|
if (ret != MFX_ERR_NONE) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Error getting the session handle\n");
|
||||||
|
return AVERROR_UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
ret = ff_qsv_codec_id_to_mfx(avctx->codec_id);
|
ret = ff_qsv_codec_id_to_mfx(avctx->codec_id);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return AVERROR_BUG;
|
return AVERROR_BUG;
|
||||||
@ -494,10 +500,10 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
|
|||||||
q->param.mfx.FrameInfo.BitDepthChroma = 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.Shift = desc->comp[0].depth > 8;
|
||||||
|
|
||||||
// TODO: detect version of MFX--if the minor version is greater than
|
// If the minor version is greater than or equal to 19,
|
||||||
// or equal to 19, then can use the same alignment settings as H.264
|
// then can use the same alignment settings as H.264 for HEVC
|
||||||
// for HEVC
|
q->width_align = (avctx->codec_id != AV_CODEC_ID_HEVC ||
|
||||||
q->width_align = avctx->codec_id == AV_CODEC_ID_HEVC ? 32 : 16;
|
QSV_RUNTIME_VERSION_ATLEAST(ver, 1, 19)) ? 16 : 32;
|
||||||
q->param.mfx.FrameInfo.Width = FFALIGN(avctx->width, q->width_align);
|
q->param.mfx.FrameInfo.Width = FFALIGN(avctx->width, q->width_align);
|
||||||
|
|
||||||
if (avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
|
if (avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
|
||||||
@ -677,8 +683,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if QSV_HAVE_MF
|
#if QSV_HAVE_MF
|
||||||
ret = MFXQueryVersion(q->session,&ver);
|
if (QSV_RUNTIME_VERSION_ATLEAST(ver, 1, 25)) {
|
||||||
if (ret >= MFX_ERR_NONE && QSV_RUNTIME_VERSION_ATLEAST(ver, 1, 25)) {
|
|
||||||
q->extmfp.Header.BufferId = MFX_EXTBUFF_MULTI_FRAME_PARAM;
|
q->extmfp.Header.BufferId = MFX_EXTBUFF_MULTI_FRAME_PARAM;
|
||||||
q->extmfp.Header.BufferSz = sizeof(q->extmfp);
|
q->extmfp.Header.BufferSz = sizeof(q->extmfp);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user