[FFmpeg-devel] [PATCH v1] avcodec/libvpxenc: add a way to set VP9E_SET_SVC_REF_FRAME_CONFIG.

James Zern jzern at google.com
Wed Nov 25 21:09:43 EET 2020


On Mon, Nov 23, 2020 at 2:49 PM Wonkap Jang
<wonkap-at-google.com at ffmpeg.org> wrote:
>
> Hi James,
>
> On Wed, Nov 18, 2020 at 1:13 PM James Zern <jzern-at-google.com at ffmpeg.org>
> wrote:
>
> > Hi,
> >
> > On Mon, Nov 16, 2020 at 2:36 PM Wonkap Jang
> > <wonkap-at-google.com at ffmpeg.org> wrote:
> > >
> > > In order to fine-control referencing schemes in VP9 encoding, there
> > > is a need to use VP9E_SET_SVC_REF_FRAME_CONFIG method. This commit
> > > provides a way to use the API through frame metadata.
> > > ---
> > >  libavcodec/libvpxenc.c | 77 ++++++++++++++++++++++++++++++++++++++++++
> >
> > The documentation could use an update too. Maybe some of the earlier
> > per-frame metadata was missed.
> >
> > >  1 file changed, 77 insertions(+)
> > >
> > > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> > > index a7c76eb835..dbe399bf72 100644
> > > --- a/libavcodec/libvpxenc.c
> > > +++ b/libavcodec/libvpxenc.c
> > > @@ -125,6 +125,11 @@ typedef struct VPxEncoderContext {
> > >       * encounter a frame with ROI side data.
> > >       */
> > >      int roi_warned;
> > > +
> > > +#if (VPX_ENCODER_ABI_VERSION >= 12) && CONFIG_LIBVPX_VP9_ENCODER
> > > +    vpx_svc_ref_frame_config_t ref_frame_config;
> > > +    AVDictionary *vpx_ref_frame_config;
> > > +#endif
> > >  } VPxContext;
> > >
> > >  /** String mappings for enum vp8e_enc_control_id */
> > > @@ -152,6 +157,7 @@ static const char *const ctlidstr[] = {
> > >      [VP9E_SET_SVC_LAYER_ID]            = "VP9E_SET_SVC_LAYER_ID",
> > >  #if VPX_ENCODER_ABI_VERSION >= 12
> >
> > This check isn't sufficient since the vpx_svc_ref_frame_config_t
> > struct was changed a few times after this point.
> >
> > >      [VP9E_SET_SVC_PARAMETERS]          = "VP9E_SET_SVC_PARAMETERS",
> > > +    [VP9E_SET_SVC_REF_FRAME_CONFIG]    =
> > "VP9E_SET_SVC_REF_FRAME_CONFIG",
> > >  #endif
> > >      [VP9E_SET_SVC]                     = "VP9E_SET_SVC",
> > >  #if VPX_ENCODER_ABI_VERSION >= 11
> > > @@ -394,6 +400,18 @@ static void vp8_ts_parse_int_array(int *dest, char
> > *value, size_t value_len, int
> > >      }
> > >  }
> > >
> > > +static void vp8_ts_parse_int64_array(int64_t *dest, char *value, size_t
> > value_len, int max_entries)
> > > +{
> > > +    int dest_idx = 0;
> > > +    char *saveptr = NULL;
> > > +    char *token = av_strtok(value, ",", &saveptr);
> > > +
> > > +    while (token && dest_idx < max_entries) {
> > > +        dest[dest_idx++] = strtoul(token, NULL, 10);
> >
> > int64 seems like it was overkill in the api, but you probably want
> > strtoull here.
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>
>
> I tried to figure out the right version number, but it seems that the
> version number was not bumped when the change was made.
> I tried to find a new #define that I could use, but cannot seem to find
> one. Is there one that you could suggest I use? Or perhaps a way to find
> one?
> Need help.
>

>From the blame log it looks like v1.7.0-936-g04b3d49ba was the last
meaningful edit, so you can use the version from v1.8.0; it doesn't
have to be perfect.


More information about the ffmpeg-devel mailing list