Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avcodec/libvpxenc: enable dynamic max quantizer parameter reconfiguration
@ 2022-03-16 12:07 Danil Chapovalov
  2022-03-16 12:39 ` Lynne
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Danil Chapovalov @ 2022-03-16 12:07 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Danil Chapovalov

---
 libavcodec/libvpxenc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 8f94ba15dc..45baeed435 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -1658,6 +1658,13 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt,
                 flags |= strtoul(en->value, NULL, 10);
             }
 
+            en = av_dict_get(frame->metadata, "max-quantizer", NULL, 0);
+            if (en) {
+                struct vpx_codec_enc_cfg cfg = *enccfg;
+                cfg.rc_max_quantizer = strtoul(en->value, NULL, 10);
+                vpx_codec_enc_config_set(&ctx->encoder, &cfg);
+            }
+
             memset(&layer_id, 0, sizeof(layer_id));
 
             en = av_dict_get(frame->metadata, "temporal_id", NULL, 0);
-- 
2.35.1.723.g4982287a31-goog

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: enable dynamic max quantizer parameter reconfiguration
  2022-03-16 12:07 [FFmpeg-devel] [PATCH] avcodec/libvpxenc: enable dynamic max quantizer parameter reconfiguration Danil Chapovalov
@ 2022-03-16 12:39 ` Lynne
  2022-03-16 23:53   ` James Zern
  2022-03-17 19:07 ` Danil Chapovalov
  2022-03-24 13:11 ` Danil Chapovalov
  2 siblings, 1 reply; 12+ messages in thread
From: Lynne @ 2022-03-16 12:39 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

16 Mar 2022, 13:07 by danilchap-at-google.com@ffmpeg.org:

> ---
>  libavcodec/libvpxenc.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index 8f94ba15dc..45baeed435 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -1658,6 +1658,13 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt,
>  flags |= strtoul(en->value, NULL, 10);
>  }
>  
> +            en = av_dict_get(frame->metadata, "max-quantizer", NULL, 0);
> +            if (en) {
> +                struct vpx_codec_enc_cfg cfg = *enccfg;
> +                cfg.rc_max_quantizer = strtoul(en->value, NULL, 10);
> +                vpx_codec_enc_config_set(&ctx->encoder, &cfg);
> +            }
>

I was going to NAK the earlier patch, but forgot.
Please think of a better way than stuffing random data in
inappropriate fields, and fix the earlier patch that was mistakenly
merged to not do that.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: enable dynamic max quantizer parameter reconfiguration
  2022-03-16 12:39 ` Lynne
@ 2022-03-16 23:53   ` James Zern
  2022-03-17 18:45     ` Jan Ekström
  0 siblings, 1 reply; 12+ messages in thread
From: James Zern @ 2022-03-16 23:53 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Lynne,


On Wed, Mar 16, 2022 at 5:39 AM Lynne <dev@lynne.ee> wrote:
>
> 16 Mar 2022, 13:07 by danilchap-at-google.com@ffmpeg.org:
>
> > ---
> >  libavcodec/libvpxenc.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> > index 8f94ba15dc..45baeed435 100644
> > --- a/libavcodec/libvpxenc.c
> > +++ b/libavcodec/libvpxenc.c
> > @@ -1658,6 +1658,13 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt,
> >  flags |= strtoul(en->value, NULL, 10);
> >  }
> >
> > +            en = av_dict_get(frame->metadata, "max-quantizer", NULL, 0);
> > +            if (en) {
> > +                struct vpx_codec_enc_cfg cfg = *enccfg;
> > +                cfg.rc_max_quantizer = strtoul(en->value, NULL, 10);
> > +                vpx_codec_enc_config_set(&ctx->encoder, &cfg);
> > +            }
> >
>
> I was going to NAK the earlier patch, but forgot.
> Please think of a better way than stuffing random data in
> inappropriate fields, and fix the earlier patch that was mistakenly
> merged to not do that.

I agree this isn't great. Would you suggest updating the qmax setting
and checking it / all options on a per-frame basis or is there a
better way to reconfigure the codec on the fly?
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: enable dynamic max quantizer parameter reconfiguration
  2022-03-16 23:53   ` James Zern
@ 2022-03-17 18:45     ` Jan Ekström
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Ekström @ 2022-03-17 18:45 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Thu, Mar 17, 2022 at 1:53 AM James Zern
<jzern-at-google.com@ffmpeg.org> wrote:
>
> Lynne,
>
>
> On Wed, Mar 16, 2022 at 5:39 AM Lynne <dev@lynne.ee> wrote:
> >
> > 16 Mar 2022, 13:07 by danilchap-at-google.com@ffmpeg.org:
> >
> > > ---
> > >  libavcodec/libvpxenc.c | 7 +++++++
> > >  1 file changed, 7 insertions(+)
> > >
> > > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> > > index 8f94ba15dc..45baeed435 100644
> > > --- a/libavcodec/libvpxenc.c
> > > +++ b/libavcodec/libvpxenc.c
> > > @@ -1658,6 +1658,13 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt,
> > >  flags |= strtoul(en->value, NULL, 10);
> > >  }
> > >
> > > +            en = av_dict_get(frame->metadata, "max-quantizer", NULL, 0);
> > > +            if (en) {
> > > +                struct vpx_codec_enc_cfg cfg = *enccfg;
> > > +                cfg.rc_max_quantizer = strtoul(en->value, NULL, 10);
> > > +                vpx_codec_enc_config_set(&ctx->encoder, &cfg);
> > > +            }
> > >
> >
> > I was going to NAK the earlier patch, but forgot.
> > Please think of a better way than stuffing random data in
> > inappropriate fields, and fix the earlier patch that was mistakenly
> > merged to not do that.
>
> I agree this isn't great. Would you suggest updating the qmax setting
> and checking it / all options on a per-frame basis or is there a
> better way to reconfigure the codec on the fly?

The libx264 wrapper is probably one of the oldest that supports
runtime reconfiguration. Looking at how it does it right now, it seems
to call its reconfig_encoder function for each fed non-nullptr
AVFrame. So yes, re-reading configuration from the context seems like
a viable alternative.

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".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [FFmpeg-devel] [PATCH] avcodec/libvpxenc: enable dynamic max quantizer parameter reconfiguration
  2022-03-16 12:07 [FFmpeg-devel] [PATCH] avcodec/libvpxenc: enable dynamic max quantizer parameter reconfiguration Danil Chapovalov
  2022-03-16 12:39 ` Lynne
@ 2022-03-17 19:07 ` Danil Chapovalov
  2022-03-24 13:11 ` Danil Chapovalov
  2 siblings, 0 replies; 12+ messages in thread
From: Danil Chapovalov @ 2022-03-17 19:07 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Danil Chapovalov

---
 libavcodec/libvpxenc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 8f94ba15dc..4735e57620 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -44,6 +44,7 @@
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
+#include "libavutil/video_enc_params.h"
 
 /**
  * Portion of struct vpx_codec_cx_pkt from vpx_encoder.h.
@@ -1698,6 +1699,14 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt,
             }
         }
 
+        sd = av_frame_get_side_data(frame, AV_FRAME_DATA_VIDEO_ENC_PARAMS);
+        if (sd) {
+            const AVVideoEncParams* enc_params = sd->data;
+            struct vpx_codec_enc_cfg cfg = *enccfg;
+            cfg.rc_max_quantizer = enc_params->qp;
+            vpx_codec_enc_config_set(&ctx->encoder, &cfg);
+        }
+
         if (ctx->hdr10_plus_fifo) {
             AVFrameSideData *hdr10_plus_metadata;
             // Add HDR10+ metadata to queue.
-- 
2.35.1.894.gb6a874cedc-goog

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [FFmpeg-devel] [PATCH] avcodec/libvpxenc: enable dynamic max quantizer parameter reconfiguration
  2022-03-16 12:07 [FFmpeg-devel] [PATCH] avcodec/libvpxenc: enable dynamic max quantizer parameter reconfiguration Danil Chapovalov
  2022-03-16 12:39 ` Lynne
  2022-03-17 19:07 ` Danil Chapovalov
@ 2022-03-24 13:11 ` Danil Chapovalov
  2022-03-24 18:27   ` James Zern
  2022-03-30 18:24   ` Danil Chapovalov
  2 siblings, 2 replies; 12+ messages in thread
From: Danil Chapovalov @ 2022-03-24 13:11 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Danil Chapovalov

---
 libavcodec/libvpxenc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index dff1d06b0e..463a658bb0 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -1625,6 +1625,12 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt,
     vpx_svc_layer_id_t layer_id;
     int layer_id_valid = 0;
 
+    if (avctx->qmax >= 0 && enccfg->rc_max_quantizer != avctx->qmax) {
+        struct vpx_codec_enc_cfg cfg = *enccfg;
+        cfg.rc_max_quantizer = avctx->qmax;
+        vpx_codec_enc_config_set(&ctx->encoder, &cfg);
+    }
+
     if (frame) {
         const AVFrameSideData *sd = av_frame_get_side_data(frame, AV_FRAME_DATA_REGIONS_OF_INTEREST);
         rawimg                      = &ctx->rawimg;
-- 
2.35.1.894.gb6a874cedc-goog

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: enable dynamic max quantizer parameter reconfiguration
  2022-03-24 13:11 ` Danil Chapovalov
@ 2022-03-24 18:27   ` James Zern
  2022-03-28 14:04     ` Danil Chapovalov
  2022-03-30 18:24   ` Danil Chapovalov
  1 sibling, 1 reply; 12+ messages in thread
From: James Zern @ 2022-03-24 18:27 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Danil Chapovalov

On Thu, Mar 24, 2022 at 6:12 AM Danil Chapovalov
<danilchap-at-google.com@ffmpeg.org> wrote:
>
> ---
>  libavcodec/libvpxenc.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index dff1d06b0e..463a658bb0 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -1625,6 +1625,12 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt,
>      vpx_svc_layer_id_t layer_id;
>      int layer_id_valid = 0;
>
> +    if (avctx->qmax >= 0 && enccfg->rc_max_quantizer != avctx->qmax) {
> +        struct vpx_codec_enc_cfg cfg = *enccfg;
> +        cfg.rc_max_quantizer = avctx->qmax;
> +        vpx_codec_enc_config_set(&ctx->encoder, &cfg);
> +    }
> +

Jan, I think this was what you were suggesting, no?
The docs could be updated to note qmax can be changed per-frame
[1][2]. Saying that, it does seem a bit unbalanced to only do qmax
here.

[1] https://ffmpeg.org/ffmpeg-codecs.html#libvpx
[2] https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/doc/encoders.texi#l2000
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: enable dynamic max quantizer parameter reconfiguration
  2022-03-24 18:27   ` James Zern
@ 2022-03-28 14:04     ` Danil Chapovalov
  2022-03-29 20:58       ` James Zern
  0 siblings, 1 reply; 12+ messages in thread
From: Danil Chapovalov @ 2022-03-28 14:04 UTC (permalink / raw)
  To: James Zern; +Cc: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 1769 bytes --]

On Thu, Mar 24, 2022 at 7:27 PM James Zern <jzern@google.com> wrote:
>
> On Thu, Mar 24, 2022 at 6:12 AM Danil Chapovalov
> <danilchap-at-google.com@ffmpeg.org> wrote:
> >
> > ---
> >  libavcodec/libvpxenc.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> > index dff1d06b0e..463a658bb0 100644
> > --- a/libavcodec/libvpxenc.c
> > +++ b/libavcodec/libvpxenc.c
> > @@ -1625,6 +1625,12 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt,
> >      vpx_svc_layer_id_t layer_id;
> >      int layer_id_valid = 0;
> >
> > +    if (avctx->qmax >= 0 && enccfg->rc_max_quantizer != avctx->qmax) {
> > +        struct vpx_codec_enc_cfg cfg = *enccfg;
> > +        cfg.rc_max_quantizer = avctx->qmax;
> > +        vpx_codec_enc_config_set(&ctx->encoder, &cfg);
> > +    }
> > +
>
> Jan, I think this was what you were suggesting, no?
> The docs could be updated to note qmax can be changed per-frame
> [1][2]. Saying that, it does seem a bit unbalanced to only do qmax
> here.
>
> [1] https://ffmpeg.org/ffmpeg-codecs.html#libvpx
> [2] https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/doc/encoders.texi#l2000

As I understand, docs describe command line options.
I do not plan to expose changing qmax per frame as a command line
option, I do not see how that can be reasonably done. My intent is to
change max qp when ffmpeg is used as a library.

I agree it looks unbalanced to change just the qmax, but that is the
only parameter I currently need for my usecase. Personally I prefer to
only add features that are planned to be used.
Are there any particular configuration settings you want me to make
configurable,
or do you think it is better to support all settings that can be configurable?

[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4002 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: enable dynamic max quantizer parameter reconfiguration
  2022-03-28 14:04     ` Danil Chapovalov
@ 2022-03-29 20:58       ` James Zern
  0 siblings, 0 replies; 12+ messages in thread
From: James Zern @ 2022-03-29 20:58 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Mon, Mar 28, 2022 at 7:05 AM Danil Chapovalov <danilchap@google.com> wrote:
>
> On Thu, Mar 24, 2022 at 7:27 PM James Zern <jzern@google.com> wrote:
> >
> > On Thu, Mar 24, 2022 at 6:12 AM Danil Chapovalov
> > <danilchap-at-google.com@ffmpeg.org> wrote:
> > >
> > > ---
> > >  libavcodec/libvpxenc.c | 6 ++++++
> > >  1 file changed, 6 insertions(+)
> > >
> > > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> > > index dff1d06b0e..463a658bb0 100644
> > > --- a/libavcodec/libvpxenc.c
> > > +++ b/libavcodec/libvpxenc.c
> > > @@ -1625,6 +1625,12 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt,
> > >      vpx_svc_layer_id_t layer_id;
> > >      int layer_id_valid = 0;
> > >
> > > +    if (avctx->qmax >= 0 && enccfg->rc_max_quantizer != avctx->qmax) {
> > > +        struct vpx_codec_enc_cfg cfg = *enccfg;
> > > +        cfg.rc_max_quantizer = avctx->qmax;
> > > +        vpx_codec_enc_config_set(&ctx->encoder, &cfg);
> > > +    }
> > > +
> >
> > Jan, I think this was what you were suggesting, no?
> > The docs could be updated to note qmax can be changed per-frame
> > [1][2]. Saying that, it does seem a bit unbalanced to only do qmax
> > here.
> >
> > [1] https://ffmpeg.org/ffmpeg-codecs.html#libvpx
> > [2] https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/doc/encoders.texi#l2000
>
> As I understand, docs describe command line options.
> I do not plan to expose changing qmax per frame as a command line
> option, I do not see how that can be reasonably done. My intent is to
> change max qp when ffmpeg is used as a library.
>

That is true, I was thinking about it from the library perspective.
libx264 doesn't mention this behavior but the codec options section
does talk about setting these from the API, so I think a note is
worthwhile as this is the only point of documentation for the codec
wrapper.

> I agree it looks unbalanced to change just the qmax, but that is the
> only parameter I currently need for my usecase. Personally I prefer to
> only add features that are planned to be used.
> Are there any particular configuration settings you want me to make
> configurable,
> or do you think it is better to support all settings that can be configurable?

Since libvpx supports a reconfigure it should be safe to check the
options again. There is some complexity in that, though, so we can
leave this as a targeted approach similar to libx264 for now unless
others have a strong opinion.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [FFmpeg-devel] [PATCH] avcodec/libvpxenc: enable dynamic max quantizer parameter reconfiguration
  2022-03-24 13:11 ` Danil Chapovalov
  2022-03-24 18:27   ` James Zern
@ 2022-03-30 18:24   ` Danil Chapovalov
  2022-03-31 17:31     ` James Zern
  1 sibling, 1 reply; 12+ messages in thread
From: Danil Chapovalov @ 2022-03-30 18:24 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Danil Chapovalov

---
 doc/encoders.texi      | 3 +++
 libavcodec/libvpxenc.c | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 4b8cc69c0d..a304f865a6 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -1996,8 +1996,11 @@ kilobits/s.
 @item keyint_min (@emph{kf-min-dist})
 
 @item qmin (@emph{min-q})
+Minimum (Best Quality) Quantizer.
 
 @item qmax (@emph{max-q})
+Maximum (Worst Quality) Quantizer.
+Can be changed per-frame.
 
 @item bufsize (@emph{buf-sz}, @emph{buf-optimal-sz})
 Set ratecontrol buffer size (in bits). Note @command{vpxenc}'s options are
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index dff1d06b0e..463a658bb0 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -1625,6 +1625,12 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt,
     vpx_svc_layer_id_t layer_id;
     int layer_id_valid = 0;
 
+    if (avctx->qmax >= 0 && enccfg->rc_max_quantizer != avctx->qmax) {
+        struct vpx_codec_enc_cfg cfg = *enccfg;
+        cfg.rc_max_quantizer = avctx->qmax;
+        vpx_codec_enc_config_set(&ctx->encoder, &cfg);
+    }
+
     if (frame) {
         const AVFrameSideData *sd = av_frame_get_side_data(frame, AV_FRAME_DATA_REGIONS_OF_INTEREST);
         rawimg                      = &ctx->rawimg;
-- 
2.35.1.1021.g381101b075-goog

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: enable dynamic max quantizer parameter reconfiguration
  2022-03-30 18:24   ` Danil Chapovalov
@ 2022-03-31 17:31     ` James Zern
  2022-04-06  1:04       ` James Zern
  0 siblings, 1 reply; 12+ messages in thread
From: James Zern @ 2022-03-31 17:31 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Danil Chapovalov

On Wed, Mar 30, 2022 at 11:25 AM Danil Chapovalov
<danilchap-at-google.com@ffmpeg.org> wrote:
>
> ---
>  doc/encoders.texi      | 3 +++
>  libavcodec/libvpxenc.c | 6 ++++++
>  2 files changed, 9 insertions(+)
>

lgtm. I'll submit this with a patch version bump soon if there aren't
any further comments.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: enable dynamic max quantizer parameter reconfiguration
  2022-03-31 17:31     ` James Zern
@ 2022-04-06  1:04       ` James Zern
  0 siblings, 0 replies; 12+ messages in thread
From: James Zern @ 2022-04-06  1:04 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Danil Chapovalov

On Thu, Mar 31, 2022 at 10:31 AM James Zern <jzern@google.com> wrote:
>
> On Wed, Mar 30, 2022 at 11:25 AM Danil Chapovalov
> <danilchap-at-google.com@ffmpeg.org> wrote:
> >
> > ---
> >  doc/encoders.texi      | 3 +++
> >  libavcodec/libvpxenc.c | 6 ++++++
> >  2 files changed, 9 insertions(+)
> >
>
> lgtm. I'll submit this with a patch version bump soon if there aren't
> any further comments.

Applied with some additional error checking. Thanks for the patch.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-04-06  1:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16 12:07 [FFmpeg-devel] [PATCH] avcodec/libvpxenc: enable dynamic max quantizer parameter reconfiguration Danil Chapovalov
2022-03-16 12:39 ` Lynne
2022-03-16 23:53   ` James Zern
2022-03-17 18:45     ` Jan Ekström
2022-03-17 19:07 ` Danil Chapovalov
2022-03-24 13:11 ` Danil Chapovalov
2022-03-24 18:27   ` James Zern
2022-03-28 14:04     ` Danil Chapovalov
2022-03-29 20:58       ` James Zern
2022-03-30 18:24   ` Danil Chapovalov
2022-03-31 17:31     ` James Zern
2022-04-06  1:04       ` James Zern

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