[FFmpeg-devel] [PATCH v5] avcodec/libvpxenc: optimize parsing vpx_svc_ref_frame_config

James Zern jzern at google.com
Fri Feb 19 23:56:22 EET 2021


On Thu, Feb 18, 2021 at 1:17 PM James Zern <jzern at google.com> wrote:
>
> On Thu, Feb 18, 2021 at 11:01 AM Wonkap Jang
> <wonkap-at-google.com at ffmpeg.org> wrote:
> >
> > Getting rid of unnecessary use of AVDictionary object in parsing
> > vpx_svc_ref_frame_config.
> > ---
> >  libavcodec/libvpxenc.c | 73 +++++++++++++++++++++++++++++++-----------
> >  1 file changed, 55 insertions(+), 18 deletions(-)
> >
>
> lgtm, just a couple of cosmetics I addressed locally. I'll submit this
> soon. Thanks for the suggestions Nicolas.
>

applied, thanks.

> > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> > index 284cb9a108..dfa0763fff 100644
> > --- a/libavcodec/libvpxenc.c
> > +++ b/libavcodec/libvpxenc.c
> > @@ -42,6 +42,7 @@
> >  #include "libavutil/mathematics.h"
> >  #include "libavutil/opt.h"
> >  #include "libavutil/pixdesc.h"
> > +#include "libavutil/avstring.h"
> >
>
> This is already included, in general the includes can be sorted.
> Deleted locally.
>
> > [...]
> > -                            av_log(avctx, AV_LOG_WARNING,
> > -                                   "Error parsing option '%s = %s'.\n",
> > -                                   en2->key, en2->value);
> > +                    int ret;
> > +                    ret = vpx_parse_ref_frame_config(&ctx->ref_frame_config,
> > +                                                   enccfg->ss_number_layers, en->value);
>
> I joined these two lines locally.
>
> > +                    if (ret < 0) {
> > +                        av_log(avctx, AV_LOG_WARNING,
> > +                               "Error parsing ref_frame_config option %s.\n", en->value);
> > +                        return ret;
> >                      }
> >
> >                      codecctl_intp(avctx, VP9E_SET_SVC_REF_FRAME_CONFIG, (int *)&ctx->ref_frame_config);
> >                  } else {
> >                      av_log(avctx, AV_LOG_WARNING,
> > -                           "Error using option ref-frame-config for a non-VP9 codec\n");
> > +                           "Using option ref-frame-config for a non-VP9 codec\n");
>
> I changed 'Using' to 'Ignoring' locally.


More information about the ffmpeg-devel mailing list