From 211c6704e4e4272221fbc8c908b99307b11e1800 Mon Sep 17 00:00:00 2001 From: Andreas Hakon Date: Tue, 23 Apr 2019 09:25:15 +0100 Subject: [PATCH] libavcodec: QSV protect GPB code with CO3 define [v2] This patch protects some code using the member "co3" inside the qsvenc.c file. The first block is a simple debug message, so it doesn't generates troubles. The second block is an initialization using of the "extco3" for the QVBR mode. After this patch it's safe to enable/disable some options in the source code without triggering compilation errors. Signed-off-by: Andreas Hakon --- libavcodec/qsvenc.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 1.7.10.4