History

Merge remote-tracking branch 'ubitux/shorthand-cleanup'

* ubitux/shorthand-cleanup: lavfi/subtitles: switch to an AVOptions-based system. lavfi/pp: switch to an AVOptions-based system. lavfi/geq: switch to an AVOptions-based system. lavfi/edgedetect: switch to an AVOptions-based system. lavfi/curves: switch to an AVOptions-based system. lavfi/colormatrix: switch to an AVOptions-based system. lavfi/perms: switch to an AVOptions-based system. lavfi/ebur128: switch to an AVOptions-based system. lavfi/showspectrum: switch to an AVOptions-based system. lavfi/silencedetect: switch to an AVOptions-based system. lavfi/thumbnail: switch to an AVOptions-based system.

Michael Niedermayer committed 13 years ago

Commit 270d3c92 parents b3fb2d8 e2b0edb16 files · +83 −135Browse files

Unified · Split

16 files
  1. doc/filters.texi +44 −54
  2. libavfilter/af_silencedetect.c +0 −17
  3. libavfilter/avf_showspectrum.c +0 −15
  4. libavfilter/avfilter.c +13 −0
  5. libavfilter/f_ebur128.c +0 −7
  6. libavfilter/f_perms.c +0 −4
  7. libavfilter/vf_colormatrix.c +0 −3
  8. libavfilter/vf_curves.c +8 −10
  9. libavfilter/vf_edgedetect.c +0 −7
  10. libavfilter/vf_geq.c +0 −3
  11. libavfilter/vf_pp.c +14 −4
  12. libavfilter/vf_subtitles.c +0 −4
  13. libavfilter/vf_thumbnail.c +0 −3
  14. libpostproc/postprocess.c +1 −1
  15. libpostproc/version.h +1 −1
  16. tests/lavfi-regression.sh +2 −2
doc/filters.texi+44−54
@@ -1117,6 +1117,8 @@ minimum detected noise duration. · 1116 unmodified lines
11171117
11181118 The printed times and duration are expressed in seconds.
11191119
1120+The filter accepts the following options:
1121+
11201122 @table @option
11211123 @item duration, d
11221124 Set silence duration until notification (default is 2 seconds).
@@ -2100,12 +2102,8 @@ boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chrom · 977 unmodified lines
21002102
21012103 Convert color matrix.
21022104
2103−The filter accepts parameters as a list of @var{key}=@var{value}
2104−pairs, separated by ":". If the key of the first options is omitted,
2105−the arguments are interpreted according to the syntax
2106−@var{src}:@var{dst}.
2105+The filter accepts the following options:
21072106
2108−A description of the accepted options follows:
21092107 @table @option
21102108 @item src
21112109 @item dst
@@ -2371,30 +2369,15 @@ If there is no key point defined in @code{x=0}, the filter will automatically · 259 unmodified lines
23712369 insert a @var{(0;0)} point. In the same way, if there is no key point defined
23722370 in @code{x=1}, the filter will automatically insert a @var{(1;1)} point.
23732371
2374−The filter accepts parameters as a list of @var{key}=@var{value}
2375−pairs, separated by ":". If the key of the first options is omitted,
2376−the arguments are interpreted according to the syntax
2377−curves[=@var{preset}].
2378−
2379−A description of the accepted parameters follows.
2372+The filter accepts the following options:
23802373
23812374 @table @option
2382−@item red, r
2383−Set the key points for the red component.
2384−@item green, g
2385−Set the key points for the green component.
2386−@item blue, b
2387−Set the key points for the blue component.
2388−@item all
2389−Set the key points for all components.
2390−Can be used in addition to the other key points component
2391−options. In this case, the unset component(s) will fallback on this
2392−@option{all} setting.
23932375 @item preset
23942376 Select one of the available color presets. This option can not be used in
23952377 addition to the @option{r}, @option{g}, @option{b} parameters.
23962378 Available presets are:
23972379 @table @samp
2380+@item none
23982381 @item color_negative
23992382 @item cross_process
24002383 @item darker
@@ -2406,7 +2389,18 @@ Available presets are: · 5 unmodified lines
24062389 @item strong_contrast
24072390 @item vintage
24082391 @end table
2409−Default is unset.
2392+Default is @code{none}.
2393+@item red, r
2394+Set the key points for the red component.
2395+@item green, g
2396+Set the key points for the green component.
2397+@item blue, b
2398+Set the key points for the blue component.
2399+@item all
2400+Set the key points for all components.
2401+Can be used in addition to the other key points component
2402+options. In this case, the unset component(s) will fallback on this
2403+@option{all} setting.
24102404 @end table
24112405
24122406 To avoid some filtergraph syntax conflicts, each key points list need to be
@@ -3014,7 +3008,7 @@ For more information about fontconfig, check: · 601 unmodified lines
30143008
30153009 Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
30163010
3017−This filter accepts the following optional named parameters:
3011+The filter accepts the following options:
30183012
30193013 @table @option
30203014 @item low, high
@@ -3308,11 +3302,7 @@ For more information see: · 287 unmodified lines
33083302
33093303 @section geq
33103304
3311−The filter takes one, two, three or four equations as parameter, separated by ':'.
3312−The first equation is mandatory and applies to the luma plane. The two
3313−following are respectively for chroma blue and chroma red planes.
3314−
3315−The filter syntax allows named parameters:
3305+The filter accepts the following options:
33163306
33173307 @table @option
33183308 @item lum_expr
@@ -4615,6 +4605,13 @@ Subfilters must be separated by '/' and can be disabled by prepending a '-'. · 1296 unmodified lines
46154605 Each subfilter and some options have a short and a long name that can be used
46164606 interchangeably, i.e. dr/dering are the same.
46174607
4608+The filters accept the following options:
4609+
4610+@table @option
4611+@item subfilters
4612+Set postprocessing subfilters string.
4613+@end table
4614+
46184615 All subfilters share common options to determine their scope:
46194616
46204617 @table @option
@@ -4631,12 +4628,12 @@ Do luminance filtering only (no chrominance). · 10 unmodified lines
46314628 Do chrominance filtering only (no luminance).
46324629 @end table
46334630
4634−These options can be appended after the subfilter name, separated by a ':'.
4631+These options can be appended after the subfilter name, separated by a '|'.
46354632
46364633 Available subfilters are:
46374634
46384635 @table @option
4639−@item hb/hdeblock[:difference[:flatness]]
4636+@item hb/hdeblock[|difference[|flatness]]
46404637 Horizontal deblocking filter
46414638 @table @option
46424639 @item difference
@@ -4645,7 +4642,7 @@ Difference factor where higher values mean more deblocking (default: @code{32}). · 2 unmodified lines
46454642 Flatness threshold where lower values mean more deblocking (default: @code{39}).
46464643 @end table
46474644
4648−@item vb/vdeblock[:difference[:flatness]]
4645+@item vb/vdeblock[|difference[|flatness]]
46494646 Vertical deblocking filter
46504647 @table @option
46514648 @item difference
@@ -4654,7 +4651,7 @@ Difference factor where higher values mean more deblocking (default: @code{32}). · 2 unmodified lines
46544651 Flatness threshold where lower values mean more deblocking (default: @code{39}).
46554652 @end table
46564653
4657−@item ha/hadeblock[:difference[:flatness]]
4654+@item ha/hadeblock[|difference[|flatness]]
46584655 Accurate horizontal deblocking filter
46594656 @table @option
46604657 @item difference
@@ -4663,7 +4660,7 @@ Difference factor where higher values mean more deblocking (default: @code{32}). · 2 unmodified lines
46634660 Flatness threshold where lower values mean more deblocking (default: @code{39}).
46644661 @end table
46654662
4666−@item va/vadeblock[:difference[:flatness]]
4663+@item va/vadeblock[|difference[|flatness]]
46674664 Accurate vertical deblocking filter
46684665 @table @option
46694666 @item difference
@@ -4687,7 +4684,7 @@ Experimental vertical deblocking filter · 17 unmodified lines
46874684 @item dr/dering
46884685 Deringing filter
46894686
4690−@item tn/tmpnoise[:threshold1[:threshold2[:threshold3]]], temporal noise reducer
4687+@item tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer
46914688 @table @option
46924689 @item threshold1
46934690 larger -> stronger filtering
@@ -4727,7 +4724,7 @@ second line with a @code{(-1 4 2 4 -1)} filter. · 33 unmodified lines
47274724 Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given
47284725 block by filtering all lines with a @code{(-1 2 6 2 -1)} filter.
47294726
4730−@item fq/forceQuant[:quantizer]
4727+@item fq/forceQuant[|quantizer]
47314728 Overrides the quantizer table from the input with the constant quantizer you
47324729 specify.
47334730 @table @option
@@ -4736,13 +4733,13 @@ Quantizer to use · 2 unmodified lines
47364733 @end table
47374734
47384735 @item de/default
4739−Default pp filter combination (@code{hb:a,vb:a,dr:a})
4736+Default pp filter combination (@code{hb|a,vb|a,dr|a})
47404737
47414738 @item fa/fast
4742−Fast pp filter combination (@code{h1:a,v1:a,dr:a})
4739+Fast pp filter combination (@code{h1|a,v1|a,dr|a})
47434740
47444741 @item ac
4745−High quality pp filter combination (@code{ha:a:128:7,va:a,dr:a})
4742+High quality pp filter combination (@code{ha|a|128|7,va|a,dr|a})
47464743 @end table
47474744
47484745 @subsection Examples
@@ -4764,14 +4761,14 @@ pp=de/-al · 15 unmodified lines
47644761 @item
47654762 Apply default filters and temporal denoiser:
47664763 @example
4767−pp=default/tmpnoise:1:2:3
4764+pp=default/tmpnoise|1|2|3
47684765 @end example
47694766
47704767 @item
47714768 Apply deblocking on luminance only, and switch vertical deblocking on or off
47724769 automatically depending on available CPU time:
47734770 @example
4774−pp=hb:y/vb:a
4771+pp=hb|y/vb|a
47754772 @end example
47764773 @end itemize
47774774
@@ -5325,8 +5322,7 @@ To enable compilation of this filter you need to configure FFmpeg with · 547 unmodified lines
53255322 libavformat to convert the passed subtitles file to ASS (Advanced Substation
53265323 Alpha) subtitles format.
53275324
5328−This filter accepts the following named options, expressed as a
5329−sequence of @var{key}=@var{value} pairs, separated by ":".
5325+The filter accepts the following options:
53305326
53315327 @table @option
53325328 @item filename, f
@@ -5392,10 +5388,7 @@ Swap U & V plane. · 59 unmodified lines
53925388 @section thumbnail
53935389 Select the most representative frame in a given sequence of consecutive frames.
53945390
5395−The filter accepts parameters as a list of @var{key}=@var{value}
5396−pairs, separated by ":". If the key of the first options is omitted,
5397−the arguments are interpreted according to the syntax
5398−thumbnail[=@var{n}].
5391+The filter accepts the following options:
53995392
54005393 @table @option
54015394 @item n
@@ -6345,11 +6338,7 @@ Set read/write permissions for the output frames. · 943 unmodified lines
63456338 These filters are mainly aimed at developers to test direct path in the
63466339 following filter in the filtergraph.
63476340
6348−The filters accept parameters as a list of @var{key}=@var{value} pairs,
6349−separated by ":". If the key of the first options is omitted, the argument is
6350−assumed to be the @var{mode}.
6351−
6352−A description of the accepted parameters follows.
6341+The filters accept the following options:
63536342
63546343 @table @option
63556344 @item mode
@@ -6848,7 +6837,7 @@ the momentary loudness (400 milliseconds). · 492 unmodified lines
68486837 More information about the Loudness Recommendation EBU R128 on
68496838 @url{http://tech.ebu.ch/loudness}.
68506839
6851−The filter accepts the following named parameters:
6840+The filter accepts the following options:
68526841
68536842 @table @option
68546843
@@ -7036,7 +7025,8 @@ do not have exactly the same duration in the first file. · 181 unmodified lines
70367025 Convert input audio to a video output, representing the audio frequency
70377026 spectrum.
70387027
7039−The filter accepts the following named parameters:
7028+The filter accepts the following options:
7029+
70407030 @table @option
70417031 @item size, s
70427032 Specify the video size for the output. Default value is @code{640x512}.
libavfilter/af_silencedetect.c+0−17
@@ -54,22 +54,6 @@ static const AVOption silencedetect_options[] = { · 53 unmodified lines
5454
5555 AVFILTER_DEFINE_CLASS(silencedetect);
5656
57−static av_cold int init(AVFilterContext *ctx, const char *args)
58−{
59− int ret;
60− SilenceDetectContext *silence = ctx->priv;
61−
62− silence->class = &silencedetect_class;
63− av_opt_set_defaults(silence);
64−
65− if ((ret = av_set_options_string(silence, args, "=", ":")) < 0)
66− return ret;
67−
68− av_opt_free(silence);
69−
70− return 0;
71−}
72−
7357 static char *get_metadata_val(AVFrame *insamples, const char *key)
7458 {
7559 AVDictionaryEntry *e = av_dict_get(insamples->metadata, key, NULL, 0);
@@ -176,7 +160,6 @@ AVFilter avfilter_af_silencedetect = { · 100 unmodified lines
176160 .name = "silencedetect",
177161 .description = NULL_IF_CONFIG_SMALL("Detect silence."),
178162 .priv_size = sizeof(SilenceDetectContext),
179− .init = init,
180163 .query_formats = query_formats,
181164 .inputs = silencedetect_inputs,
182165 .outputs = silencedetect_outputs,
libavfilter/avf_showspectrum.c+0−15
@@ -97,20 +97,6 @@ static const struct { · 96 unmodified lines
9797 { 1, 1, 0, 0 }
9898 };
9999
100−static av_cold int init(AVFilterContext *ctx, const char *args)
101−{
102− ShowSpectrumContext *showspectrum = ctx->priv;
103− int err;
104−
105− showspectrum->class = &showspectrum_class;
106− av_opt_set_defaults(showspectrum);
107−
108− if ((err = av_set_options_string(showspectrum, args, "=", ":")) < 0)
109− return err;
110−
111− return 0;
112−}
113−
114100 static av_cold void uninit(AVFilterContext *ctx)
115101 {
116102 ShowSpectrumContext *showspectrum = ctx->priv;
@@ -505,7 +491,6 @@ static const AVFilterPad showspectrum_outputs[] = { · 388 unmodified lines
505491 AVFilter avfilter_avf_showspectrum = {
506492 .name = "showspectrum",
507493 .description = NULL_IF_CONFIG_SMALL("Convert input audio to a spectrum video output."),
508− .init = init,
509494 .uninit = uninit,
510495 .query_formats = query_formats,
511496 .priv_size = sizeof(ShowSpectrumContext),
libavfilter/avfilter.c+13−0
@@ -657,18 +657,24 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque · 656 unmodified lines
657657 int ret=0;
658658 int anton_options =
659659 !strcmp(filter->filter->name, "aformat") ||
660+ !strcmp(filter->filter->name, "ass") ||
660661 !strcmp(filter->filter->name, "blackframe") ||
661662 !strcmp(filter->filter->name, "boxblur" ) ||
663+ !strcmp(filter->filter->name, "colormatrix") ||
662664 !strcmp(filter->filter->name, "crop" ) ||
663665 !strcmp(filter->filter->name, "cropdetect") ||
666+ !strcmp(filter->filter->name, "curves" ) ||
664667 !strcmp(filter->filter->name, "delogo" ) ||
665668 !strcmp(filter->filter->name, "drawbox" ) ||
666669 !strcmp(filter->filter->name, "drawtext" ) ||
670+ !strcmp(filter->filter->name, "ebur128" ) ||
671+ !strcmp(filter->filter->name, "edgedetect") ||
667672 !strcmp(filter->filter->name, "fade" ) ||
668673 !strcmp(filter->filter->name, "fieldorder") ||
669674 !strcmp(filter->filter->name, "fps" ) ||
670675 !strcmp(filter->filter->name, "frei0r" ) ||
671676 !strcmp(filter->filter->name, "frei0r_src") ||
677+ !strcmp(filter->filter->name, "geq" ) ||
672678 !strcmp(filter->filter->name, "gradfun" ) ||
673679 !strcmp(filter->filter->name, "hqdn3d" ) ||
674680 !strcmp(filter->filter->name, "ocv" ) ||
@@ -680,7 +686,14 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque · 5 unmodified lines
680686 !strcmp(filter->filter->name, "pad" ) ||
681687 !strcmp(filter->filter->name, "format") ||
682688 !strcmp(filter->filter->name, "noformat") ||
689+ !strcmp(filter->filter->name, "perms") ||
690+ !strcmp(filter->filter->name, "pp" ) ||
691+ !strcmp(filter->filter->name, "aperms") ||
683692 !strcmp(filter->filter->name, "resample") ||
693+ !strcmp(filter->filter->name, "showspectrum") ||
694+ !strcmp(filter->filter->name, "silencedetect") ||
695+ !strcmp(filter->filter->name, "subtitles") ||
696+ !strcmp(filter->filter->name, "thumbnail") ||
684697 // !strcmp(filter->filter->name, "scale" ) ||
685698 !strcmp(filter->filter->name, "select") ||
686699 0
libavfilter/f_ebur128.c+0−7
@@ -405,16 +405,9 @@ static struct hist_entry *get_histogram(void) · 404 unmodified lines
405405
406406 static av_cold int init(AVFilterContext *ctx, const char *args)
407407 {
408− int ret;
409408 EBUR128Context *ebur128 = ctx->priv;
410409 AVFilterPad pad;
411410
412− ebur128->class = &ebur128_class;
413− av_opt_set_defaults(ebur128);
414−
415− if ((ret = av_set_options_string(ebur128, args, "=", ":")) < 0)
416− return ret;
417−
418411 if (ebur128->loglevel != AV_LOG_INFO &&
419412 ebur128->loglevel != AV_LOG_VERBOSE) {
420413 if (ebur128->do_video || ebur128->metadata)
libavfilter/f_perms.c+0−4
@@ -111,8 +111,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 110 unmodified lines
111111 return ret;
112112 }
113113
114−static const char *const shorthand[] = { "mode", NULL };
115−
116114 #if CONFIG_APERMS_FILTER
117115
118116 #define aperms_options options
@@ -143,7 +141,6 @@ AVFilter avfilter_af_aperms = { · 24 unmodified lines
143141 .inputs = aperms_inputs,
144142 .outputs = aperms_outputs,
145143 .priv_class = &aperms_class,
146− .shorthand = shorthand,
147144 };
148145 #endif /* CONFIG_APERMS_FILTER */
149146
@@ -177,6 +174,5 @@ AVFilter avfilter_vf_perms = { · 27 unmodified lines
177174 .inputs = perms_inputs,
178175 .outputs = perms_outputs,
179176 .priv_class = &perms_class,
180− .shorthand = shorthand,
181177 };
182178 #endif /* CONFIG_PERMS_FILTER */
libavfilter/vf_colormatrix.c+0−3
@@ -375,8 +375,6 @@ static const AVFilterPad colormatrix_outputs[] = { · 374 unmodified lines
375375 { NULL }
376376 };
377377
378−static const char *const shorthand[] = { "src", "dst", NULL };
379−
380378 AVFilter avfilter_vf_colormatrix = {
381379 .name = "colormatrix",
382380 .description = NULL_IF_CONFIG_SMALL("Convert color matrix."),
@@ -387,5 +385,4 @@ AVFilter avfilter_vf_colormatrix = { · 4 unmodified lines
387385 .inputs = colormatrix_inputs,
388386 .outputs = colormatrix_outputs,
389387 .priv_class = &colormatrix_class,
390− .shorthand = shorthand,
391388 };
libavfilter/vf_curves.c+8−10
@@ -59,14 +59,8 @@ typedef struct { · 58 unmodified lines
5959 #define OFFSET(x) offsetof(CurvesContext, x)
6060 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
6161 static const AVOption curves_options[] = {
62− { "red", "set red points coordinates", OFFSET(comp_points_str[0]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
63− { "r", "set red points coordinates", OFFSET(comp_points_str[0]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
64− { "green", "set green points coordinates", OFFSET(comp_points_str[1]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
65− { "g", "set green points coordinates", OFFSET(comp_points_str[1]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
66− { "blue", "set blue points coordinates", OFFSET(comp_points_str[2]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
67− { "b", "set blue points coordinates", OFFSET(comp_points_str[2]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
68− { "all", "set points coordinates for all components", OFFSET(comp_points_str_all),AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
6962 { "preset", "select a color curves preset", OFFSET(preset), AV_OPT_TYPE_INT, {.i64=PRESET_NONE}, PRESET_NONE, NB_PRESETS-1, FLAGS, "preset_name" },
63+ { "none", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_NONE}, INT_MIN, INT_MAX, FLAGS, "preset_name" },
7064 { "color_negative", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_COLOR_NEGATIVE}, INT_MIN, INT_MAX, FLAGS, "preset_name" },
7165 { "cross_process", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_CROSS_PROCESS}, INT_MIN, INT_MAX, FLAGS, "preset_name" },
7266 { "darker", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_DARKER}, INT_MIN, INT_MAX, FLAGS, "preset_name" },
@@ -77,6 +71,13 @@ static const AVOption curves_options[] = { · 4 unmodified lines
7771 { "negative", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_NEGATIVE}, INT_MIN, INT_MAX, FLAGS, "preset_name" },
7872 { "strong_contrast", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_STRONG_CONTRAST}, INT_MIN, INT_MAX, FLAGS, "preset_name" },
7973 { "vintage", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_VINTAGE}, INT_MIN, INT_MAX, FLAGS, "preset_name" },
74+ { "red", "set red points coordinates", OFFSET(comp_points_str[0]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
75+ { "r", "set red points coordinates", OFFSET(comp_points_str[0]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
76+ { "green", "set green points coordinates", OFFSET(comp_points_str[1]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
77+ { "g", "set green points coordinates", OFFSET(comp_points_str[1]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
78+ { "blue", "set blue points coordinates", OFFSET(comp_points_str[2]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
79+ { "b", "set blue points coordinates", OFFSET(comp_points_str[2]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
80+ { "all", "set points coordinates for all components", OFFSET(comp_points_str_all),AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
8081 { NULL }
8182 };
8283
@@ -447,8 +448,6 @@ static const AVFilterPad curves_outputs[] = { · 364 unmodified lines
447448 { NULL }
448449 };
449450
450−static const char *const shorthand[] = { "preset", NULL };
451−
452451 AVFilter avfilter_vf_curves = {
453452 .name = "curves",
454453 .description = NULL_IF_CONFIG_SMALL("Adjust components curves."),
@@ -458,5 +457,4 @@ AVFilter avfilter_vf_curves = { · 3 unmodified lines
458457 .inputs = curves_inputs,
459458 .outputs = curves_outputs,
460459 .priv_class = &curves_class,
461− .shorthand = shorthand,
462460 };
libavfilter/vf_edgedetect.c+0−7
@@ -52,15 +52,8 @@ AVFILTER_DEFINE_CLASS(edgedetect); · 51 unmodified lines
5252
5353 static av_cold int init(AVFilterContext *ctx, const char *args)
5454 {
55− int ret;
5655 EdgeDetectContext *edgedetect = ctx->priv;
5756
58− edgedetect->class = &edgedetect_class;
59− av_opt_set_defaults(edgedetect);
60−
61− if ((ret = av_set_options_string(edgedetect, args, "=", ":")) < 0)
62− return ret;
63−
6457 edgedetect->low_u8 = edgedetect->low * 255. + .5;
6558 edgedetect->high_u8 = edgedetect->high * 255. + .5;
6659 return 0;
libavfilter/vf_geq.c+0−3
@@ -228,8 +228,6 @@ static const AVFilterPad geq_outputs[] = { · 227 unmodified lines
228228 { NULL }
229229 };
230230
231−static const char *const shorthand[] = { "lum_expr", "cb_expr", "cr_expr", "alpha_expr", NULL };
232−
233231 AVFilter avfilter_vf_geq = {
234232 .name = "geq",
235233 .description = NULL_IF_CONFIG_SMALL("Apply generic equation to each pixel."),
@@ -240,5 +238,4 @@ AVFilter avfilter_vf_geq = { · 4 unmodified lines
240238 .inputs = geq_inputs,
241239 .outputs = geq_outputs,
242240 .priv_class = &geq_class,
243− .shorthand = shorthand,
244241 };
libavfilter/vf_pp.c+14−4
@@ -31,21 +31,29 @@ · 30 unmodified lines
3131 #include "libpostproc/postprocess.h"
3232
3333 typedef struct {
34+ const AVClass *class;
35+ char *subfilters;
3436 int mode_id;
3537 pp_mode *modes[PP_QUALITY_MAX + 1];
3638 void *pp_ctx;
3739 } PPFilterContext;
3840
41+#define OFFSET(x) offsetof(PPFilterContext, x)
42+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
43+static const AVOption pp_options[] = {
44+ { "subfilters", "set postprocess subfilters", OFFSET(subfilters), AV_OPT_TYPE_STRING, {.str="de"}, .flags = FLAGS },
45+ { NULL }
46+};
47+
48+AVFILTER_DEFINE_CLASS(pp);
49+
3950 static av_cold int pp_init(AVFilterContext *ctx, const char *args)
4051 {
4152 int i;
4253 PPFilterContext *pp = ctx->priv;
4354
44− if (!args || !*args)
45− args = "de";
46−
4755 for (i = 0; i <= PP_QUALITY_MAX; i++) {
48− pp->modes[i] = pp_get_mode_by_name_and_quality(args, i);
56+ pp->modes[i] = pp_get_mode_by_name_and_quality(pp->subfilters, i);
4957 if (!pp->modes[i])
5058 return AVERROR_EXTERNAL;
5159 }
@@ -171,4 +179,6 @@ AVFilter avfilter_vf_pp = { · 119 unmodified lines
171179 .inputs = pp_inputs,
172180 .outputs = pp_outputs,
173181 .process_command = pp_process_command,
182+ .priv_class = &pp_class,
183+
174184 };
libavfilter/vf_subtitles.c+0−4
@@ -201,8 +201,6 @@ static const AVFilterPad ass_outputs[] = { · 200 unmodified lines
201201 { NULL }
202202 };
203203
204−static const char *const shorthand[] = { "filename", NULL };
205−
206204 #if CONFIG_ASS_FILTER
207205
208206 static const AVOption ass_options[] = {
@@ -240,7 +238,6 @@ AVFilter avfilter_vf_ass = { · 31 unmodified lines
240238 .inputs = ass_inputs,
241239 .outputs = ass_outputs,
242240 .priv_class = &ass_class,
243− .shorthand = shorthand,
244241 };
245242 #endif
246243
@@ -365,6 +362,5 @@ AVFilter avfilter_vf_subtitles = { · 118 unmodified lines
365362 .inputs = ass_inputs,
366363 .outputs = ass_outputs,
367364 .priv_class = &subtitles_class,
368− .shorthand = shorthand,
369365 };
370366 #endif
libavfilter/vf_thumbnail.c+0−3
@@ -227,8 +227,6 @@ static const AVFilterPad thumbnail_outputs[] = { · 226 unmodified lines
227227 { NULL }
228228 };
229229
230−static const char *const shorthand[] = { "n", NULL };
231−
232230 AVFilter avfilter_vf_thumbnail = {
233231 .name = "thumbnail",
234232 .description = NULL_IF_CONFIG_SMALL("Select the most representative frame in a given sequence of consecutive frames."),
@@ -239,5 +237,4 @@ AVFilter avfilter_vf_thumbnail = { · 4 unmodified lines
239237 .inputs = thumbnail_inputs,
240238 .outputs = thumbnail_outputs,
241239 .priv_class = &thumbnail_class,
242− .shorthand = shorthand,
243240 };
libpostproc/postprocess.c+1−1
@@ -666,7 +666,7 @@ pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality) · 665 unmodified lines
666666 char temp[GET_MODE_BUFFER_SIZE];
667667 char *p= temp;
668668 static const char filterDelimiters[] = ",/";
669− static const char optionDelimiters[] = ":";
669+ static const char optionDelimiters[] = ":|";
670670 struct PPMode *ppMode;
671671 char *filterToken;
672672
libpostproc/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929 #include "libavutil/avutil.h"
3030
3131 #define LIBPOSTPROC_VERSION_MAJOR 52
32−#define LIBPOSTPROC_VERSION_MINOR 2
32+#define LIBPOSTPROC_VERSION_MINOR 3
3333 #define LIBPOSTPROC_VERSION_MICRO 100
3434
3535 #define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \
tests/lavfi-regression.sh+2−2
@@ -52,8 +52,8 @@ do_lavfi "overlay_yuv420" "split[m],scale=88:72,pad=96:80:4:4[o2];[m]fifo[o1 · 51 unmodified lines
5252 do_lavfi "overlay_yuv444" "split[m],scale=88:72,pad=96:80:4:4[o2];[m]fifo[o1],[o1][o2]overlay=240:16:format=yuv444"
5353 do_lavfi "pad" "pad=iw*1.5:ih*1.5:iw*0.3:ih*0.2"
5454 do_lavfi "pp" "pp=be/hb/vb/tn/l5/al"
55−do_lavfi "pp2" "pp=be/fq:16/h1/v1/lb"
56−do_lavfi "pp3" "pp=be/fq:8/ha:128:7/va/li"
55+do_lavfi "pp2" "pp=be/fq|16/h1/v1/lb"
56+do_lavfi "pp3" "pp=be/fq|8/ha|128|7/va/li"
5757 do_lavfi "pp4" "pp=be/ci"
5858 do_lavfi "pp5" "pp=md"
5959 do_lavfi "pp6" "pp=be/fd"

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