diff mbox series

[FFmpeg-devel,v3,1/2] avcodec/libsvtav1: update avctx bit rate according to RC mode

Message ID 20220509184728.10265-1-jeebjp@gmail.com
State Accepted
Commit 70887d44ffa31b95704b85531fc53ddd4d9aab14
Headers show
Series [FFmpeg-devel,v3,1/2] avcodec/libsvtav1: update avctx bit rate according to RC mode | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Jan Ekström May 9, 2022, 6:47 p.m. UTC
This way we can filter out the default value for this member, which
is nonzero. Bases on the current affairs that bit rate based rate
control is nonzero in SVT-AV1.
---
 libavcodec/libsvtav1.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

James Almer May 9, 2022, 7:07 p.m. UTC | #1
On 5/9/2022 3:47 PM, Jan Ekström wrote:
> This way we can filter out the default value for this member, which
> is nonzero. Bases on the current affairs that bit rate based rate
> control is nonzero in SVT-AV1.
> ---
>   libavcodec/libsvtav1.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
> index b4112004ad..2c4ddd4641 100644
> --- a/libavcodec/libsvtav1.c
> +++ b/libavcodec/libsvtav1.c
> @@ -297,7 +297,8 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param,
>           param->profile = FF_PROFILE_AV1_HIGH;
>       }
>   
> -    avctx->bit_rate                 = param->target_bit_rate;
> +    avctx->bit_rate = param->rate_control_mode > 0 ?
> +                      param->target_bit_rate : 0;
>   
>       return 0;
>   }

Set LGTM.
Jan Ekström May 9, 2022, 8:10 p.m. UTC | #2
On Mon, May 9, 2022 at 10:07 PM James Almer <jamrial@gmail.com> wrote:
>
> On 5/9/2022 3:47 PM, Jan Ekström wrote:
> > This way we can filter out the default value for this member, which
> > is nonzero. Bases on the current affairs that bit rate based rate
> > control is nonzero in SVT-AV1.
> > ---
> >   libavcodec/libsvtav1.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
> > index b4112004ad..2c4ddd4641 100644
> > --- a/libavcodec/libsvtav1.c
> > +++ b/libavcodec/libsvtav1.c
> > @@ -297,7 +297,8 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param,
> >           param->profile = FF_PROFILE_AV1_HIGH;
> >       }
> >
> > -    avctx->bit_rate                 = param->target_bit_rate;
> > +    avctx->bit_rate = param->rate_control_mode > 0 ?
> > +                      param->target_bit_rate : 0;
> >
> >       return 0;
> >   }
>
> Set LGTM.

Thanks, applied set as
70887d44ffa31b95704b85531fc53ddd4d9aab14
fe100bc556d7b25d301ed65f7ae7a74880770f09

Jan
diff mbox series

Patch

diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
index b4112004ad..2c4ddd4641 100644
--- a/libavcodec/libsvtav1.c
+++ b/libavcodec/libsvtav1.c
@@ -297,7 +297,8 @@  static int config_enc_params(EbSvtAv1EncConfiguration *param,
         param->profile = FF_PROFILE_AV1_HIGH;
     }
 
-    avctx->bit_rate                 = param->target_bit_rate;
+    avctx->bit_rate = param->rate_control_mode > 0 ?
+                      param->target_bit_rate : 0;
 
     return 0;
 }