You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/nvenc: round qpIntra and qpInter calculation
Round qpIntra and qpInter calculation instead of old floor behavior. Adopted from vaapi_encode_h264.c Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
This commit is contained in:
committed by
Timo Rothenpieler
parent
03a69bd897
commit
f8c503d927
@@ -544,9 +544,9 @@ static av_cold void set_vbr(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) {
|
||||||
rc->initialRCQP.qpIntra = av_clip(
|
rc->initialRCQP.qpIntra = av_clip(
|
||||||
qp_inter_p * fabs(avctx->i_quant_factor) + avctx->i_quant_offset, 0, 51);
|
qp_inter_p * fabs(avctx->i_quant_factor) + avctx->i_quant_offset + 0.5, 0, 51);
|
||||||
rc->initialRCQP.qpInterB = av_clip(
|
rc->initialRCQP.qpInterB = av_clip(
|
||||||
qp_inter_p * fabs(avctx->b_quant_factor) + avctx->b_quant_offset, 0, 51);
|
qp_inter_p * fabs(avctx->b_quant_factor) + avctx->b_quant_offset + 0.5, 0, 51);
|
||||||
} else {
|
} else {
|
||||||
rc->initialRCQP.qpIntra = qp_inter_p;
|
rc->initialRCQP.qpIntra = qp_inter_p;
|
||||||
rc->initialRCQP.qpInterB = qp_inter_p;
|
rc->initialRCQP.qpInterB = qp_inter_p;
|
||||||
|
Reference in New Issue
Block a user