FFmpeg
vf_vignette.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Clément Bœsch
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #include <float.h> /* DBL_MAX */
22 
23 #include "libavutil/opt.h"
24 #include "libavutil/eval.h"
25 #include "libavutil/pixdesc.h"
26 #include "avfilter.h"
27 #include "internal.h"
28 #include "video.h"
29 
30 static const char *const var_names[] = {
31  "w", // stream width
32  "h", // stream height
33  "n", // frame count
34  "pts", // presentation timestamp expressed in AV_TIME_BASE units
35  "r", // frame rate
36  "t", // timestamp expressed in seconds
37  "tb", // timebase
38  NULL
39 };
40 
41 enum var_name {
50 };
51 
52 enum EvalMode {
56 };
57 
58 typedef struct VignetteContext {
59  const AVClass *class;
61  int backward;
62  int eval_mode; ///< EvalMode
63 #define DEF_EXPR_FIELDS(name) AVExpr *name##_pexpr; char *name##_expr; double name
64  DEF_EXPR_FIELDS(angle);
65  DEF_EXPR_FIELDS(x0);
66  DEF_EXPR_FIELDS(y0);
67  double var_values[VAR_NB];
68  float *fmap;
70  double dmax;
71  float xscale, yscale;
72  uint32_t dither;
73  int do_dither;
77 
78 #define OFFSET(x) offsetof(VignetteContext, x)
79 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
80 static const AVOption vignette_options[] = {
81  { "angle", "set lens angle", OFFSET(angle_expr), AV_OPT_TYPE_STRING, {.str="PI/5"}, .flags = FLAGS },
82  { "a", "set lens angle", OFFSET(angle_expr), AV_OPT_TYPE_STRING, {.str="PI/5"}, .flags = FLAGS },
83  { "x0", "set circle center position on x-axis", OFFSET(x0_expr), AV_OPT_TYPE_STRING, {.str="w/2"}, .flags = FLAGS },
84  { "y0", "set circle center position on y-axis", OFFSET(y0_expr), AV_OPT_TYPE_STRING, {.str="h/2"}, .flags = FLAGS },
85  { "mode", "set forward/backward mode", OFFSET(backward), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS, .unit = "mode" },
86  { "forward", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 0}, INT_MIN, INT_MAX, FLAGS, .unit = "mode"},
87  { "backward", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 1}, INT_MIN, INT_MAX, FLAGS, .unit = "mode"},
88  { "eval", "specify when to evaluate expressions", OFFSET(eval_mode), AV_OPT_TYPE_INT, {.i64 = EVAL_MODE_INIT}, 0, EVAL_MODE_NB-1, FLAGS, .unit = "eval" },
89  { "init", "eval expressions once during initialization", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_INIT}, .flags = FLAGS, .unit = "eval" },
90  { "frame", "eval expressions for each frame", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_FRAME}, .flags = FLAGS, .unit = "eval" },
91  { "dither", "set dithering", OFFSET(do_dither), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, FLAGS },
92  { "aspect", "set aspect ratio", OFFSET(aspect), AV_OPT_TYPE_RATIONAL, {.dbl = 1}, 0, DBL_MAX, .flags = FLAGS },
93  { NULL }
94 };
95 
96 AVFILTER_DEFINE_CLASS(vignette);
97 
99 {
100  VignetteContext *s = ctx->priv;
101 
102 #define PARSE_EXPR(name) do { \
103  int ret = av_expr_parse(&s->name##_pexpr, s->name##_expr, var_names, \
104  NULL, NULL, NULL, NULL, 0, ctx); \
105  if (ret < 0) { \
106  av_log(ctx, AV_LOG_ERROR, "Unable to parse expression for '" \
107  AV_STRINGIFY(name) "'\n"); \
108  return ret; \
109  } \
110 } while (0)
111 
112  PARSE_EXPR(angle);
113  PARSE_EXPR(x0);
114  PARSE_EXPR(y0);
115  return 0;
116 }
117 
119 {
120  VignetteContext *s = ctx->priv;
121  av_freep(&s->fmap);
122  av_expr_free(s->angle_pexpr);
123  av_expr_free(s->x0_pexpr);
124  av_expr_free(s->y0_pexpr);
125 }
126 
127 static const enum AVPixelFormat pix_fmts[] = {
134 };
135 
136 static double get_natural_factor(const VignetteContext *s, int x, int y)
137 {
138  const int xx = (x - s->x0) * s->xscale;
139  const int yy = (y - s->y0) * s->yscale;
140  const double dnorm = hypot(xx, yy) / s->dmax;
141  if (dnorm > 1) {
142  return 0;
143  } else {
144  const double c = cos(s->angle * dnorm);
145  return (c*c)*(c*c); // do not remove braces, it helps compilers
146  }
147 }
148 
150 {
151  int x, y;
152  float *dst = s->fmap;
153  int dst_linesize = s->fmap_linesize;
154 
155  if (frame) {
156  s->var_values[VAR_N] = inlink->frame_count_out;
157  s->var_values[VAR_T] = TS2T(frame->pts, inlink->time_base);
158  s->var_values[VAR_PTS] = TS2D(frame->pts);
159  } else {
160  s->var_values[VAR_N] = NAN;
161  s->var_values[VAR_T] = NAN;
162  s->var_values[VAR_PTS] = NAN;
163  }
164 
165  s->angle = av_expr_eval(s->angle_pexpr, s->var_values, NULL);
166  s->x0 = av_expr_eval(s->x0_pexpr, s->var_values, NULL);
167  s->y0 = av_expr_eval(s->y0_pexpr, s->var_values, NULL);
168 
169  if (isnan(s->x0) || isnan(s->y0) || isnan(s->angle))
170  s->eval_mode = EVAL_MODE_FRAME;
171 
172  s->angle = av_clipf(s->angle, 0, M_PI_2);
173 
174  if (s->backward) {
175  for (y = 0; y < inlink->h; y++) {
176  for (x = 0; x < inlink->w; x++)
177  dst[x] = 1. / get_natural_factor(s, x, y);
178  dst += dst_linesize;
179  }
180  } else {
181  for (y = 0; y < inlink->h; y++) {
182  for (x = 0; x < inlink->w; x++)
183  dst[x] = get_natural_factor(s, x, y);
184  dst += dst_linesize;
185  }
186  }
187 }
188 
189 static inline double get_dither_value(VignetteContext *s)
190 {
191  double dv = 0;
192  if (s->do_dither) {
193  dv = s->dither / (double)(1LL<<32);
194  s->dither = s->dither * 1664525 + 1013904223;
195  }
196  return dv;
197 }
198 
200 {
201  unsigned x, y, direct = 0;
202  AVFilterContext *ctx = inlink->dst;
203  VignetteContext *s = ctx->priv;
204  AVFilterLink *outlink = ctx->outputs[0];
205  AVFrame *out;
206 
207  if (av_frame_is_writable(in)) {
208  direct = 1;
209  out = in;
210  } else {
211  out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
212  if (!out) {
213  av_frame_free(&in);
214  return AVERROR(ENOMEM);
215  }
217  }
218 
219  if (s->eval_mode == EVAL_MODE_FRAME)
220  update_context(s, inlink, in);
221 
222  if (s->desc->flags & AV_PIX_FMT_FLAG_RGB) {
223  uint8_t *dst = out->data[0];
224  const uint8_t *src = in ->data[0];
225  const float *fmap = s->fmap;
226  const int dst_linesize = out->linesize[0];
227  const int src_linesize = in ->linesize[0];
228  const int fmap_linesize = s->fmap_linesize;
229 
230  for (y = 0; y < inlink->h; y++) {
231  uint8_t *dstp = dst;
232  const uint8_t *srcp = src;
233 
234  for (x = 0; x < inlink->w; x++, dstp += 3, srcp += 3) {
235  const float f = fmap[x];
236 
237  dstp[0] = av_clip_uint8(srcp[0] * f + get_dither_value(s));
238  dstp[1] = av_clip_uint8(srcp[1] * f + get_dither_value(s));
239  dstp[2] = av_clip_uint8(srcp[2] * f + get_dither_value(s));
240  }
241  dst += dst_linesize;
242  src += src_linesize;
243  fmap += fmap_linesize;
244  }
245  } else {
246  int plane;
247 
248  for (plane = 0; plane < 4 && in->data[plane] && in->linesize[plane]; plane++) {
249  uint8_t *dst = out->data[plane];
250  const uint8_t *src = in ->data[plane];
251  const float *fmap = s->fmap;
252  const int dst_linesize = out->linesize[plane];
253  const int src_linesize = in ->linesize[plane];
254  const int fmap_linesize = s->fmap_linesize;
255  const int chroma = plane == 1 || plane == 2;
256  const int hsub = chroma ? s->desc->log2_chroma_w : 0;
257  const int vsub = chroma ? s->desc->log2_chroma_h : 0;
258  const int w = AV_CEIL_RSHIFT(inlink->w, hsub);
259  const int h = AV_CEIL_RSHIFT(inlink->h, vsub);
260 
261  for (y = 0; y < h; y++) {
262  uint8_t *dstp = dst;
263  const uint8_t *srcp = src;
264 
265  for (x = 0; x < w; x++) {
266  const double dv = get_dither_value(s);
267  if (chroma) *dstp++ = av_clip_uint8(fmap[x << hsub] * (*srcp++ - 127) + 127 + dv);
268  else *dstp++ = av_clip_uint8(fmap[x ] * *srcp++ + dv);
269  }
270  dst += dst_linesize;
271  src += src_linesize;
272  fmap += fmap_linesize << vsub;
273  }
274  }
275  }
276 
277  if (!direct)
278  av_frame_free(&in);
279  return ff_filter_frame(outlink, out);
280 }
281 
283 {
284  VignetteContext *s = inlink->dst->priv;
285  AVRational sar = inlink->sample_aspect_ratio;
286 
287  s->desc = av_pix_fmt_desc_get(inlink->format);
288  s->var_values[VAR_W] = inlink->w;
289  s->var_values[VAR_H] = inlink->h;
290  s->var_values[VAR_TB] = av_q2d(inlink->time_base);
291  s->var_values[VAR_R] = inlink->frame_rate.num == 0 || inlink->frame_rate.den == 0 ?
292  NAN : av_q2d(inlink->frame_rate);
293 
294  if (!sar.num || !sar.den)
295  sar.num = sar.den = 1;
296  if (sar.num > sar.den) {
297  s->xscale = av_q2d(av_div_q(sar, s->aspect));
298  s->yscale = 1;
299  } else {
300  s->yscale = av_q2d(av_div_q(s->aspect, sar));
301  s->xscale = 1;
302  }
303  s->dmax = hypot(inlink->w / 2., inlink->h / 2.);
304  av_log(s, AV_LOG_DEBUG, "xscale=%f yscale=%f dmax=%f\n",
305  s->xscale, s->yscale, s->dmax);
306 
307  s->fmap_linesize = FFALIGN(inlink->w, 32);
308  s->fmap = av_malloc_array(s->fmap_linesize, inlink->h * sizeof(*s->fmap));
309  if (!s->fmap)
310  return AVERROR(ENOMEM);
311 
312  if (s->eval_mode == EVAL_MODE_INIT)
314 
315  return 0;
316 }
317 
318 static const AVFilterPad vignette_inputs[] = {
319  {
320  .name = "default",
321  .type = AVMEDIA_TYPE_VIDEO,
322  .filter_frame = filter_frame,
323  .config_props = config_props,
324  },
325 };
326 
328  .name = "vignette",
329  .description = NULL_IF_CONFIG_SMALL("Make or reverse a vignette effect."),
330  .priv_size = sizeof(VignetteContext),
331  .init = init,
332  .uninit = uninit,
336  .priv_class = &vignette_class,
338 };
var_names
static const char *const var_names[]
Definition: vf_vignette.c:30
VignetteContext::fmap_linesize
int fmap_linesize
Definition: vf_vignette.c:69
ff_get_video_buffer
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition: video.c:112
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_vignette.c:118
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
opt.h
var_name
var_name
Definition: noise.c:46
VAR_T
@ VAR_T
Definition: vf_vignette.c:47
out
FILE * out
Definition: movenc.c:54
vignette_options
static const AVOption vignette_options[]
Definition: vf_vignette.c:80
VAR_NB
@ VAR_NB
Definition: vf_vignette.c:49
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1018
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2962
av_div_q
AVRational av_div_q(AVRational b, AVRational c)
Divide one rational by another.
Definition: rational.c:88
VignetteContext
Definition: vf_vignette.c:58
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: internal.h:162
inlink
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
Definition: filter_design.txt:212
VAR_TB
@ VAR_TB
Definition: vf_vignette.c:48
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:130
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:344
pixdesc.h
AVFrame::pts
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition: frame.h:456
w
uint8_t w
Definition: llviddspenc.c:38
VignetteContext::var_values
double var_values[VAR_NB]
Definition: vf_vignette.c:67
VignetteContext::do_dither
int do_dither
Definition: vf_vignette.c:73
M_PI_2
#define M_PI_2
Definition: mathematics.h:73
AVOption
AVOption.
Definition: opt.h:346
chroma
static av_always_inline void chroma(WaveformContext *s, AVFrame *in, AVFrame *out, int component, int intensity, int offset_y, int offset_x, int column, int mirror, int jobnr, int nb_jobs)
Definition: vf_waveform.c:1639
get_natural_factor
static double get_natural_factor(const VignetteContext *s, int x, int y)
Definition: vf_vignette.c:136
float.h
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:76
AV_PIX_FMT_YUV440P
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:106
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:170
AV_OPT_TYPE_RATIONAL
@ AV_OPT_TYPE_RATIONAL
Definition: opt.h:240
video.h
vignette_inputs
static const AVFilterPad vignette_inputs[]
Definition: vf_vignette.c:318
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:365
FLAGS
#define FLAGS
Definition: vf_vignette.c:79
hsub
static void hsub(htype *dst, const htype *src, int bins)
Definition: vf_median.c:73
ff_vf_vignette
const AVFilter ff_vf_vignette
Definition: vf_vignette.c:327
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_vignette.c:98
VignetteContext::dmax
double dmax
Definition: vf_vignette.c:70
VignetteContext::DEF_EXPR_FIELDS
DEF_EXPR_FIELDS(angle)
av_expr_free
void av_expr_free(AVExpr *e)
Free a parsed expression previously created with av_expr_parse().
Definition: eval.c:359
AVRational::num
int num
Numerator.
Definition: rational.h:59
OFFSET
#define OFFSET(x)
Definition: vf_vignette.c:78
AVFilterPad
A filter pad used for either input or output.
Definition: internal.h:33
TS2T
#define TS2T(ts, tb)
Definition: internal.h:259
av_cold
#define av_cold
Definition: attributes.h:90
ff_video_default_filterpad
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
Definition: video.c:37
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: vf_vignette.c:127
s
#define s(width, name)
Definition: cbs_vp9.c:198
AV_CEIL_RSHIFT
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:58
av_q2d
static double av_q2d(AVRational a)
Convert an AVRational to a double.
Definition: rational.h:104
VAR_N
@ VAR_N
Definition: vf_vignette.c:44
AV_LOG_DEBUG
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:201
ctx
AVFormatContext * ctx
Definition: movenc.c:48
av_expr_eval
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
Evaluate a previously parsed expression.
Definition: eval.c:793
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:73
VignetteContext::xscale
float xscale
Definition: vf_vignette.c:71
NAN
#define NAN
Definition: mathematics.h:115
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
frame
static AVFrame * frame
Definition: demux_decode.c:54
EVAL_MODE_INIT
@ EVAL_MODE_INIT
Definition: vf_vignette.c:53
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
TS2D
#define TS2D(ts)
Definition: internal.h:258
NULL
#define NULL
Definition: coverity.c:32
av_frame_copy_props
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition: frame.c:679
VignetteContext::yscale
float yscale
Definition: vf_vignette.c:71
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
isnan
#define isnan(x)
Definition: libm.h:340
VAR_H
@ VAR_H
Definition: vf_vignette.c:43
double
double
Definition: af_crystalizer.c:131
av_clipf
av_clipf
Definition: af_crystalizer.c:121
VignetteContext::dither
uint32_t dither
Definition: vf_vignette.c:72
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:81
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
VAR_R
@ VAR_R
Definition: vf_vignette.c:46
eval.h
f
f
Definition: af_crystalizer.c:121
AV_PIX_FMT_RGB24
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:75
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:106
EVAL_MODE_FRAME
@ EVAL_MODE_FRAME
Definition: vf_vignette.c:54
PARSE_EXPR
#define PARSE_EXPR(name)
AV_PIX_FMT_FLAG_RGB
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
Definition: pixdesc.h:136
config_props
static int config_props(AVFilterLink *inlink)
Definition: vf_vignette.c:282
hypot
static av_const double hypot(double x, double y)
Definition: libm.h:366
av_frame_is_writable
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
Definition: frame.c:615
VignetteContext::scale
AVRational scale
Definition: vf_vignette.c:75
internal.h
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:147
EVAL_MODE_NB
@ EVAL_MODE_NB
Definition: vf_vignette.c:55
VignetteContext::eval_mode
int eval_mode
EvalMode.
Definition: vf_vignette.c:62
AVFILTER_DEFINE_CLASS
AVFILTER_DEFINE_CLASS(vignette)
av_malloc_array
#define av_malloc_array(a, b)
Definition: tableprint_vlc.h:31
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_vignette.c:199
VignetteContext::aspect
AVRational aspect
Definition: vf_vignette.c:74
EvalMode
EvalMode
Definition: af_volume.h:39
AVFilterPad::name
const char * name
Pad name.
Definition: internal.h:39
VignetteContext::desc
const AVPixFmtDescriptor * desc
Definition: vf_vignette.c:60
AVFilter
Filter definition.
Definition: avfilter.h:166
VAR_W
@ VAR_W
Definition: vf_vignette.c:42
AVRational::den
int den
Denominator.
Definition: rational.h:60
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
avfilter.h
update_context
static void update_context(VignetteContext *s, AVFilterLink *inlink, AVFrame *frame)
Definition: vf_vignette.c:149
av_clip_uint8
#define av_clip_uint8
Definition: common.h:104
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:78
AVFilterContext
An instance of a filter.
Definition: avfilter.h:407
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:77
VignetteContext::fmap
float * fmap
Definition: vf_vignette.c:68
VignetteContext::backward
int backward
Definition: vf_vignette.c:61
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:69
FFALIGN
#define FFALIGN(x, a)
Definition: macros.h:78
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:251
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:34
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
AV_PIX_FMT_YUV411P
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:80
AVFrame::linesize
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Definition: frame.h:389
VAR_PTS
@ VAR_PTS
Definition: vf_vignette.c:45
AV_PIX_FMT_YUV410P
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:79
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
get_dither_value
static double get_dither_value(VignetteContext *s)
Definition: vf_vignette.c:189
h
h
Definition: vp9dsp_template.c:2038
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:239
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:244