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

Showing the changes to libavfilter (1 of 2 files). Show all

Unified · Split

libavfilter/vf_zscale.c+7−0
@@ -101,6 +101,8 @@ typedef struct ZScaleContext { · 100 unmodified lines
101 char *size_str;101 char *size_str;
102 double nominal_peak_luminance;102 double nominal_peak_luminance;
103 int approximate_gamma;103 int approximate_gamma;
104 double param_a;
105 double param_b;
104 106
105 char *w_expr; ///< width expression string107 char *w_expr; ///< width expression string
106 char *h_expr; ///< height expression string108 char *h_expr; ///< height expression string
@@ -601,6 +603,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) · 494 unmodified lines
601 s->params.resample_filter_uv = s->filter;603 s->params.resample_filter_uv = s->filter;
602 s->params.nominal_peak_luminance = s->nominal_peak_luminance;604 s->params.nominal_peak_luminance = s->nominal_peak_luminance;
603 s->params.allow_approximate_gamma = s->approximate_gamma;605 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;
604 608
605 format_init(&s->src_format, in, desc, s->colorspace_in,609 format_init(&s->src_format, in, desc, s->colorspace_in,
606 s->primaries_in, s->trc_in, s->range_in, s->chromal_in);610 s->primaries_in, s->trc_in, s->range_in, s->chromal_in);
@@ -897,6 +901,9 @@ static const AVOption zscale_options[] = { · 290 unmodified lines
897 { "cin", "set input chroma location", OFFSET(chromal_in), AV_OPT_TYPE_INT, {.i64 = -1}, -1, ZIMG_CHROMA_BOTTOM, FLAGS, "chroma" },901 { "cin", "set input chroma location", OFFSET(chromal_in), AV_OPT_TYPE_INT, {.i64 = -1}, -1, ZIMG_CHROMA_BOTTOM, FLAGS, "chroma" },
898 { "npl", "set nominal peak luminance", OFFSET(nominal_peak_luminance), AV_OPT_TYPE_DOUBLE, {.dbl = NAN}, 0, DBL_MAX, FLAGS },902 { "npl", "set nominal peak luminance", OFFSET(nominal_peak_luminance), AV_OPT_TYPE_DOUBLE, {.dbl = NAN}, 0, DBL_MAX, FLAGS },
899 { "agamma", "allow approximate gamma", OFFSET(approximate_gamma), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, FLAGS },903 { "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 },
900 { NULL }907 { NULL }
901};908};
902 909

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