diff options
author | Haihao Xiang <haihao.xiang@intel.com> | 2020-11-05 15:20:10 +0800 |
---|---|---|
committer | Zhong Li <zhongli_dev@126.com> | 2021-07-02 23:38:36 +0800 |
commit | 9583e66ea0232043353bec7bda5f82554e04232c (patch) | |
tree | 9a243b13514a3b688f56647d33c9034943235abd /libavcodec/qsvenc.c | |
parent | 8c2c0135e5f497a5ecbbcd237620002f791f37c3 (diff) |
qsvenc_hevc: allow user set more coding options
The SDK supports NalHrdConformance, RecoveryPointSEI and AUDelimiter for
hevc encoder, so we may allow user to set these coding options like as
what we did for h264_qsv encoder.
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Signed-off-by: Zhong Li <zhongli_dev@126.com>
Diffstat (limited to 'libavcodec/qsvenc.c')
-rw-r--r-- | libavcodec/qsvenc.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 0ec8e0e597..ca2b42cafd 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -290,6 +290,10 @@ static void dump_video_param(AVCodecContext *avctx, QSVEncContext *q, "NalHrdConformance: %s; SingleSeiNalUnit: %s; VuiVclHrdParameters: %s VuiNalHrdParameters: %s\n", print_threestate(co->NalHrdConformance), print_threestate(co->SingleSeiNalUnit), print_threestate(co->VuiVclHrdParameters), print_threestate(co->VuiNalHrdParameters)); + } else if ((avctx->codec_id == AV_CODEC_ID_HEVC) && QSV_RUNTIME_VERSION_ATLEAST(q->ver, 1, 28)) { + av_log(avctx, AV_LOG_VERBOSE, + "NalHrdConformance: %s; VuiNalHrdParameters: %s\n", + print_threestate(co->NalHrdConformance), print_threestate(co->VuiNalHrdParameters)); } av_log(avctx, AV_LOG_VERBOSE, "FrameRateExtD: %"PRIu32"; FrameRateExtN: %"PRIu32" \n", @@ -680,6 +684,15 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q) q->extco.RecoveryPointSEI = q->recovery_point_sei ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; q->extco.MaxDecFrameBuffering = q->max_dec_frame_buffering; q->extco.AUDelimiter = q->aud ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; + } else if (avctx->codec_id == AV_CODEC_ID_HEVC) { + if (avctx->strict_std_compliance != FF_COMPLIANCE_NORMAL) + q->extco.NalHrdConformance = avctx->strict_std_compliance > FF_COMPLIANCE_NORMAL ? + MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; + + if (q->recovery_point_sei >= 0) + q->extco.RecoveryPointSEI = q->recovery_point_sei ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; + + q->extco.AUDelimiter = q->aud ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; } q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer *)&q->extco; |