diff options
author | Ricardo Monteiro <rmonteiro@nvidia.com> | 2021-08-03 17:02:26 +0200 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2021-08-08 01:56:32 +0200 |
commit | e56f6e59b6cbb2ebfa49bee8a21e6f4f09e7ade0 (patch) | |
tree | 2474f8b930cb6294a5e4c71c615adc30a7a8901c /libavcodec/nvenc.c | |
parent | 5ad436fcb91a538343e2798ce29630ad4aa71b3c (diff) | |
download | ffmpeg-e56f6e59b6cbb2ebfa49bee8a21e6f4f09e7ade0.tar.gz |
avcodec/nvenc: add chroma qp offset support
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Diffstat (limited to 'libavcodec/nvenc.c')
-rw-r--r-- | libavcodec/nvenc.c | 9 |
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; } |