[FFmpeg-devel] [PATCH] avfilter: add scale2ref_npp video filter

Roman Arzumanyan rarzumanyan at nvidia.com
Mon Oct 4 12:25:50 EEST 2021

Thanks for the review Andreas, that's indeed helpful.

Allow me some time, I'll come back bit later with revised patch.
От: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> от имени Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
Отправлено: 4 октября 2021 г. 11:59
Кому: ffmpeg-devel at ffmpeg.org <ffmpeg-devel at ffmpeg.org>
Тема: Re: [FFmpeg-devel] [PATCH] avfilter: add scale2ref_npp video filter

External email: Use caution opening links or attachments

Roman Arzumanyan:
> Thanks for the review, Timo.
> Please find revised patch attached.
> Docstring was added, trailing spaces removed, commit message brushed up. Avfilter minor version bump added.

This has lots of duplication with the ordinary scale filter: var_names,
enum var_name and enum eval_mode are identical; check_exprs and
scale_pars_expr are basically the same. You are even copying bugs from
the original scale filter: Its handling of the AVDictionary is buggy,
because it is supposed to return an AVDictionary with all the
unrecognized/unsupported options instead of just taking all the options.
Given that your filter simply ignores the options your handling of it is
worse, but also more easily fixable: Use the init-callback instead of
the init_dict and remove the unused options completely.

> @@ -366,8 +715,8 @@ static int nppscale_config_props(AVFilterLink *outlink)
>             inlink->w, inlink->h, outlink->w, outlink->h);
>      if (inlink->sample_aspect_ratio.num)
> -        outlink->sample_aspect_ratio = av_mul_q((AVRational){outlink->h*inlink->w,
> -                                                             outlink->w*inlink->h},
> +        outlink->sample_aspect_ratio = av_mul_q((AVRational){outlink->h * inlink->w,
> +                                                             outlink->w * inlink->h},
>                                                  inlink->sample_aspect_ratio);
>      else
>          outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;

Cosmetic change; should not be in a functional commit.

> @@ -148,7 +483,9 @@ static int nppscale_query_formats(AVFilterContext *ctx)
>      static const enum AVPixelFormat pixel_formats[] = {
>      };
> -    return ff_set_common_formats_from_list(ctx, pixel_formats);
> +    AVFilterFormats *pix_fmts = ff_make_format_list(pixel_formats);
> +
> +    return ff_set_common_formats(ctx, pix_fmts);
>  }

ff_set_common_formats_from_list(ctx, pixel_formats) is a shortcut for
ff_set_common_formats(ctx, ff_make_format_list(pixel_formats)), so this
is not a functional change; it just adds more code duplication.

- Andreas
ffmpeg-devel mailing list
ffmpeg-devel at ffmpeg.org

To unsubscribe, visit link above, or email
ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".

More information about the ffmpeg-devel mailing list