diff mbox series

[FFmpeg-devel,v2,5/6] avcodec/libsvtav1: Fix the max range for rc_mode

Message ID 1631928405-26935-5-git-send-email-lance.lmwang@gmail.com
State Accepted
Commit 0463f5d6d56db6cc01bc88a0d77488f4ef23dfdc
Headers show
Series [FFmpeg-devel,v2,1/6] avcodec/libsvtav1: Fix override setting of caps_internal | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Lance Wang Sept. 18, 2021, 1:26 a.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavcodec/libsvtav1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jan Ekström Sept. 25, 2021, 12:14 p.m. UTC | #1
On Sat, Sep 18, 2021 at 4:27 AM <lance.lmwang@gmail.com> wrote:
>
> From: Limin Wang <lance.lmwang@gmail.com>
>
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---

Probably something like "avcodec/libsvtav1: fix value range for
rc_mode" is a bit better as a commit message?

>  libavcodec/libsvtav1.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
> index b029e01..509d92d 100644
> --- a/libavcodec/libsvtav1.c
> +++ b/libavcodec/libsvtav1.c
> @@ -522,7 +522,7 @@ static const AVOption options[] = {
>  #undef LEVEL
>
>      { "rc", "Bit rate control mode", OFFSET(rc_mode),
> -      AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 3, VE , "rc"},
> +      AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 2, VE , "rc"},

And here we have another example of why bare numbers are bad :) .
Thanks for catching this.

Jan
Lance Wang Sept. 25, 2021, 1:13 p.m. UTC | #2
On Sat, Sep 25, 2021 at 03:14:34PM +0300, Jan Ekström wrote:
> On Sat, Sep 18, 2021 at 4:27 AM <lance.lmwang@gmail.com> wrote:
> >
> > From: Limin Wang <lance.lmwang@gmail.com>
> >
> > Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> > ---
> 
> Probably something like "avcodec/libsvtav1: fix value range for
> rc_mode" is a bit better as a commit message?

OK, will change that.

> 
> >  libavcodec/libsvtav1.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
> > index b029e01..509d92d 100644
> > --- a/libavcodec/libsvtav1.c
> > +++ b/libavcodec/libsvtav1.c
> > @@ -522,7 +522,7 @@ static const AVOption options[] = {
> >  #undef LEVEL
> >
> >      { "rc", "Bit rate control mode", OFFSET(rc_mode),
> > -      AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 3, VE , "rc"},
> > +      AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 2, VE , "rc"},
> 
> And here we have another example of why bare numbers are bad :) .
> Thanks for catching this.
> 
> Jan
> _______________________________________________
> 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".
diff mbox series

Patch

diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
index b029e01..509d92d 100644
--- a/libavcodec/libsvtav1.c
+++ b/libavcodec/libsvtav1.c
@@ -522,7 +522,7 @@  static const AVOption options[] = {
 #undef LEVEL
 
     { "rc", "Bit rate control mode", OFFSET(rc_mode),
-      AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 3, VE , "rc"},
+      AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 2, VE , "rc"},
         { "cqp", "Constant quantizer", 0, AV_OPT_TYPE_CONST, { .i64 = 0 },  INT_MIN, INT_MAX, VE, "rc" },
         { "vbr", "Variable Bit Rate, use a target bitrate for the entire stream", 0, AV_OPT_TYPE_CONST, { .i64 = 1 },  INT_MIN, INT_MAX, VE, "rc" },
         { "cvbr", "Constrained Variable Bit Rate, use a target bitrate for each GOP", 0, AV_OPT_TYPE_CONST,{ .i64 = 2 },  INT_MIN, INT_MAX, VE, "rc" },