[FFmpeg-devel] [PATCH 2/5] avcodec/libsvtav1: make intra_refresh_type configurable

Jan Ekström jeebjp at gmail.com
Fri Sep 17 01:38:46 EEST 2021


Hi

On Thu, Sep 16, 2021 at 1:54 PM <lance.lmwang at gmail.com> wrote:
>
> From: Limin Wang <lance.lmwang at gmail.com>
>
> Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> ---

I think something like:

avcodec/libsvtav1: make coded GOP type configurable

Might be a bit better as a commit message?
>  libavcodec/libsvtav1.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
> index 82ae2b9..8c2c970 100644
> --- a/libavcodec/libsvtav1.c
> +++ b/libavcodec/libsvtav1.c
> @@ -210,7 +210,8 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param,
>          param->min_qp_allowed       = avctx->qmin;
>      }
>
> -    param->intra_refresh_type       = 2; /* Real keyframes only */
> +    /* 2 = IDR, closed GOP, 1 = CRA, open GOP */
> +    param->intra_refresh_type = avctx->flags & AV_CODEC_FLAG_CLOSED_GOP ? 2 : 1;
>

Ugh... I see they have EbIntraRefreshType for an enum (NO_REFRESH |
CRA_REFRESH | IDR_REFRESH), but I guess those are not available
through the public API?

>      if (svt_enc->la_depth >= 0)
>          param->look_ahead_distance  = svt_enc->la_depth;
> @@ -548,6 +549,7 @@ static const AVCodecDefault eb_enc_defaults[] = {
>      { "g",         "-1"    },
>      { "qmin",      "0"     },
>      { "qmax",      "63"    },
> +    { "flags",     "+cgop" },

Let's keep the alphabetic ordering since this module is not yet a mess
in that sense :) Thus this would go after "b" .

Otherwise LGTM.

Jan


More information about the ffmpeg-devel mailing list