From: Christopher Degawa <ccom@randomderp.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Christopher Degawa <ccom@randomderp.com>
Subject: [FFmpeg-devel] [PATCH v2] avcodec/libsvtav1: only set max_buf_sz if both bitrate and rc_buf_sz is set
Date: Sun, 20 Nov 2022 13:07:36 -0600
Message-ID: <20221120190736.1781675-1-ccom@randomderp.com> (raw)
In-Reply-To: <20221120023350.1684083-1-ccom@randomderp.com>
maximum_buffer_size_ms should only be set if both are specified or if
the user sets it through -svtav1-params buf-sz=val
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
---
libavcodec/libsvtav1.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
index 48cd58a0b3..7605baddfe 100644
--- a/libavcodec/libsvtav1.c
+++ b/libavcodec/libsvtav1.c
@@ -179,7 +179,8 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param,
param->min_qp_allowed = avctx->qmin;
}
param->max_bit_rate = avctx->rc_max_rate;
- param->maximum_buffer_size_ms = avctx->rc_buffer_size * 1000LL / avctx->bit_rate;
+ if (avctx->bit_rate && avctx->rc_buffer_size)
+ param->maximum_buffer_size_ms = avctx->rc_buffer_size * 1000LL / avctx->bit_rate;
if (svt_enc->crf > 0) {
param->qp = svt_enc->crf;
--
2.38.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2022-11-20 19:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-20 2:33 [FFmpeg-devel] [PATCH] avcodec/libsvtav1: guard against bit_rate being zero Christopher Degawa
2022-11-20 11:50 ` James Almer
2022-11-20 19:07 ` Christopher Degawa [this message]
2022-11-20 19:19 ` [FFmpeg-devel] [PATCH v2] avcodec/libsvtav1: only set max_buf_sz if both bitrate and rc_buf_sz is set James Almer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221120190736.1781675-1-ccom@randomderp.com \
--to=ccom@randomderp.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git