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

James Zern jzern at google.com
Fri Jan 8 22:47:06 EET 2021


On Thu, Jan 7, 2021 at 11:56 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.
> ---
>  doc/encoders.texi      | 32 +++++++++++++++
>  libavcodec/libvpxenc.c | 88 ++++++++++++++++++++++++++++++++++++++++++
>  libavcodec/version.h   |  2 +-
>  3 files changed, 121 insertions(+), 1 deletion(-)
>
> [...]
> +#if CONFIG_LIBVPX_VP9_ENCODER && defined(VPX_CTRL_VP9E_SET_MAX_INTER_BITRATE_PCT)
> +            en = av_dict_get(frame->metadata, "ref-frame-config", NULL, 0);
> +
> +            if (en) {
> +                if (avctx->codec_id == AV_CODEC_ID_VP9) {
> +                    AVDictionaryEntry* en2 = NULL;
> +                    av_dict_parse_string(&ctx->vpx_ref_frame_config, en->value, "=", ":", 0);
> +
> +                    while ((en2 = av_dict_get(ctx->vpx_ref_frame_config, "", en2, AV_DICT_IGNORE_SUFFIX))) {
> +                        if (vpx_ref_frame_config_parse(ctx, enccfg, en2->key, en2->value, avctx->codec_id) < 0)
> +                            av_log(avctx, AV_LOG_WARNING,
> +                                   "Error parsing option '%s = %s'.\n",
> +                                   en2->key, en2->value);
> +                    }
> +
> +                    codecctl_intp(avctx, VP9E_SET_SVC_REF_FRAME_CONFIG, (int *)&ctx->ref_frame_config);
> +                    av_log(avctx, AV_LOG_WARNING,
> +                               "Error parsing option '%s = %s'.\n",
> +                               en2->key, en2->value);

I think this should be removed, no? There's trailing whitespace here
too, git diff --check or tools/patcheck can catch this.


More information about the ffmpeg-devel mailing list