You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/nvenc: fix b frame n_quant_offset
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
This commit is contained in:
committed by
Timo Rothenpieler
parent
8e7571eacd
commit
2b5dda3f48
@@ -742,8 +742,6 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
|
|||||||
switch (avctx->codec->id) {
|
switch (avctx->codec->id) {
|
||||||
case AV_CODEC_ID_H264:
|
case AV_CODEC_ID_H264:
|
||||||
ctx->encode_config.encodeCodecConfig.h264Config.idrPeriod = avctx->gop_size;
|
ctx->encode_config.encodeCodecConfig.h264Config.idrPeriod = avctx->gop_size;
|
||||||
ctx->encode_config.encodeCodecConfig.h264Config.hierarchicalPFrames = 1;
|
|
||||||
ctx->encode_config.encodeCodecConfig.h264Config.hierarchicalBFrames = 1;
|
|
||||||
break;
|
break;
|
||||||
case AV_CODEC_ID_H265:
|
case AV_CODEC_ID_H265:
|
||||||
ctx->encode_config.encodeCodecConfig.hevcConfig.idrPeriod = avctx->gop_size;
|
ctx->encode_config.encodeCodecConfig.hevcConfig.idrPeriod = avctx->gop_size;
|
||||||
@@ -843,9 +841,9 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
if(avctx->i_quant_factor != 0.0 && avctx->b_quant_factor != 0.0) {
|
if(avctx->i_quant_factor != 0.0 && avctx->b_quant_factor != 0.0) {
|
||||||
ctx->encode_config.rcParams.initialRCQP.qpIntra = qp_inter_p * fabs(avctx->i_quant_factor);
|
ctx->encode_config.rcParams.initialRCQP.qpIntra = qp_inter_p * fabs(avctx->i_quant_factor);
|
||||||
ctx->encode_config.rcParams.initialRCQP.qpIntra += qp_inter_p * avctx->i_quant_offset;
|
ctx->encode_config.rcParams.initialRCQP.qpIntra += avctx->i_quant_offset;
|
||||||
ctx->encode_config.rcParams.initialRCQP.qpInterB = qp_inter_p * fabs(avctx->b_quant_factor);
|
ctx->encode_config.rcParams.initialRCQP.qpInterB = qp_inter_p * fabs(avctx->b_quant_factor);
|
||||||
ctx->encode_config.rcParams.initialRCQP.qpInterB += qp_inter_p * avctx->b_quant_offset;
|
ctx->encode_config.rcParams.initialRCQP.qpInterB += avctx->b_quant_offset;
|
||||||
} else {
|
} else {
|
||||||
ctx->encode_config.rcParams.initialRCQP.qpIntra = qp_inter_p;
|
ctx->encode_config.rcParams.initialRCQP.qpIntra = qp_inter_p;
|
||||||
ctx->encode_config.rcParams.initialRCQP.qpInterB = qp_inter_p;
|
ctx->encode_config.rcParams.initialRCQP.qpInterB = qp_inter_p;
|
||||||
|
Reference in New Issue
Block a user