From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] avcodec/libsvtav1: guard against bit_rate being zero
Date: Sun, 20 Nov 2022 08:50:31 -0300
Message-ID: <d72edb54-0bc5-04fb-08a7-e854be88039d@gmail.com> (raw)
In-Reply-To: <20221120023350.1684083-1-ccom@randomderp.com>
On 11/19/2022 11:33 PM, Christopher Degawa wrote:
> division by zero occurs if it's not specified
>
> Signed-off-by: Christopher Degawa <ccom@randomderp.com>
> ---
> libavcodec/libsvtav1.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
> index 48cd58a0b3..06874dfa63 100644
> --- a/libavcodec/libsvtav1.c
> +++ b/libavcodec/libsvtav1.c
> @@ -179,7 +179,9 @@ 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;
> + param->maximum_buffer_size_ms = avctx->bit_rate
> + ? (avctx->rc_buffer_size * 1000LL / avctx->bit_rate)
> + : 0;
The documentation for maximum_buffer_size_ms says minimum value is 20.
>
> if (svt_enc->crf > 0) {
> param->qp = svt_enc->crf;
_______________________________________________
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 11:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-20 2:33 Christopher Degawa
2022-11-20 11:50 ` James Almer [this message]
2022-11-20 19:07 ` [FFmpeg-devel] [PATCH v2] avcodec/libsvtav1: only set max_buf_sz if both bitrate and rc_buf_sz is set Christopher Degawa
2022-11-20 19:19 ` 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=d72edb54-0bc5-04fb-08a7-e854be88039d@gmail.com \
--to=jamrial@gmail.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