[FFmpeg-devel] [PATCH 1/2] lavc/qsvenc_hevc: allow user set more coding options

Zhong Li lizhong1008 at gmail.com
Sun Jun 20 18:03:15 EEST 2021


Haihao Xiang <haihao.xiang at intel.com> 于2021年4月25日周日 上午9:32写道:
>
> The SDK supports NalHrdConformance, RecoveryPointSEI and AUDelimiter for
> hevc encoder, so we may allow user to set these coding options like what
> we did for h264_qsv encoder.
>
> '-strict xxx' to turn on / off NalHrdConformance
> '-recovery_point_sei xxx' to turn on / off RecoveryPointSEI
> '-aud xxx' to turn on / off AUDelimiter
>
> Signed-off-by: Haihao Xiang <haihao.xiang at intel.com>
> ---
>  libavcodec/qsvenc.c      | 15 ++++++++++++---
>  libavcodec/qsvenc_hevc.c |  2 ++
>  2 files changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
> index 566a5c8552..aeb010e456 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) {
> +        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",
> @@ -676,15 +680,20 @@ FF_ENABLE_DEPRECATION_WARNINGS
>              q->extco.CAVLC = q->cavlc ? MFX_CODINGOPTION_ON
>                                        : MFX_CODINGOPTION_UNKNOWN;
>
> +            if (q->single_sei_nal_unit >= 0)
> +                q->extco.SingleSeiNalUnit = q->single_sei_nal_unit ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
> +
> +            q->extco.MaxDecFrameBuffering = q->max_dec_frame_buffering;
> +        }
> +
> +        if (avctx->codec_id == AV_CODEC_ID_H264 ||
> +            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;

Is this available for hevc ?
As https://spec.oneapi.com/versions/latest/elements/oneVPL/source/appendix/VPL_apnds_f.html,
"The application can configure an AVC encoder to work in CQP rate
control mode with HRD model parameters. oneVPL will place HRD
information to SPS/VUI and choose the appropriate profile/level"
Looks like only available for AVC?


More information about the ffmpeg-devel mailing list