History

avfilter/vf_zscale: add support for setting scaling filter parameters

param_a/b are utilized for this.

Jan Ekström committed 5 years ago

Commit 58e59391 parent 22edf742 files · +14 −0Browse files

Unified · Split

2 files
  1. doc/filters.texi +7 −0
  2. libavfilter/vf_zscale.c +7 −0
doc/filters.texi+7−0
@@ -22393,6 +22393,13 @@ Possible values are: · 22392 unmodified lines
2239322393
2239422394 @item npl
2239522395 Set the nominal peak luminance.
22396+
22397+@item param_a
22398+Parameter A for scaling filters. Parameter "b" for bicubic, and the number of
22399+filter taps for lanczos.
22400+
22401+@item param_b
22402+Parameter B for scaling filters. Parameter "c" for bicubic.
2239622403 @end table
2239722404
2239822405 The values of the @option{w} and @option{h} options are expressions
libavfilter/vf_zscale.c+7−0
@@ -101,6 +101,8 @@ typedef struct ZScaleContext { · 100 unmodified lines
101101 char *size_str;
102102 double nominal_peak_luminance;
103103 int approximate_gamma;
104+ double param_a;
105+ double param_b;
104106
105107 char *w_expr; ///< width expression string
106108 char *h_expr; ///< height expression string
@@ -601,6 +603,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) · 494 unmodified lines
601603 s->params.resample_filter_uv = s->filter;
602604 s->params.nominal_peak_luminance = s->nominal_peak_luminance;
603605 s->params.allow_approximate_gamma = s->approximate_gamma;
606+ s->params.filter_param_a = s->params.filter_param_a_uv = s->param_a;
607+ s->params.filter_param_b = s->params.filter_param_b_uv = s->param_b;
604608
605609 format_init(&s->src_format, in, desc, s->colorspace_in,
606610 s->primaries_in, s->trc_in, s->range_in, s->chromal_in);
@@ -897,6 +901,9 @@ static const AVOption zscale_options[] = { · 290 unmodified lines
897901 { "cin", "set input chroma location", OFFSET(chromal_in), AV_OPT_TYPE_INT, {.i64 = -1}, -1, ZIMG_CHROMA_BOTTOM, FLAGS, "chroma" },
898902 { "npl", "set nominal peak luminance", OFFSET(nominal_peak_luminance), AV_OPT_TYPE_DOUBLE, {.dbl = NAN}, 0, DBL_MAX, FLAGS },
899903 { "agamma", "allow approximate gamma", OFFSET(approximate_gamma), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, FLAGS },
904+ { "param_a", "parameter A, which is parameter \"b\" for bicubic, "
905+ "and the number of filter taps for lanczos", OFFSET(param_a), AV_OPT_TYPE_DOUBLE, {.dbl = NAN}, -DBL_MAX, DBL_MAX, FLAGS },
906+ { "param_b", "parameter B, which is parameter \"c\" for bicubic", OFFSET(param_b), AV_OPT_TYPE_DOUBLE, {.dbl = NAN}, -DBL_MAX, DBL_MAX, FLAGS },
900907 { NULL }
901908 };
902909

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t