diff mbox series

[FFmpeg-devel,1/2] lavc/snowenc: Expose an option to set the rc_eq expression

Message ID 973bce64ee2a1c5a0951604c3ba0d772caf7c05d.1596835157.git.eclipse7@gmx.net
State Accepted
Commit b40dd2fdabaa1ffb24ccf6486dc8a96e84b72c40
Headers show
Series [FFmpeg-devel,1/2] lavc/snowenc: Expose an option to set the rc_eq expression
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Alexander Strasser Aug. 7, 2020, 9:26 p.m. UTC
Snow uses the ratecontrol module, but does not expose a way to set
the rc_eq expression. The default expression, set in the ratecontrol
module, will always be used.

Make it possible to set rc_eq by adding an AVOption to snowenc.

The option definition is mostly a copy from the mpegvideo common
options definition of rc_eq (libavcodec/mpegvideo.h), with some
minor style adjustments to be closer to the other snowenc option
initializer expressions.

Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
---
 libavcodec/snowenc.c | 5 +++++
 1 file changed, 5 insertions(+)

--

Comments

Michael Niedermayer Aug. 9, 2020, 12:54 p.m. UTC | #1
On Fri, Aug 07, 2020 at 11:26:17PM +0200, Alexander Strasser wrote:
> Snow uses the ratecontrol module, but does not expose a way to set
> the rc_eq expression. The default expression, set in the ratecontrol
> module, will always be used.
> 
> Make it possible to set rc_eq by adding an AVOption to snowenc.
> 
> The option definition is mostly a copy from the mpegvideo common
> options definition of rc_eq (libavcodec/mpegvideo.h), with some
> minor style adjustments to be closer to the other snowenc option
> initializer expressions.
> 
> Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
> ---
>  libavcodec/snowenc.c | 5 +++++
>  1 file changed, 5 insertions(+)

should be ok

thx

[...]
Alexander Strasser Aug. 12, 2020, 3:43 p.m. UTC | #2
On 2020-08-09 14:54 +0200, Michael Niedermayer wrote:
> On Fri, Aug 07, 2020 at 11:26:17PM +0200, Alexander Strasser wrote:
> > Snow uses the ratecontrol module, but does not expose a way to set
> > the rc_eq expression. The default expression, set in the ratecontrol
> > module, will always be used.
> >
> > Make it possible to set rc_eq by adding an AVOption to snowenc.
> >
> > The option definition is mostly a copy from the mpegvideo common
> > options definition of rc_eq (libavcodec/mpegvideo.h), with some
> > minor style adjustments to be closer to the other snowenc option
> > initializer expressions.
> >
> > Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
> > ---
> >  libavcodec/snowenc.c | 5 +++++
> >  1 file changed, 5 insertions(+)
>
> should be ok

Pushed.

Thank you,
  Alexander
diff mbox series

Patch

diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index b1cf1426ee..16d2b7c302 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -1948,6 +1948,11 @@  static const AVOption options[] = {
     { "pred",           "Spatial decomposition type",                                OFFSET(pred), AV_OPT_TYPE_INT, { .i64 = 0 }, DWT_97, DWT_53, VE, "pred" },
         { "dwt97", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "pred" },
         { "dwt53", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "pred" },
+    { "rc_eq", "Set rate control equation. When computing the expression, besides the standard functions "
+     "defined in the section 'Expression Evaluation', the following functions are available: "
+     "bits2qp(bits), qp2bits(qp). Also the following constants are available: iTex pTex tex mv "
+     "fCode iCount mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex avgTex.",
+                                                                                  OFFSET(m.rc_eq), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, VE },
     { NULL },
 };