diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2017-03-23 17:01:40 +0100 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2017-03-23 17:10:52 +0100 |
commit | 7fb2a7afa174fcd31c7707d4c93c0afc33f060b7 (patch) | |
tree | 458e88e84549732072204395e71dc8c71d65398b /libavcodec/nvenc.c | |
parent | 038e6aef7a54577a3bba6666cff21f5f4e3b2d0b (diff) | |
download | ffmpeg-7fb2a7afa174fcd31c7707d4c93c0afc33f060b7.tar.gz |
avcodec/nvenc: Deprecate usage of global_quality, introducing qp
Diffstat (limited to 'libavcodec/nvenc.c')
-rw-r--r-- | libavcodec/nvenc.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index 0abada0ff0..49f32228bc 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -522,10 +522,10 @@ static av_cold void set_constqp(AVCodecContext *avctx) rc->constQP.qpIntra = rc->constQP.qpInterP; rc->constQP.qpInterB = rc->constQP.qpInterP; } - } else if (avctx->global_quality > 0) { - rc->constQP.qpInterP = avctx->global_quality; - rc->constQP.qpInterB = avctx->global_quality; - rc->constQP.qpIntra = avctx->global_quality; + } else if (ctx->cqp >= 0) { + rc->constQP.qpInterP = ctx->cqp; + rc->constQP.qpInterB = ctx->cqp; + rc->constQP.qpIntra = ctx->cqp; } avctx->qmin = -1; @@ -664,6 +664,12 @@ static av_cold void nvenc_setup_rate_control(AVCodecContext *avctx) { NvencContext *ctx = avctx->priv_data; + if (avctx->global_quality > 0) + av_log(avctx, AV_LOG_WARNING, "Using global_quality with nvenc is deprecated. Use qp instead.\n"); + + if (ctx->cqp < 0 && avctx->global_quality > 0) + ctx->cqp = avctx->global_quality; + if (avctx->bit_rate > 0) { ctx->encode_config.rcParams.averageBitRate = avctx->bit_rate; } else if (ctx->encode_config.rcParams.averageBitRate > 0) { @@ -688,7 +694,7 @@ static av_cold void nvenc_setup_rate_control(AVCodecContext *avctx) } else { ctx->rc = NV_ENC_PARAMS_RC_CBR; } - } else if (avctx->global_quality > 0) { + } else if (ctx->cqp >= 0) { ctx->rc = NV_ENC_PARAMS_RC_CONSTQP; } else if (ctx->twopass) { ctx->rc = NV_ENC_PARAMS_RC_2_PASS_VBR; |