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;
{
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) {
} 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;
int init_qp_p;
int init_qp_b;
int init_qp_i;
+ int cqp;
} NvencContext;
int ff_nvenc_encode_init(AVCodecContext *avctx);
{ "init_qpP", "Initial QP value for P frame", OFFSET(init_qp_p), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 51, VE },
{ "init_qpB", "Initial QP value for B frame", OFFSET(init_qp_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 51, VE },
{ "init_qpI", "Initial QP value for I frame", OFFSET(init_qp_i), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 51, VE },
+ { "qp", "Constant quantization parameter rate control method",
+ OFFSET(cqp), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 51, VE },
{ NULL }
};
{ "init_qpP", "Initial QP value for P frame", OFFSET(init_qp_p), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 51, VE },
{ "init_qpB", "Initial QP value for B frame", OFFSET(init_qp_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 51, VE },
{ "init_qpI", "Initial QP value for I frame", OFFSET(init_qp_i), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 51, VE },
+ { "qp", "Constant quantization parameter rate control method",
+ OFFSET(cqp), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 51, VE },
{ NULL }
};
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR 85
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MICRO 102
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \