summaryrefslogtreecommitdiff
path: root/libavcodec/qsvenc.c
diff options
context:
space:
mode:
authornyanmisaka <nst799610810@gmail.com>2022-11-02 01:58:06 +0800
committerHaihao Xiang <haihao.xiang@intel.com>2022-11-07 10:57:12 +0800
commit09775cfea7def7a7ba8f0f179c75cec05fbbb8b0 (patch)
treeae33e2e9b1c4b32186bb2222a7195b19d067a142 /libavcodec/qsvenc.c
parente137d197b54a3accfae27d7458f1ee80491cfa7e (diff)
downloadffmpeg-09775cfea7def7a7ba8f0f179c75cec05fbbb8b0.tar.gz
libavcodec/qsvenc_hevc: add tier option
Without this change, MSDK/VPL always defaults the HEVC tier to MAIN if the -level is specified. Also, according to the HEVC specs, only level >= 4 can support High Tier. Signed-off-by: nyanmisaka <nst799610810@gmail.com>
Diffstat (limited to 'libavcodec/qsvenc.c')
-rw-r--r--libavcodec/qsvenc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 0db774ea63..f15ab15e9b 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -709,8 +709,11 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
return AVERROR_BUG;
q->param.mfx.CodecId = ret;
- if (avctx->level > 0)
+ if (avctx->level > 0) {
q->param.mfx.CodecLevel = avctx->level;
+ if (avctx->codec_id == AV_CODEC_ID_HEVC && avctx->level >= MFX_LEVEL_HEVC_4)
+ q->param.mfx.CodecLevel |= q->tier;
+ }
if (avctx->compression_level == FF_COMPRESSION_DEFAULT) {
avctx->compression_level = q->preset;