FFmpeg
vf_corr.c
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 /**
20  * @file
21  * Calculate the correlation between two input videos.
22  */
23 
24 #include "libavutil/avstring.h"
25 #include "libavutil/opt.h"
26 #include "libavutil/pixdesc.h"
27 #include "avfilter.h"
28 #include "drawutils.h"
29 #include "framesync.h"
30 #include "internal.h"
31 
32 typedef struct CorrContext {
33  const AVClass *class;
36  uint64_t nb_frames;
37  int is_rgb;
38  uint8_t rgba_map[4];
39  int max[4];
40  char comps[4];
42  int planewidth[4];
43  int planeheight[4];
45  int jobnr, int nb_jobs);
46 } CorrContext;
47 
48 #define OFFSET(x) offsetof(CorrContext, x)
49 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
50 
52  AVDictionary **metadata, const char *key, char comp, float d)
53 {
54  char value[128];
55  snprintf(value, sizeof(value), "%f", d);
56  if (comp) {
57  char key2[128];
58  snprintf(key2, sizeof(key2), "lavfi.%s.%s%s%c",
59  ctx->filter->name, ctx->filter->name, key, comp);
60  av_dict_set(metadata, key2, value, 0);
61  } else {
62  char key2[128];
63  snprintf(key2, sizeof(key2), "lavfi.%s.%s%s",
64  ctx->filter->name, ctx->filter->name, key);
65  av_dict_set(metadata, key2, value, 0);
66  }
67 }
68 
69 #define CORR(type, name) \
70 static void f##name(AVFilterContext *ctx, AVFrame *master, \
71  AVFrame *ref, double *comp_score) \
72 { \
73  CorrContext *s = ctx->priv; \
74  \
75  for (int c = 0; c < s->nb_components; c++) { \
76  const ptrdiff_t linesize1 = master->linesize[c] / \
77  sizeof(type); \
78  const ptrdiff_t linesize2 = ref->linesize[c] / \
79  sizeof(type); \
80  const type *src1 = (const type *)master->data[c]; \
81  const type *src2 = (const type *)ref->data[c]; \
82  const int h = s->planeheight[c]; \
83  const int w = s->planewidth[c]; \
84  const float scale = 1.f / s->max[c]; \
85  uint64_t sum1 = 0, sum2 = 0; \
86  float sum12, sum1q, sum2q; \
87  float sumq, mean1, mean2; \
88  \
89  for (int y = 0; y < h; y++) { \
90  for (int x = 0; x < w; x++) { \
91  sum1 += src1[x]; \
92  sum2 += src2[x]; \
93  } \
94  \
95  src1 += linesize1; \
96  src2 += linesize2; \
97  } \
98  \
99  mean1 = scale * (sum1 /(double)(w * h)); \
100  mean2 = scale * (sum2 /(double)(w * h)); \
101  \
102  src1 = (const type *)master->data[c]; \
103  src2 = (const type *)ref->data[c]; \
104  \
105  sum12 = 0.f; \
106  sum1q = 0.f; \
107  sum2q = 0.f; \
108  \
109  for (int y = 0; y < h; y++) { \
110  for (int x = 0; x < w; x++) { \
111  const float f1 = scale * src1[x] - mean1; \
112  const float f2 = scale * src2[x] - mean2; \
113  \
114  sum12 += f1 * f2; \
115  sum1q += f1 * f1; \
116  sum2q += f2 * f2; \
117  } \
118  \
119  src1 += linesize1; \
120  src2 += linesize2; \
121  } \
122  \
123  sumq = sqrtf(sum1q * sum2q); \
124  if (sumq > 0.f) { \
125  comp_score[c] = av_clipf(sum12 / sumq,-1.f,1.f); \
126  } else { \
127  comp_score[c] = sum1q == sum2q ? 1.f : 0.f; \
128  } \
129  } \
130 }
131 
132 CORR(uint8_t, corr8)
133 CORR(uint16_t, corr16)
134 
135 static int do_corr(FFFrameSync *fs)
136 {
137  AVFilterContext *ctx = fs->parent;
138  CorrContext *s = ctx->priv;
139  AVFrame *master, *ref;
140  double comp_score[4], score = 0.;
141  AVDictionary **metadata;
142  int ret;
143 
145  if (ret < 0)
146  return ret;
147  if (ctx->is_disabled || !ref)
148  return ff_filter_frame(ctx->outputs[0], master);
149  metadata = &master->metadata;
150 
151  if (s->max[0] > 255) {
152  fcorr16(ctx, master, ref, comp_score);
153  } else {
154  fcorr8(ctx, master, ref, comp_score);
155  }
156 
157  for (int c = 0; c < s->nb_components; c++)
158  score += comp_score[c];
159  score /= s->nb_components;
160  s->score += score;
161 
162  s->min_score = fmin(s->min_score, score);
163  s->max_score = fmax(s->max_score, score);
164 
165  for (int c = 0; c < s->nb_components; c++)
166  s->score_comp[c] += comp_score[c];
167  s->nb_frames++;
168 
169  for (int j = 0; j < s->nb_components; j++) {
170  int c = s->is_rgb ? s->rgba_map[j] : j;
171  set_meta(ctx, metadata, ".", s->comps[j], comp_score[c]);
172  }
173  set_meta(ctx, metadata, "_avg", 0, score);
174 
175  return ff_filter_frame(ctx->outputs[0], master);
176 }
177 
179 {
180  CorrContext *s = ctx->priv;
181 
182  s->fs.on_event = do_corr;
183 
184  return 0;
185 }
186 
187 static const enum AVPixelFormat pix_fmts[] = {
189 #define PF_NOALPHA(suf) AV_PIX_FMT_YUV420##suf, AV_PIX_FMT_YUV422##suf, AV_PIX_FMT_YUV444##suf
190 #define PF_ALPHA(suf) AV_PIX_FMT_YUVA420##suf, AV_PIX_FMT_YUVA422##suf, AV_PIX_FMT_YUVA444##suf
191 #define PF(suf) PF_NOALPHA(suf), PF_ALPHA(suf)
192  PF(P), PF(P9), PF(P10), PF_NOALPHA(P12), PF_NOALPHA(P14), PF(P16),
200 };
201 
203 {
205  AVFilterContext *ctx = inlink->dst;
206  CorrContext *s = ctx->priv;
207 
208  s->nb_components = desc->nb_components;
209  if (ctx->inputs[0]->w != ctx->inputs[1]->w ||
210  ctx->inputs[0]->h != ctx->inputs[1]->h) {
211  av_log(ctx, AV_LOG_ERROR, "Width and height of input videos must be same.\n");
212  return AVERROR(EINVAL);
213  }
214 
215  s->is_rgb = ff_fill_rgba_map(s->rgba_map, inlink->format) >= 0;
216  s->comps[0] = s->is_rgb ? 'R' : 'Y' ;
217  s->comps[1] = s->is_rgb ? 'G' : 'U' ;
218  s->comps[2] = s->is_rgb ? 'B' : 'V' ;
219  s->comps[3] = 'A';
220 
221  s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
222  s->planeheight[0] = s->planeheight[3] = inlink->h;
223  s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
224  s->planewidth[0] = s->planewidth[3] = inlink->w;
225 
226  s->min_score = +INFINITY;
227  s->max_score = -INFINITY;
228 
229  s->max[0] = (1 << desc->comp[0].depth) - 1;
230  s->max[1] = (1 << desc->comp[1].depth) - 1;
231  s->max[2] = (1 << desc->comp[2].depth) - 1;
232  s->max[3] = (1 << desc->comp[3].depth) - 1;
233 
234  return 0;
235 }
236 
237 static int config_output(AVFilterLink *outlink)
238 {
239  AVFilterContext *ctx = outlink->src;
240  CorrContext *s = ctx->priv;
241  AVFilterLink *mainlink = ctx->inputs[0];
242  int ret;
243 
245  if (ret < 0)
246  return ret;
247  outlink->w = mainlink->w;
248  outlink->h = mainlink->h;
249  outlink->time_base = mainlink->time_base;
250  outlink->sample_aspect_ratio = mainlink->sample_aspect_ratio;
251  outlink->frame_rate = mainlink->frame_rate;
252  if ((ret = ff_framesync_configure(&s->fs)) < 0)
253  return ret;
254 
255  outlink->time_base = s->fs.time_base;
256 
257  if (av_cmp_q(mainlink->time_base, outlink->time_base) ||
258  av_cmp_q(ctx->inputs[1]->time_base, outlink->time_base))
259  av_log(ctx, AV_LOG_WARNING, "not matching timebases found between first input: %d/%d and second input %d/%d, results may be incorrect!\n",
260  mainlink->time_base.num, mainlink->time_base.den,
261  ctx->inputs[1]->time_base.num, ctx->inputs[1]->time_base.den);
262 
263  return 0;
264 }
265 
267 {
268  CorrContext *s = ctx->priv;
269  return ff_framesync_activate(&s->fs);
270 }
271 
273 {
274  CorrContext *s = ctx->priv;
275 
276  if (s->nb_frames > 0) {
277  char buf[256];
278 
279  buf[0] = 0;
280  for (int j = 0; j < s->nb_components; j++) {
281  int c = s->is_rgb ? s->rgba_map[j] : j;
282  av_strlcatf(buf, sizeof(buf), " %c:%f", s->comps[j], s->score_comp[c] / s->nb_frames);
283  }
284 
285  av_log(ctx, AV_LOG_INFO, "%s%s average:%f min:%f max:%f\n",
286  ctx->filter->name,
287  buf,
288  s->score / s->nb_frames,
289  s->min_score,
290  s->max_score);
291  }
292 
293  ff_framesync_uninit(&s->fs);
294 }
295 
296 static const AVFilterPad corr_inputs[] = {
297  {
298  .name = "main",
299  .type = AVMEDIA_TYPE_VIDEO,
300  },{
301  .name = "reference",
302  .type = AVMEDIA_TYPE_VIDEO,
303  .config_props = config_input_ref,
304  },
305 };
306 
307 static const AVFilterPad corr_outputs[] = {
308  {
309  .name = "default",
310  .type = AVMEDIA_TYPE_VIDEO,
311  .config_props = config_output,
312  },
313 };
314 
315 static const AVOption options[] = {
316  { NULL }
317 };
318 
319 #define corr_options options
321 
323  .name = "corr",
324  .description = NULL_IF_CONFIG_SMALL("Calculate the correlation between two video streams."),
325  .preinit = corr_framesync_preinit,
326  .init = init,
327  .uninit = uninit,
328  .activate = activate,
329  .priv_size = sizeof(CorrContext),
330  .priv_class = &corr_class,
336 };
AV_PIX_FMT_GBRAP16
#define AV_PIX_FMT_GBRAP16
Definition: pixfmt.h:491
ff_framesync_configure
int ff_framesync_configure(FFFrameSync *fs)
Configure a frame sync structure.
Definition: framesync.c:134
AV_LOG_WARNING
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:186
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
INFINITY
#define INFINITY
Definition: mathematics.h:118
CorrContext::max
int max[4]
Definition: vf_corr.c:39
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
ff_framesync_uninit
void ff_framesync_uninit(FFFrameSync *fs)
Free all memory currently allocated.
Definition: framesync.c:304
CorrContext::planeheight
int planeheight[4]
Definition: vf_corr.c:43
comp
static void comp(unsigned char *dst, ptrdiff_t dst_stride, unsigned char *src, ptrdiff_t src_stride, int add)
Definition: eamad.c:80
CorrContext::filter_slice
int(* filter_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_corr.c:44
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:978
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2964
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: internal.h:172
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
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:340
pixdesc.h
AVOption
AVOption.
Definition: opt.h:251
CorrContext::min_score
double min_score
Definition: vf_corr.c:35
CorrContext::is_rgb
int is_rgb
Definition: vf_corr.c:37
AV_PIX_FMT_YUV440P
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:99
AVDictionary
Definition: dict.c:34
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:170
FFFrameSync
Frame sync structure.
Definition: framesync.h:168
av_strlcatf
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...)
Definition: avstring.c:103
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_corr.c:237
AV_PIX_FMT_GRAY9
#define AV_PIX_FMT_GRAY9
Definition: pixfmt.h:448
FRAMESYNC_DEFINE_CLASS
FRAMESYNC_DEFINE_CLASS(corr, CorrContext, fs)
corr_inputs
static const AVFilterPad corr_inputs[]
Definition: vf_corr.c:296
AV_PIX_FMT_GBRP14
#define AV_PIX_FMT_GBRP14
Definition: pixfmt.h:486
AV_PIX_FMT_GBRAP
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:205
corr_outputs
static const AVFilterPad corr_outputs[]
Definition: vf_corr.c:307
AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:484
AV_PIX_FMT_GRAY16
#define AV_PIX_FMT_GRAY16
Definition: pixfmt.h:452
ff_vf_corr
const AVFilter ff_vf_corr
Definition: vf_corr.c:322
AVRational::num
int num
Numerator.
Definition: rational.h:59
CorrContext::rgba_map
uint8_t rgba_map[4]
Definition: vf_corr.c:38
AVFilterPad
A filter pad used for either input or output.
Definition: internal.h:47
AV_PIX_FMT_YUVJ411P
@ AV_PIX_FMT_YUVJ411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition: pixfmt.h:276
CorrContext::score
double score
Definition: vf_corr.c:35
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
av_cold
#define av_cold
Definition: attributes.h:90
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_corr.c:178
AV_PIX_FMT_YUVJ422P
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:79
AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_GBRAP10
Definition: pixfmt.h:488
s
#define s(width, name)
Definition: cbs_vp9.c:198
AV_PIX_FMT_GBRAP12
#define AV_PIX_FMT_GBRAP12
Definition: pixfmt.h:489
AV_CEIL_RSHIFT
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:51
activate
static int activate(AVFilterContext *ctx)
Definition: vf_corr.c:266
CorrContext::fs
FFFrameSync fs
Definition: vf_corr.c:34
ctx
AVFormatContext * ctx
Definition: movenc.c:48
AV_PIX_FMT_GRAY14
#define AV_PIX_FMT_GRAY14
Definition: pixfmt.h:451
options
static const AVOption options[]
Definition: vf_corr.c:315
CorrContext
Definition: vf_corr.c:32
key
const char * key
Definition: hwcontext_opencl.c:174
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:192
AV_PIX_FMT_YUVJ444P
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:80
arg
const char * arg
Definition: jacosubdec.c:67
AV_PIX_FMT_GRAY10
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:449
AV_PIX_FMT_GBRP16
#define AV_PIX_FMT_GBRP16
Definition: pixfmt.h:487
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
NULL
#define NULL
Definition: coverity.c:32
fs
#define fs(width, name, subs,...)
Definition: cbs_vp9.c:200
CorrContext::score_comp
double score_comp[4]
Definition: vf_corr.c:35
AV_PIX_FMT_YUVJ420P
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:78
CorrContext::planewidth
int planewidth[4]
Definition: vf_corr.c:42
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:74
PF
#define PF(suf)
AV_PIX_FMT_GBRP9
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:483
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
CORR
#define CORR(type, name)
Definition: vf_corr.c:69
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
ff_framesync_init_dualinput
int ff_framesync_init_dualinput(FFFrameSync *fs, AVFilterContext *parent)
Initialize a frame sync structure for dualinput.
Definition: framesync.c:372
master
const char * master
Definition: vf_curves.c:129
P
#define P
for
for(k=2;k<=8;++k)
Definition: h264pred_template.c:425
fmin
double fmin(double, double)
CorrContext::nb_components
int nb_components
Definition: vf_corr.c:41
AV_LOG_INFO
#define AV_LOG_INFO
Standard information.
Definition: log.h:191
internal.h
PF_NOALPHA
#define PF_NOALPHA(suf)
config_input_ref
static int config_input_ref(AVFilterLink *inlink)
Definition: vf_corr.c:202
AV_PIX_FMT_GBRP12
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:485
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: vf_corr.c:187
value
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
Definition: writing_filters.txt:86
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_corr.c:272
AV_PIX_FMT_YUVJ440P
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
Definition: pixfmt.h:100
AVFilterPad::name
const char * name
Pad name.
Definition: internal.h:53
av_cmp_q
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
Definition: rational.h:89
AVFilter
Filter definition.
Definition: avfilter.h:166
set_meta
static void set_meta(AVFilterContext *ctx, AVDictionary **metadata, const char *key, char comp, float d)
Definition: vf_corr.c:51
ret
ret
Definition: filter_design.txt:187
fmax
double fmax(double, double)
framesync.h
CorrContext::nb_frames
uint64_t nb_frames
Definition: vf_corr.c:36
AVRational::den
int den
Denominator.
Definition: rational.h:60
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
avfilter.h
AVFILTER_FLAG_METADATA_ONLY
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
Definition: avfilter.h:133
ref
static int ref[MAX_W *MAX_W]
Definition: jpeg2000dwt.c:112
AVFilterContext
An instance of a filter.
Definition: avfilter.h:397
AV_PIX_FMT_GBRP
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:158
desc
const char * desc
Definition: libsvtav1.c:83
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
CorrContext::max_score
double max_score
Definition: vf_corr.c:35
CorrContext::comps
char comps[4]
Definition: vf_corr.c:40
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:69
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:193
av_dict_set
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
Definition: dict.c:88
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:73
ff_fill_rgba_map
int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt)
Definition: drawutils.c:35
d
d
Definition: ffmpeg_filter.c:368
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:155
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:72
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
ff_framesync_activate
int ff_framesync_activate(FFFrameSync *fs)
Examine the frames in the filter's input and try to produce output.
Definition: framesync.c:355
avstring.h
ff_framesync_dualinput_get
int ff_framesync_dualinput_get(FFFrameSync *fs, AVFrame **f0, AVFrame **f1)
Definition: framesync.c:390
AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_GRAY12
Definition: pixfmt.h:450
drawutils.h
int
int
Definition: ffmpeg_filter.c:368
snprintf
#define snprintf
Definition: snprintf.h:34
do_corr
static int do_corr(FFFrameSync *fs)
Definition: vf_corr.c:135