summaryrefslogtreecommitdiff
path: root/libavcodec/nvenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/nvenc.c')
-rw-r--r--libavcodec/nvenc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index b52b6bda6d..32bcd4b318 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -743,6 +743,15 @@ static av_cold void set_constqp(AVCodecContext *avctx)
rc->constQP.qpIntra = av_clip(ctx->cqp * fabs(avctx->i_quant_factor) + avctx->i_quant_offset + 0.5, 0, 51);
}
+#ifdef NVENC_HAVE_QP_CHROMA_OFFSETS
+ rc->cbQPIndexOffset = ctx->qp_cb_offset;
+ rc->crQPIndexOffset = ctx->qp_cr_offset;
+#else
+ if (ctx->qp_cb_offset || ctx->qp_cr_offset) {
+ av_log(avctx, AV_LOG_WARNING, "Failed setting QP CB/CR offsets, SDK 11.1 or greater required at compile time.\n");
+ }
+#endif
+
avctx->qmin = -1;
avctx->qmax = -1;
}