[PATCH] lavfi/WIP: vignette filter.
--- An ugly encode showing a bit the feature: http://lucy.pkh.me/gonenutty-vintage-vignette.webm The filtergraph used here was something like this (I don't remember the exact settings: curves=vintage,vignette=edge_dist_factor=3:r1=(0.02*random(1)+0.79)*h/2:r2=(0.02*random(1)+0.79)*w/2 Note that it's still far from perfect. I have an annoying halo problem, which can be seen in bright scenes: http://imgur.com/2wyhQlR This bright halo in the center is actually where the picture starts to get darker linearly (it's the ellipse defined by r1, r2). Unfortunately, the eye notices it fairly well when it's bright. I don't really know how to solve that. One idea I had was to start darkening starting at the origin instead of the outside of an ellipse, with an exponential or something. Maybe some dithering could also help. Any suggestion? --- doc/filters.texi | 50 +++++++++ libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/vf_vignette.c | 273 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 325 insertions(+) create mode 100644 libavfilter/vf_vignette.c diff --git a/doc/filters.texi b/doc/filters.texi index 75e8a72..aaf1548 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -5582,6 +5582,56 @@ Flip the input video vertically. ffmpeg -i in.avi -vf "vflip" out.avi @end example +@section vignette + +Make a "vignette" effect on the video by adding shadows in the corners. + +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 syntax +@var{r1}:@var{r2}:@var{x0}:@var{y0}. + +The description of the accepted parameters follows. + +@table @option +@item r1, r2 +Set vertical and horizontal radius expressions of the "bright" ellipse. Outside +the ellipse, the brightness starts to decrease. Default are respectively +@code{0.9*h/2} and @code{0.9*w/2}. + +@item x0, y0 +Set the coordinates of the center of the ellipse. Default are respectively +@code{w/2} and @code{h/2}. + +@item edge_dist_factor +Set the distance factor between the edges and the ellipse. This allows to +control the strength of the darkness on the edges. A high value will make the +borders darker quickly while a low value will make it smoother. Default is @code{2}. +@end table + +The @var{r1}, @var{r2}, @var{x0} and @var{x0} parameters are expressions +containing the following constants: + +@table @option +@item w, h +video width and height + +@item n +frame count of the input frame starting from 0 + +@item pts +presentation timestamp of the input frame expressed in time base units + +@item r +frame rate of the input video, NAN if the input frame rate is unknown + +@item t +timestamp expressed in seconds, NAN if the input timestamp is unknown + +@item tb +time base of the input video +@end table + @section yadif Deinterlace the input video ("yadif" means "yet another deinterlacing diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 277ff71..5451e68 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -169,6 +169,7 @@ OBJS-$(CONFIG_TINTERLACE_FILTER) += vf_tinterlace.o OBJS-$(CONFIG_TRANSPOSE_FILTER) += vf_transpose.o OBJS-$(CONFIG_UNSHARP_FILTER) += vf_unsharp.o OBJS-$(CONFIG_VFLIP_FILTER) += vf_vflip.o +OBJS-$(CONFIG_VIGNETTE_FILTER) += vf_vignette.o OBJS-$(CONFIG_YADIF_FILTER) += vf_yadif.o OBJS-$(CONFIG_CELLAUTO_FILTER) += vsrc_cellauto.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 4972322..53f740b 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -164,6 +164,7 @@ void avfilter_register_all(void) REGISTER_FILTER(TRANSPOSE, transpose, vf); REGISTER_FILTER(UNSHARP, unsharp, vf); REGISTER_FILTER(VFLIP, vflip, vf); + REGISTER_FILTER(VIGNETTE, vignette, vf); REGISTER_FILTER(YADIF, yadif, vf); REGISTER_FILTER(CELLAUTO, cellauto, vsrc); diff --git a/libavfilter/vf_vignette.c b/libavfilter/vf_vignette.c new file mode 100644 index 0000000..743b194 --- /dev/null +++ b/libavfilter/vf_vignette.c @@ -0,0 +1,273 @@ +/* + * Copyright (c) 2013 Clément Bœsch + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/opt.h" +#include "libavutil/eval.h" +#include "libavutil/avassert.h" +#include "libavutil/pixdesc.h" +#include "avfilter.h" +#include "formats.h" +#include "internal.h" +#include "video.h" + +static const char *const var_names[] = { + "w", // stream width + "h", // stream height + "n", // frame count + "pts", // presentation timestamp expressed in AV_TIME_BASE units + "r", // frame rate + "t", // timestamp expressed in seconds + "tb", // timebase + NULL +}; + +enum var_name { + VAR_W, + VAR_H, + VAR_N, + VAR_PTS, + VAR_R, + VAR_T, + VAR_TB, + VAR_NB +}; + +typedef struct { + const AVClass *class; + const AVPixFmtDescriptor *desc; +#define DEF_EXPR_FIELDS(name) AVExpr *name##_pexpr; char *name##_expr; int name + DEF_EXPR_FIELDS(r1); + DEF_EXPR_FIELDS(r2); + DEF_EXPR_FIELDS(x0); + DEF_EXPR_FIELDS(y0); + double edge_dist_factor; + double var_values[VAR_NB]; +} VignetteContext; + +#define OFFSET(x) offsetof(VignetteContext, x) +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM +static const AVOption vignette_options[] = { + { "r1", "set vertical radius of the ellipse", OFFSET(r1_expr), AV_OPT_TYPE_STRING, {.str="0.9*h/2"}, .flags = FLAGS }, + { "r2", "set horizontal radius of the ellipse", OFFSET(r2_expr), AV_OPT_TYPE_STRING, {.str="0.9*w/2"}, .flags = FLAGS }, + { "x0", "set ellipse center pos on x-axis", OFFSET(x0_expr), AV_OPT_TYPE_STRING, {.str="w/2"}, .flags = FLAGS }, + { "y0", "set ellipse center pos on y-axis", OFFSET(y0_expr), AV_OPT_TYPE_STRING, {.str="h/2"}, .flags = FLAGS }, + { "edge_dist_factor", "set distance factor between the edges and the ellipse", OFFSET(edge_dist_factor), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 1, 1000, .flags = FLAGS }, + { NULL } +}; + +AVFILTER_DEFINE_CLASS(vignette); + +static av_cold int init(AVFilterContext *ctx, const char *args) +{ + int ret; + VignetteContext *vignette = ctx->priv; + + if ((ret = av_expr_parse(&vignette->r1_pexpr, vignette->r1_expr, var_names, NULL, NULL, NULL, NULL, 0, ctx)) < 0 || + (ret = av_expr_parse(&vignette->r2_pexpr, vignette->r2_expr, var_names, NULL, NULL, NULL, NULL, 0, ctx)) < 0 || + (ret = av_expr_parse(&vignette->x0_pexpr, vignette->x0_expr, var_names, NULL, NULL, NULL, NULL, 0, ctx)) < 0 || + (ret = av_expr_parse(&vignette->y0_pexpr, vignette->y0_expr, var_names, NULL, NULL, NULL, NULL, 0, ctx)) < 0) + return ret; + return 0; +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + VignetteContext *vignette = ctx->priv; + av_expr_free(vignette->x0_pexpr); + av_expr_free(vignette->y0_pexpr); + av_expr_free(vignette->r1_pexpr); + av_expr_free(vignette->r2_pexpr); +} + +static int query_formats(AVFilterContext *ctx) +{ + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P, + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + AV_PIX_FMT_GRAY8, + AV_PIX_FMT_NONE + }; + ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); + return 0; +} + +#define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts)) +#define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts) * av_q2d(tb)) + +static double get_brightness_factor(const VignetteContext *vignette, int x, int y) +{ + double d, r; + double xx = x - vignette->x0; + double yy = y - vignette->y0; + + if (vignette->r1 > vignette->r2) { + xx *= (double)vignette->r1 / vignette->r2; + r = vignette->r2; + } else { + yy *= (double)vignette->r2 / vignette->r1; + r = vignette->r1; + } + d = sqrt(xx*xx + yy*yy); + if (d > r) { + const double d2 = (vignette->edge_dist_factor - 1) * r; + const double f = 1 - (d - r) / (d2 ? d2 : 1); + av_assert0(f <= 1); + return f < 0 ? 0 : f; + } else { + return 1; + } +} + +static int filter_frame(AVFilterLink *inlink, AVFrame *in) +{ + int x, y, direct = 0; + AVFilterContext *ctx = inlink->dst; + VignetteContext *vignette = ctx->priv; + AVFilterLink *outlink = inlink->dst->outputs[0]; + AVFrame *out; + + if (av_frame_is_writable(in)) { + direct = 1; + out = in; + } else { + out = ff_get_video_buffer(outlink, outlink->w, outlink->h); + if (!out) { + av_frame_free(&in); + return AVERROR(ENOMEM); + } + av_frame_copy_props(out, in); + } + + vignette->var_values[VAR_T] = TS2T(in->pts, inlink->time_base); + vignette->var_values[VAR_PTS] = TS2D(in->pts); + + vignette->r1 = av_expr_eval(vignette->r1_pexpr, vignette->var_values, NULL); + vignette->r2 = av_expr_eval(vignette->r2_pexpr, vignette->var_values, NULL); + vignette->x0 = av_expr_eval(vignette->x0_pexpr, vignette->var_values, NULL); + vignette->y0 = av_expr_eval(vignette->y0_pexpr, vignette->var_values, NULL); + + if (vignette->desc->flags & PIX_FMT_RGB) { + uint8_t *dst = out->data[0]; + const uint8_t *src = in ->data[0]; + const int dst_linesize = out->linesize[0]; + const int src_linesize = in ->linesize[0]; + + for (y = 0; y < inlink->h; y++) { + uint8_t *dstp = dst; + const uint8_t *srcp = src; + + for (x = 0; x < inlink->w; x++, dstp += 3, srcp += 3) { + double f = get_brightness_factor(vignette, x, y); + if (f == 1.) { + if (!direct) + memcpy(dstp, srcp, 3); + } else if (f == 0.) { + memset(dstp, 0, 3); + } else { + dstp[0] = f * srcp[0]; + dstp[1] = f * srcp[1]; + dstp[2] = f * srcp[2]; + } + } + dst += dst_linesize; + src += src_linesize; + } + } else { + int plane; + + for (plane = 0; plane < 4 && in->data[plane]; plane++) { + uint8_t *dst = out->data[plane]; + const uint8_t *src = in ->data[plane]; + const int dst_linesize = out->linesize[plane]; + const int src_linesize = in ->linesize[plane]; + const int hsub = plane == 0 ? 0 : vignette->desc->log2_chroma_w; + const int vsub = plane == 0 ? 0 : vignette->desc->log2_chroma_h; + + for (y = 0; y < inlink->h >> vsub; y++) { + uint8_t *dstp = dst; + const uint8_t *srcp = src; + + for (x = 0; x < inlink->w >> hsub; x++) { + double f = get_brightness_factor(vignette, x << hsub, y << vsub); + if (plane == 0) *dstp++ = f * *srcp++; + else *dstp++ = f * (*srcp++ - 127) + 127; + } + dst += dst_linesize; + src += src_linesize; + } + } + } + + vignette->var_values[VAR_N] += 1; + + if (!direct) + av_frame_free(&in); + + return ff_filter_frame(outlink, out); +} + +static int config_props(AVFilterLink *inlink) +{ + VignetteContext *vignette = inlink->dst->priv; + + vignette->desc = av_pix_fmt_desc_get(inlink->format); + vignette->var_values[VAR_W] = inlink->w; + vignette->var_values[VAR_H] = inlink->h; + vignette->var_values[VAR_N] = 0; + vignette->var_values[VAR_TB] = av_q2d(inlink->time_base); + vignette->var_values[VAR_R] = inlink->frame_rate.num == 0 || inlink->frame_rate.den == 0 ? + NAN : av_q2d(inlink->frame_rate); + return 0; +} + +static const AVFilterPad vignette_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .filter_frame = filter_frame, + .config_props = config_props, + }, + { NULL } +}; + +static const AVFilterPad vignette_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + +static const char *const shorthand[] = { "r1", "r2", "x0", "y0", NULL }; + +AVFilter avfilter_vf_vignette = { + .name = "vignette", + .description = NULL_IF_CONFIG_SMALL("Make a vignette effect."), + .priv_size = sizeof(VignetteContext), + .init = init, + .uninit = uninit, + .query_formats = query_formats, + .inputs = vignette_inputs, + .outputs = vignette_outputs, + .priv_class = &vignette_class, + .shorthand = shorthand, +}; -- 1.8.2
On Thu, Apr 04, 2013 at 05:15:29PM +0200, Clément Bœsch wrote:
--- An ugly encode showing a bit the feature: http://lucy.pkh.me/gonenutty-vintage-vignette.webm
The filtergraph used here was something like this (I don't remember the exact settings: curves=vintage,vignette=edge_dist_factor=3:r1=(0.02*random(1)+0.79)*h/2:r2=(0.02*random(1)+0.79)*w/2
Note that it's still far from perfect. I have an annoying halo problem, which can be seen in bright scenes: http://imgur.com/2wyhQlR
This bright halo in the center is actually where the picture starts to get darker linearly (it's the ellipse defined by r1, r2). Unfortunately, the eye notices it fairly well when it's bright. I don't really know how to solve that. One idea I had was to start darkening starting at the origin instead of the outside of an ellipse, with an exponential or something. Maybe some dithering could also help. Any suggestion?
yes, measssure the actual vignetting of an actual lens and use that. (trivial there are probably hundreads of lens review sites that post pictures of a white wall or so to compare vignetting behavior) or borrow the parameters from some lens vignetting correction tool (check if you legally can do this of course first) also normal vignetting is not based on a elipse but a circle and the sample aspect ratio should be considered also from what ive read a polynom with 3-4 terms is needed to model the vignetting of actual lenses with some degree of accuracy what ive seen used only even terms 1 + a*r^2 + b*r^4 + c*r^6 but i just looked a bit around, iam no expert on the subject ... also a random link i found with google that describes some of the causes of vignetting: http://toothwalker.org/optics/vignetting.html also strictly speaking you need to do this in a linear color space not the common gamma corrected rgb/yuv that is generally passed around sadly the exact curve the camera applied to make an image isnt known so this is tricky PS: in case its not obvious to anyone, adding vignetting and correcting are the same operations just * vs /, so this filter should be double usefull [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The bravest are surely those who have the clearest vision of what is before them, glory and danger alike, and yet notwithstanding go out to meet it. -- Thucydides
On Thu, 4 Apr 2013 20:00:29 +0200, Michael Niedermayer wrote:
On Thu, Apr 04, 2013 at 05:15:29PM +0200, Clément Bœsch wrote: PS: in case its not obvious to anyone, adding vignetting and correcting are the same operations just * vs /, so this filter should be double usefull
so it will improve a recording of a projected video if reversed? :) -compn
On Thu, Apr 04, 2013 at 05:15:29PM +0200, Clément Bœsch wrote: [...] New version attached. -- Clément B.
On date Friday 2013-05-10 18:49:22 +0200, Clément Bœsch encoded:
On Thu, Apr 04, 2013 at 05:15:29PM +0200, Clément Bœsch wrote: [...]
New version attached.
-- Clément B.
From 9c88f51e80929efed15a432d2fb8dab26a77f84e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <ubitux@gmail.com> Date: Tue, 2 Apr 2013 12:48:32 +0200 Subject: [PATCH] lavfi: vignette filter.
TODO: minor bump --- doc/filters.texi | 98 +++++++++++++++ libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/vf_vignette.c | 306 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 406 insertions(+) create mode 100644 libavfilter/vf_vignette.c
diff --git a/doc/filters.texi b/doc/filters.texi index fe38b7f..1866988 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -6667,6 +6667,104 @@ For example, to vertically flip a video with @command{ffmpeg}: ffmpeg -i in.avi -vf "vflip" out.avi @end example
+@section vignette + +Make or reverse a vignette effect. + +The filter accepts the following options: + +@table @option +@item angle, a +Set lens angle expression.
... as a number of radians, or people will invariably try to use silly 1/360 degrees.
+ +The value is clipped in the @code{[0,PI/2]} range. + +Default value: "PI/5"
An explanation of the meaning of this angle would be welcome.
+ +@item x0 +@item y0 +Set center coordinates expressions. Respectively @code{"w/2"} and @code{"h/2"} +by default. + +@item mode +Set forward/backward mode. + +Available modes are: +@table @samp +@item forward +The larger the distance from the central point, the darker the image becomes. + +@item backward +The larger the distance from the central point, the brighter the image becomes. +This can be used to reverse a vignette effect, though there is no automatic +detection to extract the lens @option{angle} and other settings (yet). +@end table + +Default value is @samp{forward}. + +@item eval +Set evaluation mode for the expressions (@option{angle}, @option{x0}, @option{y0}). + +It accepts the following values: +@table @samp +@item init +Evaluate expressions only once during the filter initialization. + +@item frame +Evaluate expressions for each incoming frame. This is way slower than the +@samp{init} mode since it requires all the scalers to be re-computed, but it +allows advanced dynamic expressions. +@end table + +Default value is @samp{init}. +@end table + +@subsection Expressions + +The @option{alpha}, @option{x0} and @option{y0} expressions can contain the +following parameters. + +@table @option +@item w +@item h +input width and height + +@item n +the number of input frame, starting from 0 + +@item pts +the PTS (Presentation TimeStamp) of the filtered video frame, +expressed in @var{TB} units, NAN if undefined + +@item r +frame rate of the input video, NAN if the input frame rate is unknown +
+@item t +the PTS (Presentation TimeStamp) of the filtered video frame, +expressed in seconds, NAN if undefined
technically a time is not a PTS, more accurate: the PTS (Presentation TimeStamp) *time*
+ +@item tb +time base of the input video +@end table + + +@subsection Examples + +@itemize
+@item +Simple strong vignetting effect:
Apply simple ...
+@example +vignette=PI/4 +@end example + +@item +Flickering vignetting:
Apply flickering ...
+@example +vignette='PI/4+random(1)*PI/50':eval=frame +@end example + +@end itemize + @anchor{yadif} @section yadif
diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 73a24dd..a715f91 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -185,6 +185,7 @@ OBJS-$(CONFIG_UNSHARP_FILTER) += vf_unsharp.o OBJS-$(CONFIG_VFLIP_FILTER) += vf_vflip.o OBJS-$(CONFIG_VIDSTABDETECT_FILTER) += vidstabutils.o vf_vidstabdetect.o OBJS-$(CONFIG_VIDSTABTRANSFORM_FILTER) += vidstabutils.o vf_vidstabtransform.o +OBJS-$(CONFIG_VIGNETTE_FILTER) += vf_vignette.o OBJS-$(CONFIG_YADIF_FILTER) += vf_yadif.o
OBJS-$(CONFIG_CELLAUTO_FILTER) += vsrc_cellauto.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index b8f273d..3b6047c 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -182,6 +182,7 @@ void avfilter_register_all(void) REGISTER_FILTER(VFLIP, vflip, vf); REGISTER_FILTER(VIDSTABDETECT, vidstabdetect, vf); REGISTER_FILTER(VIDSTABTRANSFORM, vidstabtransform, vf); + REGISTER_FILTER(VIGNETTE, vignette, vf); REGISTER_FILTER(YADIF, yadif, vf);
REGISTER_FILTER(CELLAUTO, cellauto, vsrc); diff --git a/libavfilter/vf_vignette.c b/libavfilter/vf_vignette.c new file mode 100644 index 0000000..6d92abc --- /dev/null +++ b/libavfilter/vf_vignette.c @@ -0,0 +1,306 @@ +/* + * Copyright (c) 2013 Clément Bœsch + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/opt.h" +#include "libavutil/eval.h" +#include "libavutil/avassert.h" +#include "libavutil/pixdesc.h" +#include "avfilter.h" +#include "formats.h" +#include "internal.h" +#include "video.h" + +static const char *const var_names[] = { + "w", // stream width + "h", // stream height + "n", // frame count + "pts", // presentation timestamp expressed in AV_TIME_BASE units + "r", // frame rate + "t", // timestamp expressed in seconds + "tb", // timebase + NULL +}; + +enum var_name { + VAR_W, + VAR_H, + VAR_N, + VAR_PTS, + VAR_R, + VAR_T, + VAR_TB, + VAR_NB +}; + +typedef struct { + const AVClass *class; + const AVPixFmtDescriptor *desc; + int backward; + enum EvalMode { EVAL_MODE_INIT, EVAL_MODE_FRAME, EVAL_MODE_NB } eval_mode; +#define DEF_EXPR_FIELDS(name) AVExpr *name##_pexpr; char *name##_expr; double name; + DEF_EXPR_FIELDS(a); + DEF_EXPR_FIELDS(x0); + DEF_EXPR_FIELDS(y0); + double var_values[VAR_NB]; + double *fmap; + int fmap_linesize; + double dmax; + double xscale, yscale; +} VignetteContext; + +#define OFFSET(x) offsetof(VignetteContext, x) +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM +static const AVOption vignette_options[] = { + { "angle", "set lens angle", OFFSET(a_expr), AV_OPT_TYPE_STRING, {.str="PI/5"}, .flags = FLAGS }, + { "a", "set lens angle", OFFSET(a_expr), AV_OPT_TYPE_STRING, {.str="PI/5"}, .flags = FLAGS }, + { "x0", "set circle center position on x-axis", OFFSET(x0_expr), AV_OPT_TYPE_STRING, {.str="w/2"}, .flags = FLAGS }, + { "y0", "set circle center position on y-axis", OFFSET(y0_expr), AV_OPT_TYPE_STRING, {.str="h/2"}, .flags = FLAGS }, + { "mode", "set forward/backward mode", OFFSET(backward), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS, "mode" }, + { "forward", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 0}, INT_MIN, INT_MAX, FLAGS, "mode"}, + { "backward", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 1}, INT_MIN, INT_MAX, FLAGS, "mode"}, + { "eval", "specify when to evaluate expressions", OFFSET(eval_mode), AV_OPT_TYPE_INT, {.i64 = EVAL_MODE_INIT}, 0, EVAL_MODE_NB-1, FLAGS, "eval" }, + { "init", "eval expressions once during initialization", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_INIT}, .flags = FLAGS, .unit = "eval" }, + { "frame", "eval expressions for each frame", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_FRAME}, .flags = FLAGS, .unit = "eval" }, + { NULL } +}; + +AVFILTER_DEFINE_CLASS(vignette); +
+static av_cold int init(AVFilterContext *ctx) +{ + int ret; + VignetteContext *s = ctx->priv; + + if ((ret = av_expr_parse(&s->a_pexpr, s->a_expr, var_names, NULL, NULL, NULL, NULL, 0, ctx)) < 0 || + (ret = av_expr_parse(&s->x0_pexpr, s->x0_expr, var_names, NULL, NULL, NULL, NULL, 0, ctx)) < 0 || + (ret = av_expr_parse(&s->y0_pexpr, s->y0_expr, var_names, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
You could create a macro to specify the name of expression which failed.
+ return ret; + return 0; +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + VignetteContext *s = ctx->priv; + av_freep(&s->fmap); + av_expr_free(s->a_pexpr); + av_expr_free(s->x0_pexpr); + av_expr_free(s->y0_pexpr); +} + +static int query_formats(AVFilterContext *ctx) +{ + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P, + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + AV_PIX_FMT_GRAY8, + AV_PIX_FMT_NONE + }; + ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); + return 0; +} + +static double get_natural_factor(const VignetteContext *s, int x, int y) +{ + const int xx = (x - s->x0) * s->xscale; + const int yy = (y - s->y0) * s->yscale; + const double dnorm = hypot(xx, yy) / s->dmax; + if (dnorm > 1) { + return 0; + } else { + const double c = cos(s->a * dnorm); + return (c*c)*(c*c); // XXX: do not remove braces, it helps compilers + } +} +
+#define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts)) +#define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts) * av_q2d(tb))
we may move these to a common header...
+ +static void update_context(VignetteContext *s, AVFilterLink *inlink, AVFrame *frame) +{ + int x, y; + double *dst = s->fmap; + int dst_linesize = s->fmap_linesize; + + if (frame) { + s->var_values[VAR_N] = inlink->frame_count; + s->var_values[VAR_T] = TS2T(frame->pts, inlink->time_base); + s->var_values[VAR_PTS] = TS2D(frame->pts); + } else { + s->var_values[VAR_N] = 0; + s->var_values[VAR_T] = NAN; + s->var_values[VAR_PTS] = NAN; + } + + s->a = av_clipf(av_expr_eval(s->a_pexpr, s->var_values, NULL), 0, M_PI_2); + s->x0 = av_expr_eval(s->x0_pexpr, s->var_values, NULL); + s->y0 = av_expr_eval(s->y0_pexpr, s->var_values, NULL); + + if (s->backward) { + for (y = 0; y < inlink->h; y++) { + for (x = 0; x < inlink->w; x++) + dst[x] = 1. / get_natural_factor(s, x, y); + dst += dst_linesize; + } + } else { + for (y = 0; y < inlink->h; y++) { + for (x = 0; x < inlink->w; x++) + dst[x] = get_natural_factor(s, x, y); + dst += dst_linesize; + } + } +} + +static int filter_frame(AVFilterLink *inlink, AVFrame *in) +{ + unsigned x, y; + AVFilterContext *ctx = inlink->dst; + VignetteContext *s = ctx->priv; + AVFilterLink *outlink = inlink->dst->outputs[0]; + AVFrame *out; + + out = ff_get_video_buffer(outlink, outlink->w, outlink->h); + if (!out) { + av_frame_free(&in); + return AVERROR(ENOMEM); + } + av_frame_copy_props(out, in); + + if (s->eval_mode == EVAL_MODE_FRAME) + update_context(s, inlink, in); + + if (s->desc->flags & PIX_FMT_RGB) { + uint8_t *dst = out->data[0]; + const uint8_t *src = in ->data[0]; + const double *fmap = s->fmap; + const int dst_linesize = out->linesize[0]; + const int src_linesize = in ->linesize[0]; + const int fmap_linesize = s->fmap_linesize; + + for (y = 0; y < inlink->h; y++) { + uint8_t *dstp = dst; + const uint8_t *srcp = src; + + for (x = 0; x < inlink->w; x++, dstp += 3, srcp += 3) { + const double f = fmap[x]; + + dstp[0] = av_clip_uint8(srcp[0] * f); + dstp[1] = av_clip_uint8(srcp[1] * f); + dstp[2] = av_clip_uint8(srcp[2] * f); + } + dst += dst_linesize; + src += src_linesize; + fmap += fmap_linesize; + } + } else { + int plane; + + for (plane = 0; plane < 4 && in->data[plane]; plane++) { + uint8_t *dst = out->data[plane]; + const uint8_t *src = in ->data[plane]; + const double *fmap = s->fmap; + const int dst_linesize = out->linesize[plane]; + const int src_linesize = in ->linesize[plane]; + const int fmap_linesize = s->fmap_linesize; + const int chroma = plane == 1 || plane == 2; + const int hsub = chroma ? s->desc->log2_chroma_w : 0; + const int vsub = chroma ? s->desc->log2_chroma_h : 0; + const int w = FF_CEIL_RSHIFT(inlink->w, hsub); + const int h = FF_CEIL_RSHIFT(inlink->h, vsub); + + for (y = 0; y < h; y++) { + uint8_t *dstp = dst; + const uint8_t *srcp = src; + + for (x = 0; x < w; x++) + if (chroma) *dstp++ = av_clip_uint8(fmap[x << hsub] * (*srcp++ - 127) + 127); + else *dstp++ = av_clip_uint8(fmap[x ] * *srcp++); + dst += dst_linesize; + src += src_linesize; + fmap += fmap_linesize << vsub; + } + } + } + + return ff_filter_frame(outlink, out); +} +
+static int config_props(AVFilterLink *inlink)
nit: move this before filter_frame()
+{ + VignetteContext *s = inlink->dst->priv; + + s->desc = av_pix_fmt_desc_get(inlink->format); + s->var_values[VAR_W] = inlink->w; + s->var_values[VAR_H] = inlink->h; + s->var_values[VAR_TB] = av_q2d(inlink->time_base); + s->var_values[VAR_R] = inlink->frame_rate.num == 0 || inlink->frame_rate.den == 0 ? + NAN : av_q2d(inlink->frame_rate); + + if (inlink->sample_aspect_ratio.num > inlink->sample_aspect_ratio.den) { + s->xscale = av_q2d(inlink->sample_aspect_ratio); + s->yscale = 1; + s->dmax = hypot(inlink->w / 2., s->yscale * inlink->h / 2.); + } else { + s->yscale = av_q2d(inlink->sample_aspect_ratio); + s->xscale = 1; + s->dmax = hypot(s->xscale * inlink->w / 2., inlink->h / 2.); + } + + s->fmap_linesize = FFALIGN(inlink->w, 32);
+ s->fmap = av_malloc(s->fmap_linesize * inlink->h * sizeof(*s->fmap));
check for int overflow?
+ if (!s->fmap) + return AVERROR(ENOMEM); + + if (s->eval_mode == EVAL_MODE_INIT) + update_context(s, inlink, NULL); + + return 0; +} + +static const AVFilterPad vignette_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .filter_frame = filter_frame, + .config_props = config_props, + }, + { NULL } +}; + +static const AVFilterPad vignette_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + +AVFilter avfilter_vf_vignette = { + .name = "vignette", + .description = NULL_IF_CONFIG_SMALL("Make or reverse a vignette effect."), + .priv_size = sizeof(VignetteContext), + .init = init, + .uninit = uninit, + .query_formats = query_formats, + .inputs = vignette_inputs, + .outputs = vignette_outputs, + .priv_class = &vignette_class, +};
No more comments from me, thanks. -- FFmpeg = Fiendish Furious Mega Portable Easy Goblin
On Sun, May 12, 2013 at 03:40:25PM +0200, Stefano Sabatini wrote: [...]
+@table @option +@item angle, a +Set lens angle expression.
... as a number of radians, or people will invariably try to use silly 1/360 degrees.
Added.
+ +The value is clipped in the @code{[0,PI/2]} range. + +Default value: "PI/5"
An explanation of the meaning of this angle would be welcome.
I'm not sure what I could add, it's the lens angle... [...]
+@item t +the PTS (Presentation TimeStamp) of the filtered video frame, +expressed in seconds, NAN if undefined
technically a time is not a PTS, more accurate: the PTS (Presentation TimeStamp) *time*
Added, but note that it was copy/pasted verbatim from another filter (overlay IIRC).
+ +@item tb +time base of the input video +@end table + + +@subsection Examples + +@itemize
+@item +Simple strong vignetting effect:
Apply simple ...
Changed.
+@example +vignette=PI/4 +@end example + +@item +Flickering vignetting:
Apply flickering ...
Formulated differently. [...]
+static av_cold int init(AVFilterContext *ctx) +{ + int ret; + VignetteContext *s = ctx->priv; + + if ((ret = av_expr_parse(&s->a_pexpr, s->a_expr, var_names, NULL, NULL, NULL, NULL, 0, ctx)) < 0 || + (ret = av_expr_parse(&s->x0_pexpr, s->x0_expr, var_names, NULL, NULL, NULL, NULL, 0, ctx)) < 0 || + (ret = av_expr_parse(&s->y0_pexpr, s->y0_expr, var_names, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
You could create a macro to specify the name of expression which failed.
Done. [...]
+#define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts)) +#define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts) * av_q2d(tb))
we may move these to a common header...
Feel free to add it to libavutil/timestamp.h or wherever [...]
+static int config_props(AVFilterLink *inlink)
nit: move this before filter_frame()
I want to keep filter_frame and the 3 functions above together. But I can't move config_props above those 4 functions, so I keep it here. [...] See the new version of the patch is Michael's reply. Thanks for the review. -- Clément B.
On Fri, May 10, 2013 at 06:49:22PM +0200, Clément Bœsch wrote:
On Thu, Apr 04, 2013 at 05:15:29PM +0200, Clément Bœsch wrote: [...]
New version attached. [...]
+typedef struct { + const AVClass *class; + const AVPixFmtDescriptor *desc; + int backward; + enum EvalMode { EVAL_MODE_INIT, EVAL_MODE_FRAME, EVAL_MODE_NB } eval_mode; +#define DEF_EXPR_FIELDS(name) AVExpr *name##_pexpr; char *name##_expr; double name; + DEF_EXPR_FIELDS(a); + DEF_EXPR_FIELDS(x0); + DEF_EXPR_FIELDS(y0); + double var_values[VAR_NB];
+ double *fmap;
isnt double overkill ? [...]
+static double get_natural_factor(const VignetteContext *s, int x, int y) +{ + const int xx = (x - s->x0) * s->xscale; + const int yy = (y - s->y0) * s->yscale; + const double dnorm = hypot(xx, yy) / s->dmax; + if (dnorm > 1) { + return 0; + } else { + const double c = cos(s->a * dnorm); + return (c*c)*(c*c); // XXX: do not remove braces, it helps compilers + } +}
this looks a bit unflexible, how well does this work for removing actual vignetting from pictures taken with actual lenses ?
+ +#define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts)) +#define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts) * av_q2d(tb)) + +static void update_context(VignetteContext *s, AVFilterLink *inlink, AVFrame *frame) +{ + int x, y; + double *dst = s->fmap; + int dst_linesize = s->fmap_linesize; + + if (frame) { + s->var_values[VAR_N] = inlink->frame_count; + s->var_values[VAR_T] = TS2T(frame->pts, inlink->time_base); + s->var_values[VAR_PTS] = TS2D(frame->pts); + } else { + s->var_values[VAR_N] = 0; + s->var_values[VAR_T] = NAN; + s->var_values[VAR_PTS] = NAN; + } + + s->a = av_clipf(av_expr_eval(s->a_pexpr, s->var_values, NULL), 0, M_PI_2); + s->x0 = av_expr_eval(s->x0_pexpr, s->var_values, NULL); + s->y0 = av_expr_eval(s->y0_pexpr, s->var_values, NULL); + + if (s->backward) { + for (y = 0; y < inlink->h; y++) { + for (x = 0; x < inlink->w; x++) + dst[x] = 1. / get_natural_factor(s, x, y); + dst += dst_linesize; + } + } else { + for (y = 0; y < inlink->h; y++) { + for (x = 0; x < inlink->w; x++) + dst[x] = get_natural_factor(s, x, y); + dst += dst_linesize; + } + } +} + +static int filter_frame(AVFilterLink *inlink, AVFrame *in) +{ + unsigned x, y; + AVFilterContext *ctx = inlink->dst; + VignetteContext *s = ctx->priv; + AVFilterLink *outlink = inlink->dst->outputs[0]; + AVFrame *out; + + out = ff_get_video_buffer(outlink, outlink->w, outlink->h); + if (!out) { + av_frame_free(&in); + return AVERROR(ENOMEM); + } + av_frame_copy_props(out, in); + + if (s->eval_mode == EVAL_MODE_FRAME) + update_context(s, inlink, in); + + if (s->desc->flags & PIX_FMT_RGB) { + uint8_t *dst = out->data[0]; + const uint8_t *src = in ->data[0]; + const double *fmap = s->fmap; + const int dst_linesize = out->linesize[0]; + const int src_linesize = in ->linesize[0]; + const int fmap_linesize = s->fmap_linesize; + + for (y = 0; y < inlink->h; y++) { + uint8_t *dstp = dst; + const uint8_t *srcp = src; + + for (x = 0; x < inlink->w; x++, dstp += 3, srcp += 3) { + const double f = fmap[x]; + + dstp[0] = av_clip_uint8(srcp[0] * f); + dstp[1] = av_clip_uint8(srcp[1] * f); + dstp[2] = av_clip_uint8(srcp[2] * f);
i think with just 8bit this kind of filter is prone to banding artifacts without dither [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Many things microsoft did are stupid, but not doing something just because microsoft did it is even more stupid. If everything ms did were stupid they would be bankrupt already.
On Mon, May 13, 2013 at 12:31:54AM +0200, Michael Niedermayer wrote:
On Fri, May 10, 2013 at 06:49:22PM +0200, Clément Bœsch wrote:
On Thu, Apr 04, 2013 at 05:15:29PM +0200, Clément Bœsch wrote: [...]
New version attached. [...]
+typedef struct { + const AVClass *class; + const AVPixFmtDescriptor *desc; + int backward; + enum EvalMode { EVAL_MODE_INIT, EVAL_MODE_FRAME, EVAL_MODE_NB } eval_mode; +#define DEF_EXPR_FIELDS(name) AVExpr *name##_pexpr; char *name##_expr; double name; + DEF_EXPR_FIELDS(a); + DEF_EXPR_FIELDS(x0); + DEF_EXPR_FIELDS(y0); + double var_values[VAR_NB];
+ double *fmap;
isnt double overkill ?
Yeah likely. Replaced with float, same for xscale and yscale.
[...]
+static double get_natural_factor(const VignetteContext *s, int x, int y) +{ + const int xx = (x - s->x0) * s->xscale; + const int yy = (y - s->y0) * s->yscale; + const double dnorm = hypot(xx, yy) / s->dmax; + if (dnorm > 1) { + return 0; + } else { + const double c = cos(s->a * dnorm); + return (c*c)*(c*c); // XXX: do not remove braces, it helps compilers + } +}
this looks a bit unflexible, how well does this work for removing actual vignetting from pictures taken with actual lenses ?
I looked more closely at the lens correction, but it actually looks like it would belong in a separate filter to me. Typically, with lens correction you end up with the following formula: r = a*r^4 + b*r^3 + c*r^2 + d*r input r being the distance from the origin of the lens to the current pixel (radius) and output r is the new radius. Then you likely have to distort the image to achieve the effect; basically "moving pixels" (barrel distortion, or its inverse pincushion) which is not what we are doing in this filter. The cosine 4 formula I use here seems to be the common way of simulating the lightning vignetting effect: https://en.wikipedia.org/wiki/Vignetting more precisely, the Natural Vignetting (which I now mention in the filter's documentation) Another lens filter, with different parameters (a, b, c and d) could re-use the basis of this filter, but I believe it's a different purpose than what I'm trying to achieve here. [...]
+static int filter_frame(AVFilterLink *inlink, AVFrame *in) +{ + unsigned x, y; + AVFilterContext *ctx = inlink->dst; + VignetteContext *s = ctx->priv; + AVFilterLink *outlink = inlink->dst->outputs[0]; + AVFrame *out; + + out = ff_get_video_buffer(outlink, outlink->w, outlink->h); + if (!out) { + av_frame_free(&in); + return AVERROR(ENOMEM); + } + av_frame_copy_props(out, in); + + if (s->eval_mode == EVAL_MODE_FRAME) + update_context(s, inlink, in); + + if (s->desc->flags & PIX_FMT_RGB) { + uint8_t *dst = out->data[0]; + const uint8_t *src = in ->data[0]; + const double *fmap = s->fmap; + const int dst_linesize = out->linesize[0]; + const int src_linesize = in ->linesize[0]; + const int fmap_linesize = s->fmap_linesize; + + for (y = 0; y < inlink->h; y++) { + uint8_t *dstp = dst; + const uint8_t *srcp = src; + + for (x = 0; x < inlink->w; x++, dstp += 3, srcp += 3) { + const double f = fmap[x]; + + dstp[0] = av_clip_uint8(srcp[0] * f); + dstp[1] = av_clip_uint8(srcp[1] * f); + dstp[2] = av_clip_uint8(srcp[2] * f);
i think with just 8bit this kind of filter is prone to banding artifacts without dither
Yep, you are right, I've added some dithering (taken from mandelbrot, thank you). [...] New patch attached. -- Clément B.
On Wed, May 29, 2013 at 02:44:34AM +0200, Clément Bœsch wrote:
On Mon, May 13, 2013 at 12:31:54AM +0200, Michael Niedermayer wrote:
On Fri, May 10, 2013 at 06:49:22PM +0200, Clément Bœsch wrote:
On Thu, Apr 04, 2013 at 05:15:29PM +0200, Clément Bœsch wrote: [...]
New version attached. [...]
+typedef struct { + const AVClass *class; + const AVPixFmtDescriptor *desc; + int backward; + enum EvalMode { EVAL_MODE_INIT, EVAL_MODE_FRAME, EVAL_MODE_NB } eval_mode; +#define DEF_EXPR_FIELDS(name) AVExpr *name##_pexpr; char *name##_expr; double name; + DEF_EXPR_FIELDS(a); + DEF_EXPR_FIELDS(x0); + DEF_EXPR_FIELDS(y0); + double var_values[VAR_NB];
+ double *fmap;
isnt double overkill ?
Yeah likely. Replaced with float, same for xscale and yscale.
[...]
+static double get_natural_factor(const VignetteContext *s, int x, int y) +{ + const int xx = (x - s->x0) * s->xscale; + const int yy = (y - s->y0) * s->yscale; + const double dnorm = hypot(xx, yy) / s->dmax; + if (dnorm > 1) { + return 0; + } else { + const double c = cos(s->a * dnorm); + return (c*c)*(c*c); // XXX: do not remove braces, it helps compilers + } +}
this looks a bit unflexible, how well does this work for removing actual vignetting from pictures taken with actual lenses ?
I looked more closely at the lens correction, but it actually looks like it would belong in a separate filter to me.
Typically, with lens correction you end up with the following formula:
r = a*r^4 + b*r^3 + c*r^2 + d*r
input r being the distance from the origin of the lens to the current pixel (radius) and output r is the new radius. Then you likely have to distort the image to achieve the effect; basically "moving pixels" (barrel distortion, or its inverse pincushion) which is not what we are doing in this filter.
The cosine 4 formula I use here seems to be the common way of simulating the lightning vignetting effect: https://en.wikipedia.org/wiki/Vignetting more precisely, the Natural Vignetting (which I now mention in the filter's documentation)
Another lens filter, with different parameters (a, b, c and d) could re-use the basis of this filter, but I believe it's a different purpose than what I'm trying to achieve here.
fine with me if you prefer. But we still need a more generic vignette filter to fix all types of vignetting that occur on a real lense not just one kind [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you think the mosad wants you dead since a long time then you are either wrong or dead since a long time.
On Thu, May 30, 2013 at 01:58:45AM +0200, Michael Niedermayer wrote: [...]
+static double get_natural_factor(const VignetteContext *s, int x, int y) +{ + const int xx = (x - s->x0) * s->xscale; + const int yy = (y - s->y0) * s->yscale; + const double dnorm = hypot(xx, yy) / s->dmax; + if (dnorm > 1) { + return 0; + } else { + const double c = cos(s->a * dnorm); + return (c*c)*(c*c); // XXX: do not remove braces, it helps compilers + } +}
this looks a bit unflexible, how well does this work for removing actual vignetting from pictures taken with actual lenses ?
I looked more closely at the lens correction, but it actually looks like it would belong in a separate filter to me.
Typically, with lens correction you end up with the following formula:
r = a*r^4 + b*r^3 + c*r^2 + d*r
input r being the distance from the origin of the lens to the current pixel (radius) and output r is the new radius. Then you likely have to distort the image to achieve the effect; basically "moving pixels" (barrel distortion, or its inverse pincushion) which is not what we are doing in this filter.
The cosine 4 formula I use here seems to be the common way of simulating the lightning vignetting effect: https://en.wikipedia.org/wiki/Vignetting more precisely, the Natural Vignetting (which I now mention in the filter's documentation)
Another lens filter, with different parameters (a, b, c and d) could re-use the basis of this filter, but I believe it's a different purpose than what I'm trying to achieve here.
fine with me if you prefer.
Thanks, applied.
But we still need a more generic vignette filter to fix all types of vignetting that occur on a real lense not just one kind
Yes, a lens correction filter could be added, but I believe the logic will be relatively different than this filter. [...] -- Clément B.
participants (4)
-
Clément Bœsch -
compn -
Michael Niedermayer -
Stefano Sabatini