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
1117 1117
1118The printed times and duration are expressed in seconds.1118The printed times and duration are expressed in seconds.
1119 1119
1120The filter accepts the following options:
1121
1120@table @option1122@table @option
1121@item duration, d1123@item duration, d
1122Set silence duration until notification (default is 2 seconds).1124Set 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
2100 2102
2101Convert color matrix.2103Convert color matrix.
2102 2104
2103The filter accepts parameters as a list of @var{key}=@var{value}2105The filter accepts the following options:
2104pairs, separated by ":". If the key of the first options is omitted,
2105the arguments are interpreted according to the syntax
2106@var{src}:@var{dst}.
2107 2106
2108A description of the accepted options follows:
2109@table @option2107@table @option
2110@item src2108@item src
2111@item dst2109@item dst
@@ -2371,30 +2369,15 @@ If there is no key point defined in @code{x=0}, the filter will automatically · 259 unmodified lines
2371insert a @var{(0;0)} point. In the same way, if there is no key point defined2369insert a @var{(0;0)} point. In the same way, if there is no key point defined
2372in @code{x=1}, the filter will automatically insert a @var{(1;1)} point.2370in @code{x=1}, the filter will automatically insert a @var{(1;1)} point.
2373 2371
2374The filter accepts parameters as a list of @var{key}=@var{value}2372The filter accepts the following options:
2375pairs, separated by ":". If the key of the first options is omitted,
2376the arguments are interpreted according to the syntax
2377curves[=@var{preset}].
2378
2379A description of the accepted parameters follows.
2380 2373
2381@table @option2374@table @option
2382@item red, r
2383Set the key points for the red component.
2384@item green, g
2385Set the key points for the green component.
2386@item blue, b
2387Set the key points for the blue component.
2388@item all
2389Set the key points for all components.
2390Can be used in addition to the other key points component
2391options. In this case, the unset component(s) will fallback on this
2392@option{all} setting.
2393@item preset2375@item preset
2394Select one of the available color presets. This option can not be used in2376Select one of the available color presets. This option can not be used in
2395addition to the @option{r}, @option{g}, @option{b} parameters.2377addition to the @option{r}, @option{g}, @option{b} parameters.
2396Available presets are:2378Available presets are:
2397@table @samp2379@table @samp
2380@item none
2398@item color_negative2381@item color_negative
2399@item cross_process2382@item cross_process
2400@item darker2383@item darker
@@ -2406,7 +2389,18 @@ Available presets are: · 5 unmodified lines
2406@item strong_contrast2389@item strong_contrast
2407@item vintage2390@item vintage
2408@end table2391@end table
2409Default is unset.2392Default is @code{none}.
2393@item red, r
2394Set the key points for the red component.
2395@item green, g
2396Set the key points for the green component.
2397@item blue, b
2398Set the key points for the blue component.
2399@item all
2400Set the key points for all components.
2401Can be used in addition to the other key points component
2402options. In this case, the unset component(s) will fallback on this
2403@option{all} setting.
2410@end table2404@end table
2411 2405
2412To avoid some filtergraph syntax conflicts, each key points list need to be2406To 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
3014 3008
3015Detect and draw edges. The filter uses the Canny Edge Detection algorithm.3009Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
3016 3010
3017This filter accepts the following optional named parameters:3011The filter accepts the following options:
3018 3012
3019@table @option3013@table @option
3020@item low, high3014@item low, high
@@ -3308,11 +3302,7 @@ For more information see: · 287 unmodified lines
3308 3302
3309@section geq3303@section geq
3310 3304
3311The filter takes one, two, three or four equations as parameter, separated by ':'.3305The filter accepts the following options:
3312The first equation is mandatory and applies to the luma plane. The two
3313following are respectively for chroma blue and chroma red planes.
3314
3315The filter syntax allows named parameters:
3316 3306
3317@table @option3307@table @option
3318@item lum_expr3308@item lum_expr
@@ -4615,6 +4605,13 @@ Subfilters must be separated by '/' and can be disabled by prepending a '-'. · 1296 unmodified lines
4615Each subfilter and some options have a short and a long name that can be used4605Each subfilter and some options have a short and a long name that can be used
4616interchangeably, i.e. dr/dering are the same.4606interchangeably, i.e. dr/dering are the same.
4617 4607
4608The filters accept the following options:
4609
4610@table @option
4611@item subfilters
4612Set postprocessing subfilters string.
4613@end table
4614
4618All subfilters share common options to determine their scope:4615All subfilters share common options to determine their scope:
4619 4616
4620@table @option4617@table @option
@@ -4631,12 +4628,12 @@ Do luminance filtering only (no chrominance). · 10 unmodified lines
4631Do chrominance filtering only (no luminance).4628Do chrominance filtering only (no luminance).
4632@end table4629@end table
4633 4630
4634These options can be appended after the subfilter name, separated by a ':'.4631These options can be appended after the subfilter name, separated by a '|'.
4635 4632
4636Available subfilters are:4633Available subfilters are:
4637 4634
4638@table @option4635@table @option
4639@item hb/hdeblock[:difference[:flatness]]4636@item hb/hdeblock[|difference[|flatness]]
4640Horizontal deblocking filter4637Horizontal deblocking filter
4641@table @option4638@table @option
4642@item difference4639@item difference
@@ -4645,7 +4642,7 @@ Difference factor where higher values mean more deblocking (default: @code{32}). · 2 unmodified lines
4645Flatness threshold where lower values mean more deblocking (default: @code{39}).4642Flatness threshold where lower values mean more deblocking (default: @code{39}).
4646@end table4643@end table
4647 4644
4648@item vb/vdeblock[:difference[:flatness]]4645@item vb/vdeblock[|difference[|flatness]]
4649Vertical deblocking filter4646Vertical deblocking filter
4650@table @option4647@table @option
4651@item difference4648@item difference
@@ -4654,7 +4651,7 @@ Difference factor where higher values mean more deblocking (default: @code{32}). · 2 unmodified lines
4654Flatness threshold where lower values mean more deblocking (default: @code{39}).4651Flatness threshold where lower values mean more deblocking (default: @code{39}).
4655@end table4652@end table
4656 4653
4657@item ha/hadeblock[:difference[:flatness]]4654@item ha/hadeblock[|difference[|flatness]]
4658Accurate horizontal deblocking filter4655Accurate horizontal deblocking filter
4659@table @option4656@table @option
4660@item difference4657@item difference
@@ -4663,7 +4660,7 @@ Difference factor where higher values mean more deblocking (default: @code{32}). · 2 unmodified lines
4663Flatness threshold where lower values mean more deblocking (default: @code{39}).4660Flatness threshold where lower values mean more deblocking (default: @code{39}).
4664@end table4661@end table
4665 4662
4666@item va/vadeblock[:difference[:flatness]]4663@item va/vadeblock[|difference[|flatness]]
4667Accurate vertical deblocking filter4664Accurate vertical deblocking filter
4668@table @option4665@table @option
4669@item difference4666@item difference
@@ -4687,7 +4684,7 @@ Experimental vertical deblocking filter · 17 unmodified lines
4687@item dr/dering4684@item dr/dering
4688Deringing filter4685Deringing filter
4689 4686
4690@item tn/tmpnoise[:threshold1[:threshold2[:threshold3]]], temporal noise reducer4687@item tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer
4691@table @option4688@table @option
4692@item threshold14689@item threshold1
4693larger -> stronger filtering4690larger -> stronger filtering
@@ -4727,7 +4724,7 @@ second line with a @code{(-1 4 2 4 -1)} filter. · 33 unmodified lines
4727Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given4724Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given
4728block by filtering all lines with a @code{(-1 2 6 2 -1)} filter.4725block by filtering all lines with a @code{(-1 2 6 2 -1)} filter.
4729 4726
4730@item fq/forceQuant[:quantizer]4727@item fq/forceQuant[|quantizer]
4731Overrides the quantizer table from the input with the constant quantizer you4728Overrides the quantizer table from the input with the constant quantizer you
4732specify.4729specify.
4733@table @option4730@table @option
@@ -4736,13 +4733,13 @@ Quantizer to use · 2 unmodified lines
4736@end table4733@end table
4737 4734
4738@item de/default4735@item de/default
4739Default pp filter combination (@code{hb:a,vb:a,dr:a})4736Default pp filter combination (@code{hb|a,vb|a,dr|a})
4740 4737
4741@item fa/fast4738@item fa/fast
4742Fast pp filter combination (@code{h1:a,v1:a,dr:a})4739Fast pp filter combination (@code{h1|a,v1|a,dr|a})
4743 4740
4744@item ac4741@item ac
4745High quality pp filter combination (@code{ha:a:128:7,va:a,dr:a})4742High quality pp filter combination (@code{ha|a|128|7,va|a,dr|a})
4746@end table4743@end table
4747 4744
4748@subsection Examples4745@subsection Examples
@@ -4764,14 +4761,14 @@ pp=de/-al · 15 unmodified lines
4764@item4761@item
4765Apply default filters and temporal denoiser:4762Apply default filters and temporal denoiser:
4766@example4763@example
4767pp=default/tmpnoise:1:2:34764pp=default/tmpnoise|1|2|3
4768@end example4765@end example
4769 4766
4770@item4767@item
4771Apply deblocking on luminance only, and switch vertical deblocking on or off4768Apply deblocking on luminance only, and switch vertical deblocking on or off
4772automatically depending on available CPU time:4769automatically depending on available CPU time:
4773@example4770@example
4774pp=hb:y/vb:a4771pp=hb|y/vb|a
4775@end example4772@end example
4776@end itemize4773@end itemize
4777 4774
@@ -5325,8 +5322,7 @@ To enable compilation of this filter you need to configure FFmpeg with · 547 unmodified lines
5325libavformat to convert the passed subtitles file to ASS (Advanced Substation5322libavformat to convert the passed subtitles file to ASS (Advanced Substation
5326Alpha) subtitles format.5323Alpha) subtitles format.
5327 5324
5328This filter accepts the following named options, expressed as a5325The filter accepts the following options:
5329sequence of @var{key}=@var{value} pairs, separated by ":".
5330 5326
5331@table @option5327@table @option
5332@item filename, f5328@item filename, f
@@ -5392,10 +5388,7 @@ Swap U & V plane. · 59 unmodified lines
5392@section thumbnail5388@section thumbnail
5393Select the most representative frame in a given sequence of consecutive frames.5389Select the most representative frame in a given sequence of consecutive frames.
5394 5390
5395The filter accepts parameters as a list of @var{key}=@var{value}5391The filter accepts the following options:
5396pairs, separated by ":". If the key of the first options is omitted,
5397the arguments are interpreted according to the syntax
5398thumbnail[=@var{n}].
5399 5392
5400@table @option5393@table @option
5401@item n5394@item n
@@ -6345,11 +6338,7 @@ Set read/write permissions for the output frames. · 943 unmodified lines
6345These filters are mainly aimed at developers to test direct path in the6338These filters are mainly aimed at developers to test direct path in the
6346following filter in the filtergraph.6339following filter in the filtergraph.
6347 6340
6348The filters accept parameters as a list of @var{key}=@var{value} pairs,6341The filters accept the following options:
6349separated by ":". If the key of the first options is omitted, the argument is
6350assumed to be the @var{mode}.
6351
6352A description of the accepted parameters follows.
6353 6342
6354@table @option6343@table @option
6355@item mode6344@item mode
@@ -6848,7 +6837,7 @@ the momentary loudness (400 milliseconds). · 492 unmodified lines
6848More information about the Loudness Recommendation EBU R128 on6837More information about the Loudness Recommendation EBU R128 on
6849@url{http://tech.ebu.ch/loudness}.6838@url{http://tech.ebu.ch/loudness}.
6850 6839
6851The filter accepts the following named parameters:6840The filter accepts the following options:
6852 6841
6853@table @option6842@table @option
6854 6843
@@ -7036,7 +7025,8 @@ do not have exactly the same duration in the first file. · 181 unmodified lines
7036Convert input audio to a video output, representing the audio frequency7025Convert input audio to a video output, representing the audio frequency
7037spectrum.7026spectrum.
7038 7027
7039The filter accepts the following named parameters:7028The filter accepts the following options:
7029
7040@table @option7030@table @option
7041@item size, s7031@item size, s
7042Specify the video size for the output. Default value is @code{640x512}.7032Specify 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
54 54
55AVFILTER_DEFINE_CLASS(silencedetect);55AVFILTER_DEFINE_CLASS(silencedetect);
56 56
57static 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
73static char *get_metadata_val(AVFrame *insamples, const char *key)57static char *get_metadata_val(AVFrame *insamples, const char *key)
74{58{
75 AVDictionaryEntry *e = av_dict_get(insamples->metadata, key, NULL, 0);59 AVDictionaryEntry *e = av_dict_get(insamples->metadata, key, NULL, 0);
@@ -176,7 +160,6 @@ AVFilter avfilter_af_silencedetect = { · 100 unmodified lines
176 .name = "silencedetect",160 .name = "silencedetect",
177 .description = NULL_IF_CONFIG_SMALL("Detect silence."),161 .description = NULL_IF_CONFIG_SMALL("Detect silence."),
178 .priv_size = sizeof(SilenceDetectContext),162 .priv_size = sizeof(SilenceDetectContext),
179 .init = init,
180 .query_formats = query_formats,163 .query_formats = query_formats,
181 .inputs = silencedetect_inputs,164 .inputs = silencedetect_inputs,
182 .outputs = silencedetect_outputs,165 .outputs = silencedetect_outputs,
libavfilter/avf_showspectrum.c+0−15
@@ -97,20 +97,6 @@ static const struct { · 96 unmodified lines
97 { 1, 1, 0, 0 }97 { 1, 1, 0, 0 }
98};98};
99 99
100static 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
114static av_cold void uninit(AVFilterContext *ctx)100static av_cold void uninit(AVFilterContext *ctx)
115{101{
116 ShowSpectrumContext *showspectrum = ctx->priv;102 ShowSpectrumContext *showspectrum = ctx->priv;
@@ -505,7 +491,6 @@ static const AVFilterPad showspectrum_outputs[] = { · 388 unmodified lines
505AVFilter avfilter_avf_showspectrum = {491AVFilter avfilter_avf_showspectrum = {
506 .name = "showspectrum",492 .name = "showspectrum",
507 .description = NULL_IF_CONFIG_SMALL("Convert input audio to a spectrum video output."),493 .description = NULL_IF_CONFIG_SMALL("Convert input audio to a spectrum video output."),
508 .init = init,
509 .uninit = uninit,494 .uninit = uninit,
510 .query_formats = query_formats,495 .query_formats = query_formats,
511 .priv_size = sizeof(ShowSpectrumContext),496 .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
657 int ret=0;657 int ret=0;
658 int anton_options =658 int anton_options =
659 !strcmp(filter->filter->name, "aformat") ||659 !strcmp(filter->filter->name, "aformat") ||
660 !strcmp(filter->filter->name, "ass") ||
660 !strcmp(filter->filter->name, "blackframe") ||661 !strcmp(filter->filter->name, "blackframe") ||
661 !strcmp(filter->filter->name, "boxblur" ) ||662 !strcmp(filter->filter->name, "boxblur" ) ||
663 !strcmp(filter->filter->name, "colormatrix") ||
662 !strcmp(filter->filter->name, "crop" ) ||664 !strcmp(filter->filter->name, "crop" ) ||
663 !strcmp(filter->filter->name, "cropdetect") ||665 !strcmp(filter->filter->name, "cropdetect") ||
666 !strcmp(filter->filter->name, "curves" ) ||
664 !strcmp(filter->filter->name, "delogo" ) ||667 !strcmp(filter->filter->name, "delogo" ) ||
665 !strcmp(filter->filter->name, "drawbox" ) ||668 !strcmp(filter->filter->name, "drawbox" ) ||
666 !strcmp(filter->filter->name, "drawtext" ) ||669 !strcmp(filter->filter->name, "drawtext" ) ||
670 !strcmp(filter->filter->name, "ebur128" ) ||
671 !strcmp(filter->filter->name, "edgedetect") ||
667 !strcmp(filter->filter->name, "fade" ) ||672 !strcmp(filter->filter->name, "fade" ) ||
668 !strcmp(filter->filter->name, "fieldorder") ||673 !strcmp(filter->filter->name, "fieldorder") ||
669 !strcmp(filter->filter->name, "fps" ) ||674 !strcmp(filter->filter->name, "fps" ) ||
670 !strcmp(filter->filter->name, "frei0r" ) ||675 !strcmp(filter->filter->name, "frei0r" ) ||
671 !strcmp(filter->filter->name, "frei0r_src") ||676 !strcmp(filter->filter->name, "frei0r_src") ||
677 !strcmp(filter->filter->name, "geq" ) ||
672 !strcmp(filter->filter->name, "gradfun" ) ||678 !strcmp(filter->filter->name, "gradfun" ) ||
673 !strcmp(filter->filter->name, "hqdn3d" ) ||679 !strcmp(filter->filter->name, "hqdn3d" ) ||
674 !strcmp(filter->filter->name, "ocv" ) ||680 !strcmp(filter->filter->name, "ocv" ) ||
@@ -680,7 +686,14 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque · 5 unmodified lines
680 !strcmp(filter->filter->name, "pad" ) ||686 !strcmp(filter->filter->name, "pad" ) ||
681 !strcmp(filter->filter->name, "format") ||687 !strcmp(filter->filter->name, "format") ||
682 !strcmp(filter->filter->name, "noformat") ||688 !strcmp(filter->filter->name, "noformat") ||
689 !strcmp(filter->filter->name, "perms") ||
690 !strcmp(filter->filter->name, "pp" ) ||
691 !strcmp(filter->filter->name, "aperms") ||
683 !strcmp(filter->filter->name, "resample") ||692 !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") ||
684// !strcmp(filter->filter->name, "scale" ) ||697// !strcmp(filter->filter->name, "scale" ) ||
685 !strcmp(filter->filter->name, "select") ||698 !strcmp(filter->filter->name, "select") ||
686 0699 0
libavfilter/f_ebur128.c+0−7
@@ -405,16 +405,9 @@ static struct hist_entry *get_histogram(void) · 404 unmodified lines
405 405
406static av_cold int init(AVFilterContext *ctx, const char *args)406static av_cold int init(AVFilterContext *ctx, const char *args)
407{407{
408 int ret;
409 EBUR128Context *ebur128 = ctx->priv;408 EBUR128Context *ebur128 = ctx->priv;
410 AVFilterPad pad;409 AVFilterPad pad;
411 410
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
418 if (ebur128->loglevel != AV_LOG_INFO &&411 if (ebur128->loglevel != AV_LOG_INFO &&
419 ebur128->loglevel != AV_LOG_VERBOSE) {412 ebur128->loglevel != AV_LOG_VERBOSE) {
420 if (ebur128->do_video || ebur128->metadata)413 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
111 return ret;111 return ret;
112}112}
113 113
114static const char *const shorthand[] = { "mode", NULL };
115
116#if CONFIG_APERMS_FILTER114#if CONFIG_APERMS_FILTER
117 115
118#define aperms_options options116#define aperms_options options
@@ -143,7 +141,6 @@ AVFilter avfilter_af_aperms = { · 24 unmodified lines
143 .inputs = aperms_inputs,141 .inputs = aperms_inputs,
144 .outputs = aperms_outputs,142 .outputs = aperms_outputs,
145 .priv_class = &aperms_class,143 .priv_class = &aperms_class,
146 .shorthand = shorthand,
147};144};
148#endif /* CONFIG_APERMS_FILTER */145#endif /* CONFIG_APERMS_FILTER */
149 146
@@ -177,6 +174,5 @@ AVFilter avfilter_vf_perms = { · 27 unmodified lines
177 .inputs = perms_inputs,174 .inputs = perms_inputs,
178 .outputs = perms_outputs,175 .outputs = perms_outputs,
179 .priv_class = &perms_class,176 .priv_class = &perms_class,
180 .shorthand = shorthand,
181};177};
182#endif /* CONFIG_PERMS_FILTER */178#endif /* CONFIG_PERMS_FILTER */
libavfilter/vf_colormatrix.c+0−3
@@ -375,8 +375,6 @@ static const AVFilterPad colormatrix_outputs[] = { · 374 unmodified lines
375 { NULL }375 { NULL }
376};376};
377 377
378static const char *const shorthand[] = { "src", "dst", NULL };
379
380AVFilter avfilter_vf_colormatrix = {378AVFilter avfilter_vf_colormatrix = {
381 .name = "colormatrix",379 .name = "colormatrix",
382 .description = NULL_IF_CONFIG_SMALL("Convert color matrix."),380 .description = NULL_IF_CONFIG_SMALL("Convert color matrix."),
@@ -387,5 +385,4 @@ AVFilter avfilter_vf_colormatrix = { · 4 unmodified lines
387 .inputs = colormatrix_inputs,385 .inputs = colormatrix_inputs,
388 .outputs = colormatrix_outputs,386 .outputs = colormatrix_outputs,
389 .priv_class = &colormatrix_class,387 .priv_class = &colormatrix_class,
390 .shorthand = shorthand,
391};388};
libavfilter/vf_curves.c+8−10
@@ -59,14 +59,8 @@ typedef struct { · 58 unmodified lines
59#define OFFSET(x) offsetof(CurvesContext, x)59#define OFFSET(x) offsetof(CurvesContext, x)
60#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM60#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
61static const AVOption curves_options[] = {61static 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 },
69 { "preset", "select a color curves preset", OFFSET(preset), AV_OPT_TYPE_INT, {.i64=PRESET_NONE}, PRESET_NONE, NB_PRESETS-1, FLAGS, "preset_name" },62 { "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" },
70 { "color_negative", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_COLOR_NEGATIVE}, INT_MIN, INT_MAX, FLAGS, "preset_name" },64 { "color_negative", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_COLOR_NEGATIVE}, INT_MIN, INT_MAX, FLAGS, "preset_name" },
71 { "cross_process", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_CROSS_PROCESS}, INT_MIN, INT_MAX, FLAGS, "preset_name" },65 { "cross_process", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_CROSS_PROCESS}, INT_MIN, INT_MAX, FLAGS, "preset_name" },
72 { "darker", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_DARKER}, INT_MIN, INT_MAX, FLAGS, "preset_name" },66 { "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
77 { "negative", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_NEGATIVE}, INT_MIN, INT_MAX, FLAGS, "preset_name" },71 { "negative", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_NEGATIVE}, INT_MIN, INT_MAX, FLAGS, "preset_name" },
78 { "strong_contrast", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_STRONG_CONTRAST}, INT_MIN, INT_MAX, FLAGS, "preset_name" },72 { "strong_contrast", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_STRONG_CONTRAST}, INT_MIN, INT_MAX, FLAGS, "preset_name" },
79 { "vintage", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_VINTAGE}, INT_MIN, INT_MAX, FLAGS, "preset_name" },73 { "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 },
80 { NULL }81 { NULL }
81};82};
82 83
@@ -447,8 +448,6 @@ static const AVFilterPad curves_outputs[] = { · 364 unmodified lines
447 { NULL }448 { NULL }
448};449};
449 450
450static const char *const shorthand[] = { "preset", NULL };
451
452AVFilter avfilter_vf_curves = {451AVFilter avfilter_vf_curves = {
453 .name = "curves",452 .name = "curves",
454 .description = NULL_IF_CONFIG_SMALL("Adjust components curves."),453 .description = NULL_IF_CONFIG_SMALL("Adjust components curves."),
@@ -458,5 +457,4 @@ AVFilter avfilter_vf_curves = { · 3 unmodified lines
458 .inputs = curves_inputs,457 .inputs = curves_inputs,
459 .outputs = curves_outputs,458 .outputs = curves_outputs,
460 .priv_class = &curves_class,459 .priv_class = &curves_class,
461 .shorthand = shorthand,
462};460};
libavfilter/vf_edgedetect.c+0−7
@@ -52,15 +52,8 @@ AVFILTER_DEFINE_CLASS(edgedetect); · 51 unmodified lines
52 52
53static av_cold int init(AVFilterContext *ctx, const char *args)53static av_cold int init(AVFilterContext *ctx, const char *args)
54{54{
55 int ret;
56 EdgeDetectContext *edgedetect = ctx->priv;55 EdgeDetectContext *edgedetect = ctx->priv;
57 56
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
64 edgedetect->low_u8 = edgedetect->low * 255. + .5;57 edgedetect->low_u8 = edgedetect->low * 255. + .5;
65 edgedetect->high_u8 = edgedetect->high * 255. + .5;58 edgedetect->high_u8 = edgedetect->high * 255. + .5;
66 return 0;59 return 0;
libavfilter/vf_geq.c+0−3
@@ -228,8 +228,6 @@ static const AVFilterPad geq_outputs[] = { · 227 unmodified lines
228 { NULL }228 { NULL }
229};229};
230 230
231static const char *const shorthand[] = { "lum_expr", "cb_expr", "cr_expr", "alpha_expr", NULL };
232
233AVFilter avfilter_vf_geq = {231AVFilter avfilter_vf_geq = {
234 .name = "geq",232 .name = "geq",
235 .description = NULL_IF_CONFIG_SMALL("Apply generic equation to each pixel."),233 .description = NULL_IF_CONFIG_SMALL("Apply generic equation to each pixel."),
@@ -240,5 +238,4 @@ AVFilter avfilter_vf_geq = { · 4 unmodified lines
240 .inputs = geq_inputs,238 .inputs = geq_inputs,
241 .outputs = geq_outputs,239 .outputs = geq_outputs,
242 .priv_class = &geq_class,240 .priv_class = &geq_class,
243 .shorthand = shorthand,
244};241};
libavfilter/vf_pp.c+14−4
@@ -31,21 +31,29 @@ · 30 unmodified lines
31#include "libpostproc/postprocess.h"31#include "libpostproc/postprocess.h"
32 32
33typedef struct {33typedef struct {
34 const AVClass *class;
35 char *subfilters;
34 int mode_id;36 int mode_id;
35 pp_mode *modes[PP_QUALITY_MAX + 1];37 pp_mode *modes[PP_QUALITY_MAX + 1];
36 void *pp_ctx;38 void *pp_ctx;
37} PPFilterContext;39} PPFilterContext;
38 40
41#define OFFSET(x) offsetof(PPFilterContext, x)
42#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
43static const AVOption pp_options[] = {
44 { "subfilters", "set postprocess subfilters", OFFSET(subfilters), AV_OPT_TYPE_STRING, {.str="de"}, .flags = FLAGS },
45 { NULL }
46};
47
48AVFILTER_DEFINE_CLASS(pp);
49
39static av_cold int pp_init(AVFilterContext *ctx, const char *args)50static av_cold int pp_init(AVFilterContext *ctx, const char *args)
40{51{
41 int i;52 int i;
42 PPFilterContext *pp = ctx->priv;53 PPFilterContext *pp = ctx->priv;
43 54
44 if (!args || !*args)
45 args = "de";
46
47 for (i = 0; i <= PP_QUALITY_MAX; i++) {55 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);
49 if (!pp->modes[i])57 if (!pp->modes[i])
50 return AVERROR_EXTERNAL;58 return AVERROR_EXTERNAL;
51 }59 }
@@ -171,4 +179,6 @@ AVFilter avfilter_vf_pp = { · 119 unmodified lines
171 .inputs = pp_inputs,179 .inputs = pp_inputs,
172 .outputs = pp_outputs,180 .outputs = pp_outputs,
173 .process_command = pp_process_command,181 .process_command = pp_process_command,
182 .priv_class = &pp_class,
183
174};184};
libavfilter/vf_subtitles.c+0−4
@@ -201,8 +201,6 @@ static const AVFilterPad ass_outputs[] = { · 200 unmodified lines
201 { NULL }201 { NULL }
202};202};
203 203
204static const char *const shorthand[] = { "filename", NULL };
205
206#if CONFIG_ASS_FILTER204#if CONFIG_ASS_FILTER
207 205
208static const AVOption ass_options[] = {206static const AVOption ass_options[] = {
@@ -240,7 +238,6 @@ AVFilter avfilter_vf_ass = { · 31 unmodified lines
240 .inputs = ass_inputs,238 .inputs = ass_inputs,
241 .outputs = ass_outputs,239 .outputs = ass_outputs,
242 .priv_class = &ass_class,240 .priv_class = &ass_class,
243 .shorthand = shorthand,
244};241};
245#endif242#endif
246 243
@@ -365,6 +362,5 @@ AVFilter avfilter_vf_subtitles = { · 118 unmodified lines
365 .inputs = ass_inputs,362 .inputs = ass_inputs,
366 .outputs = ass_outputs,363 .outputs = ass_outputs,
367 .priv_class = &subtitles_class,364 .priv_class = &subtitles_class,
368 .shorthand = shorthand,
369};365};
370#endif366#endif
libavfilter/vf_thumbnail.c+0−3
@@ -227,8 +227,6 @@ static const AVFilterPad thumbnail_outputs[] = { · 226 unmodified lines
227 { NULL }227 { NULL }
228};228};
229 229
230static const char *const shorthand[] = { "n", NULL };
231
232AVFilter avfilter_vf_thumbnail = {230AVFilter avfilter_vf_thumbnail = {
233 .name = "thumbnail",231 .name = "thumbnail",
234 .description = NULL_IF_CONFIG_SMALL("Select the most representative frame in a given sequence of consecutive frames."),232 .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
239 .inputs = thumbnail_inputs,237 .inputs = thumbnail_inputs,
240 .outputs = thumbnail_outputs,238 .outputs = thumbnail_outputs,
241 .priv_class = &thumbnail_class,239 .priv_class = &thumbnail_class,
242 .shorthand = shorthand,
243};240};
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
666 char temp[GET_MODE_BUFFER_SIZE];666 char temp[GET_MODE_BUFFER_SIZE];
667 char *p= temp;667 char *p= temp;
668 static const char filterDelimiters[] = ",/";668 static const char filterDelimiters[] = ",/";
669 static const char optionDelimiters[] = ":";669 static const char optionDelimiters[] = ":|";
670 struct PPMode *ppMode;670 struct PPMode *ppMode;
671 char *filterToken;671 char *filterToken;
672 672
libpostproc/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
29#include "libavutil/avutil.h"29#include "libavutil/avutil.h"
30 30
31#define LIBPOSTPROC_VERSION_MAJOR 5231#define LIBPOSTPROC_VERSION_MAJOR 52
32#define LIBPOSTPROC_VERSION_MINOR 232#define LIBPOSTPROC_VERSION_MINOR 3
33#define LIBPOSTPROC_VERSION_MICRO 10033#define LIBPOSTPROC_VERSION_MICRO 100
34 34
35#define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \35#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
52do_lavfi "overlay_yuv444" "split[m],scale=88:72,pad=96:80:4:4[o2];[m]fifo[o1],[o1][o2]overlay=240:16:format=yuv444"52do_lavfi "overlay_yuv444" "split[m],scale=88:72,pad=96:80:4:4[o2];[m]fifo[o1],[o1][o2]overlay=240:16:format=yuv444"
53do_lavfi "pad" "pad=iw*1.5:ih*1.5:iw*0.3:ih*0.2"53do_lavfi "pad" "pad=iw*1.5:ih*1.5:iw*0.3:ih*0.2"
54do_lavfi "pp" "pp=be/hb/vb/tn/l5/al"54do_lavfi "pp" "pp=be/hb/vb/tn/l5/al"
55do_lavfi "pp2" "pp=be/fq:16/h1/v1/lb"55do_lavfi "pp2" "pp=be/fq|16/h1/v1/lb"
56do_lavfi "pp3" "pp=be/fq:8/ha:128:7/va/li"56do_lavfi "pp3" "pp=be/fq|8/ha|128|7/va/li"
57do_lavfi "pp4" "pp=be/ci"57do_lavfi "pp4" "pp=be/ci"
58do_lavfi "pp5" "pp=md"58do_lavfi "pp5" "pp=md"
59do_lavfi "pp6" "pp=be/fd"59do_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