[FFmpeg-devel] [PATCH] lavc/libxavs2: remove invalid parameters

Mark Thompson sw at jkqxz.net
Tue Sep 18 01:27:34 EEST 2018


On 12/09/18 08:54, hwren wrote:
> Signed-off-by: hwren <hwrenx at 126.com>
> ---
>  doc/encoders.texi     | 3 ---
>  libavcodec/libxavs2.c | 4 ----
>  2 files changed, 7 deletions(-)
> 
> diff --git a/doc/encoders.texi b/doc/encoders.texi
> index 4623f38..0696a7a 100644
> --- a/doc/encoders.texi
> +++ b/doc/encoders.texi
> @@ -2761,9 +2761,6 @@ Set the Speed level from 0 to 9 (default 0). Higher is better but slower.
>  Set the log level from -1 to 3 (default 0). -1: none, 0: error,
>  1: warning, 2: info, 3: debug.
>  
> - at item hierarchical_ref
> -Set the hierarchical reference or not (default true).
> -
>  @item xavs2-params
>  Set xavs2 options using a list of @var{key}=@var{value} couples separated
>  by ":".
> diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c
> index e26c90a..2b47d0c 100644
> --- a/libavcodec/libxavs2.c
> +++ b/libavcodec/libxavs2.c
> @@ -78,8 +78,6 @@ static av_cold int xavs2_init(AVCodecContext *avctx)
>          return AVERROR(ENOMEM);
>      }
>  
> -    xavs2_opt_set2("rec",   "%d", 0);
> -
>      xavs2_opt_set2("width",     "%d", avctx->width);
>      xavs2_opt_set2("height",    "%d", avctx->height);
>      xavs2_opt_set2("bframes",   "%d", avctx->max_b_frames);
> @@ -92,7 +90,6 @@ static av_cold int xavs2_init(AVCodecContext *avctx)
>  
>      xavs2_opt_set2("thread_frames",     "%d", avctx->thread_count);
>      xavs2_opt_set2("thread_rows",       "%d", cae->lcu_row_threads);
> -    xavs2_opt_set2("hierarchical_ref",  "%d", cae->hierarchical_reference);
>  
>      xavs2_opt_set2("OpenGOP",  "%d", 1);
>  
> @@ -261,7 +258,6 @@ static const AVOption options[] = {
>      { "min_qp"          ,   "min qp for rate control" ,                 OFFSET(min_qp)          , AV_OPT_TYPE_INT, {.i64 = 20 },  0,      63,  VE },
>      { "speed_level"     ,   "Speed level, higher is better but slower", OFFSET(preset_level)    , AV_OPT_TYPE_INT, {.i64 =  0 },  0,       9,  VE },
>      { "log_level"       ,   "log level: -1: none, 0: error, 1: warning, 2: info, 3: debug", OFFSET(log_level)    , AV_OPT_TYPE_INT, {.i64 =  0 },  -1,       3,  VE },
> -    { "hierarchical_ref",   "hierarchical reference" ,                  OFFSET(hierarchical_reference)    , AV_OPT_TYPE_BOOL,    {.i64 =  1 }, 0, 1,  VE },
>      { "xavs2-params"    ,   "set the xavs2 configuration using a :-separated list of key=value parameters", OFFSET(xavs2_opts), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
>      { NULL },
>  };
> 

Applied.

>From my testing, it seems that hierarchical references are always use - I guess there is no reason to want to switch them off in a modern codec if the encoder wants to use them?

I suggest that on the libxavs2 side it might be a good idea to make the parameter-set function return an error code, or at least log some warning, so that this sort of problem is more easily detected.

Thanks,

- Mark


More information about the ffmpeg-devel mailing list