Message ID | j8_J9HNIbQdAj7QPvmU4hfDu0GNLNNZr2aLY8E80aTk1EI8nCgYFRuiouFH9KeoGPMj4RVu5UqXgEx7BhGc-tKFblcTUeoJ6DoveyAjP1ls=@protonmail.com |
---|---|
State | New |
Headers | show |
> > But the CODE doesn't say that! > > > > The code uses: > > "#if QSV_HAVE_CO3" > > > > And then every use of the "co3" member needs to be protected by this > clausule. > > Futhermore, this is true in every part of the source code in > > "qsvenc.c"... except at two points (I need to review my patch, as I noticed > another block not protected). > > > > This is a must, even if "QSV_VERSION_ATLEAST(1, 18)" > > "QSV_VERSION_ATLEAST(1, 11)" > > > > Why? > > Because the option "QSV_HAVE_CO3" can be rewriten (for example, > disabled). I don't think so. It is pre-compile checking and should not be decided in FFmpeg level, indstead depended on MSDK API has defined it or not.
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index a03ab69..feedceb 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -267,10 +267,12 @@ static void dump_video_param(AVCodecContext *avctx, QSVEncContext *q, #endif #endif +#if QSV_HAVE_CO3 #if QSV_HAVE_GPB if (avctx->codec_id == AV_CODEC_ID_HEVC) av_log(avctx, AV_LOG_VERBOSE,"GPB: %s\n", print_threestate(co3->GPB)); #endif +#endif if (avctx->codec_id == AV_CODEC_ID_H264) { av_log(avctx, AV_LOG_VERBOSE, "Entropy coding: %s; MaxDecFrameBuffering: %"PRIu16"\n", @@ -598,9 +600,11 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q) q->param.mfx.MaxKbps = max_bitrate_kbps / brc_param_multiplier; q->param.mfx.BRCParamMultiplier = brc_param_multiplier; #if QSV_HAVE_QVBR +#if QSV_HAVE_CO3 if (q->param.mfx.RateControlMethod == MFX_RATECONTROL_QVBR) q->extco3.QVBRQuality = av_clip(avctx->global_quality, 0, 51); #endif +#endif break; case MFX_RATECONTROL_CQP: quant = avctx->global_quality / FF_QP2LAMBDA;