On Wed, Mar 11, 2020 at 11:44 AM Linjie Fu <linjie...@intel.com> wrote:
> Add qmax/qmin support for HEVC software bitrate control(SWBRC). > > Limitations: > - RateControlMethod != MFX_RATECONTROL_CQP > - with EXTBRC ON > > Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozh...@intel.com> > Signed-off-by: Linjie Fu <linjie...@intel.com> > --- > > Relative code in MSDK for the limitation: > > https://github.com/Intel-Media-SDK/MediaSDK/blob/master/_studio/mfx_lib/encode_hw/hevc/agnostic/g9/hevcehw_g9_legacy.cpp#L4267 > > libavcodec/qsvenc.c | 11 +++++------ > libavcodec/qsvenc_hevc.c | 2 ++ > 2 files changed, 7 insertions(+), 6 deletions(-) > > diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c > index 52b4e43..2c22eb7 100644 > --- a/libavcodec/qsvenc.c > +++ b/libavcodec/qsvenc.c > @@ -732,6 +732,11 @@ FF_ENABLE_DEPRECATION_WARNINGS > if (q->adaptive_b >= 0) > q->extco2.AdaptiveB = q->adaptive_b ? MFX_CODINGOPTION_ON > : MFX_CODINGOPTION_OFF; > #endif > + } > + > + if (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == > AV_CODEC_ID_HEVC) { > + if (q->extbrc >= 0) > + q->extco2.ExtBRC = q->extbrc ? MFX_CODINGOPTION_ON : > MFX_CODINGOPTION_OFF; > > #if QSV_VERSION_ATLEAST(1, 9) > if (avctx->qmin >= 0 && avctx->qmax >= 0 && avctx->qmin > > avctx->qmax) { > @@ -747,12 +752,6 @@ FF_ENABLE_DEPRECATION_WARNINGS > q->extco2.MaxQPP = q->extco2.MaxQPB = q->extco2.MaxQPI; > } > #endif > - } > - > - if (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == > AV_CODEC_ID_HEVC) { > - if (q->extbrc >= 0) > - q->extco2.ExtBRC = q->extbrc ? MFX_CODINGOPTION_ON : > MFX_CODINGOPTION_OFF; > - > q->extco2.Header.BufferId = MFX_EXTBUFF_CODING_OPTION2; > q->extco2.Header.BufferSz = sizeof(q->extco2); > > diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c > index 27e2232..3bdca7d 100644 > --- a/libavcodec/qsvenc_hevc.c > +++ b/libavcodec/qsvenc_hevc.c > @@ -262,6 +262,8 @@ static const AVCodecDefault qsv_enc_defaults[] = { > // same as the x264 default > { "g", "248" }, > { "bf", "8" }, > + { "qmin", "-1" }, > + { "qmax", "-1" }, > { "trellis", "-1" }, > { "flags", "+cgop" }, > #if FF_API_PRIVATE_OPT > -- > 2.7.4 > > > looks reasonable regards Max _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".