diff options
author | Clément Bœsch <ubitux@gmail.com> | 2013-03-26 00:00:15 +0100 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2013-03-26 00:04:06 +0100 |
commit | 183f3450fda08ecccd824c1e44936c6c0a7262e4 (patch) | |
tree | d0ab488fe745b85b93c40974f595f483aeced421 | |
parent | dc65d784df4071b772d6f6967fa79767d6ad4fae (diff) | |
download | ffmpeg-183f3450fda08ecccd824c1e44936c6c0a7262e4.tar.gz |
lavfi/curves: support preset shorthand.
-rw-r--r-- | doc/filters.texi | 12 | ||||
-rw-r--r-- | libavfilter/version.h | 2 | ||||
-rw-r--r-- | libavfilter/vf_curves.c | 10 | ||||
-rw-r--r-- | tests/fate/filter.mak | 2 |
4 files changed, 15 insertions, 11 deletions
diff --git a/doc/filters.texi b/doc/filters.texi index 94fc6f3df5..450f6ab1f2 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -2328,8 +2328,10 @@ If there is no key point defined in @code{x=0}, the filter will automatically insert a @var{(0;0)} point. In the same way, if there is no key point defined in @code{x=1}, the filter will automatically insert a @var{(1;1)} point. -The filter accepts parameters as a list of @var{key}=@var{value} pairs, -separated by ":". +The filter accepts parameters as a list of @var{key}=@var{value} +pairs, separated by ":". If the key of the first options is omitted, +the arguments are interpreted according to the syntax +curves[=@var{preset}]. A description of the accepted parameters follows. @@ -2390,6 +2392,12 @@ The previous example can also be achieved with the associated built-in preset: @example curves=preset=vintage @end example + +@item +Or simply: +@example +curves=vintage +@end example @end itemize @section decimate diff --git a/libavfilter/version.h b/libavfilter/version.h index d0ed722c19..ce6d874310 100644 --- a/libavfilter/version.h +++ b/libavfilter/version.h @@ -30,7 +30,7 @@ #define LIBAVFILTER_VERSION_MAJOR 3 #define LIBAVFILTER_VERSION_MINOR 48 -#define LIBAVFILTER_VERSION_MICRO 103 +#define LIBAVFILTER_VERSION_MICRO 104 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ LIBAVFILTER_VERSION_MINOR, \ diff --git a/libavfilter/vf_curves.c b/libavfilter/vf_curves.c index d83b7024f0..6137262d54 100644 --- a/libavfilter/vf_curves.c +++ b/libavfilter/vf_curves.c @@ -287,12 +287,6 @@ static av_cold int init(AVFilterContext *ctx, const char *args) CurvesContext *curves = ctx->priv; struct keypoint *comp_points[NB_COMP] = {0}; - curves->class = &curves_class; - av_opt_set_defaults(curves); - - if ((ret = av_set_options_string(curves, args, "=", ":")) < 0) - return ret; - if (curves->preset) { char **pts = curves->comp_points_str; if (pts[0] || pts[1] || pts[2]) { @@ -354,7 +348,6 @@ static av_cold int init(AVFilterContext *ctx, const char *args) } } - av_opt_free(curves); return 0; } @@ -424,6 +417,8 @@ static const AVFilterPad curves_outputs[] = { { NULL } }; +static const char *const shorthand[] = { "preset", NULL }; + AVFilter avfilter_vf_curves = { .name = "curves", .description = NULL_IF_CONFIG_SMALL("Adjust components curves."), @@ -433,4 +428,5 @@ AVFilter avfilter_vf_curves = { .inputs = curves_inputs, .outputs = curves_outputs, .priv_class = &curves_class, + .shorthand = shorthand, }; diff --git a/tests/fate/filter.mak b/tests/fate/filter.mak index 23724b1c1e..4b1b056a8b 100644 --- a/tests/fate/filter.mak +++ b/tests/fate/filter.mak @@ -48,7 +48,7 @@ FATE_HQDN3D += fate-filter-hqdn3d fate-filter-hqdn3d: CMD = framecrc -idct simple -i $(SAMPLES)/smjpeg/scenwin.mjpg -vf perms=random,hqdn3d -an FATE_FILTER-$(call ALLYES, SMJPEG_DEMUXER MJPEG_DECODER PERMS_FILTER HQDN3D_FILTER) += $(FATE_HQDN3D) -fate-filter-curves: CMD = framecrc -i $(SAMPLES)/utvideo/utvideo_rgb_median.avi -vf perms=random,curves=preset=vintage +fate-filter-curves: CMD = framecrc -i $(SAMPLES)/utvideo/utvideo_rgb_median.avi -vf perms=random,curves=vintage FATE_FILTER-$(call ALLYES, UTVIDEO_DECODER AVI_DEMUXER PERMS_FILTER CURVES_FILTER) += fate-filter-curves FATE_GRADFUN += fate-filter-gradfun |