Go to the documentation of this file.
21 #include "config_components.h"
33 #define MAX_THREADS 16
75 int w,
int h,
int n,
int plane,
float scale);
81 #define OFFSET(x) offsetof(ConvolveContext, x)
82 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
87 {
"first",
"process only first impulse, ignore rest", 0,
AV_OPT_TYPE_CONST, {.i64=0}, 0, 0,
FLAGS,
"impulse" },
122 s->planewidth[0] =
s->planewidth[3] =
w;
124 s->planeheight[0] =
s->planeheight[3] =
h;
126 s->nb_planes =
desc->nb_components;
127 s->depth =
desc->comp[0].depth;
129 for (
int i = 0;
i <
s->nb_planes;
i++) {
130 int w =
s->planewidth[
i];
131 int h =
s->planeheight[
i];
134 s->fft_len[
i] = 1 << (
av_log2(2 * n - 1));
168 if (
ctx->inputs[0]->w !=
ctx->inputs[1]->w ||
169 ctx->inputs[0]->h !=
ctx->inputs[1]->h) {
189 const int plane =
td->plane;
191 int start = (n * jobnr) / nb_jobs;
192 int end = (n * (jobnr+1)) / nb_jobs;
195 for (y = start; y < end; y++) {
196 s->tx_fn[plane](
s->fft[plane][jobnr], hdata_out + y * n, hdata_in + y * n,
sizeof(
AVComplexFloat));
202 #define SQR(x) ((x) * (x))
207 int n,
int plane,
float scale)
214 for (y = 0; y <
h; y++) {
217 for (x = 0; x <
w; x++)
223 for (y = 0; y <
h; y++) {
226 for (x = 0; x <
w; x++)
232 for (y = 0; y <
h; y++) {
235 for (x = 0; x <
w; x++) {
237 fft_hdata[y * n + x].
im = 0;
240 for (x =
w; x < n; x++) {
241 fft_hdata[y * n + x].
re = 0;
242 fft_hdata[y * n + x].
im = 0;
246 for (y =
h; y < n; y++) {
247 for (x = 0; x < n; x++) {
248 fft_hdata[y * n + x].
re = 0;
249 fft_hdata[y * n + x].
im = 0;
253 for (y = 0; y <
h; y++) {
254 const uint16_t *
src = (
const uint16_t *)(in->
data[plane] + in->
linesize[plane] * y);
256 for (x = 0; x <
w; x++)
262 for (y = 0; y <
h; y++) {
263 const uint16_t *
src = (
const uint16_t *)(in->
data[plane] + in->
linesize[plane] * y);
265 for (x = 0; x <
w; x++)
271 for (y = 0; y <
h; y++) {
272 const uint16_t *
src = (
const uint16_t *)(in->
data[plane] + in->
linesize[plane] * y);
274 for (x = 0; x <
w; x++) {
276 fft_hdata[y * n + x].
im = 0;
279 for (x =
w; x < n; x++) {
280 fft_hdata[y * n + x].
re = 0;
281 fft_hdata[y * n + x].
im = 0;
285 for (y =
h; y < n; y++) {
286 for (x = 0; x < n; x++) {
287 fft_hdata[y * n + x].
re = 0;
288 fft_hdata[y * n + x].
im = 0;
297 const int iw = (n -
w) / 2, ih = (n -
h) / 2;
301 for (y = 0; y <
h; y++) {
304 for (x = 0; x <
w; x++) {
305 fft_hdata[(y + ih) * n + iw + x].re =
src[x] *
scale;
306 fft_hdata[(y + ih) * n + iw + x].im = 0;
309 for (x = 0; x < iw; x++) {
310 fft_hdata[(y + ih) * n + x].re = fft_hdata[(y + ih) * n + iw].
re;
311 fft_hdata[(y + ih) * n + x].im = 0;
314 for (x = n - iw; x < n; x++) {
315 fft_hdata[(y + ih) * n + x].re = fft_hdata[(y + ih) * n + n - iw - 1].
re;
316 fft_hdata[(y + ih) * n + x].im = 0;
320 for (y = 0; y < ih; y++) {
321 for (x = 0; x < n; x++) {
322 fft_hdata[y * n + x].
re = fft_hdata[ih * n + x].
re;
323 fft_hdata[y * n + x].
im = 0;
327 for (y = n - ih; y < n; y++) {
328 for (x = 0; x < n; x++) {
329 fft_hdata[y * n + x].
re = fft_hdata[(n - ih - 1) * n + x].re;
330 fft_hdata[y * n + x].
im = 0;
334 for (y = 0; y <
h; y++) {
335 const uint16_t *
src = (
const uint16_t *)(in->
data[plane] + in->
linesize[plane] * y);
337 for (x = 0; x <
w; x++) {
338 fft_hdata[(y + ih) * n + iw + x].re =
src[x] *
scale;
339 fft_hdata[(y + ih) * n + iw + x].im = 0;
342 for (x = 0; x < iw; x++) {
343 fft_hdata[(y + ih) * n + x].re = fft_hdata[(y + ih) * n + iw].
re;
344 fft_hdata[(y + ih) * n + x].im = 0;
347 for (x = n - iw; x < n; x++) {
348 fft_hdata[(y + ih) * n + x].re = fft_hdata[(y + ih) * n + n - iw - 1].
re;
349 fft_hdata[(y + ih) * n + x].im = 0;
353 for (y = 0; y < ih; y++) {
354 for (x = 0; x < n; x++) {
355 fft_hdata[y * n + x].
re = fft_hdata[ih * n + x].
re;
356 fft_hdata[y * n + x].
im = 0;
360 for (y = n - ih; y < n; y++) {
361 for (x = 0; x < n; x++) {
362 fft_hdata[y * n + x].
re = fft_hdata[(n - ih - 1) * n + x].re;
363 fft_hdata[y * n + x].
im = 0;
376 const int plane =
td->plane;
378 int start = (n * jobnr) / nb_jobs;
379 int end = (n * (jobnr+1)) / nb_jobs;
382 for (y = start; y < end; y++) {
383 for (x = 0; x < n; x++) {
384 vdata_in[y * n + x].
re = hdata[x * n + y].
re;
385 vdata_in[y * n + x].
im = hdata[x * n + y].
im;
388 s->tx_fn[plane](
s->fft[plane][jobnr], vdata_out + y * n, vdata_in + y * n,
sizeof(
AVComplexFloat));
401 const int plane =
td->plane;
403 int start = (n * jobnr) / nb_jobs;
404 int end = (n * (jobnr+1)) / nb_jobs;
407 for (y = start; y < end; y++) {
408 s->itx_fn[plane](
s->ifft[plane][jobnr], vdata_out + y * n, vdata_in + y * n,
sizeof(
AVComplexFloat));
410 for (x = 0; x < n; x++) {
411 hdata[x * n + y].
re = vdata_out[y * n + x].
re;
412 hdata[x * n + y].
im = vdata_out[y * n + x].
im;
425 const int plane =
td->plane;
427 int start = (n * jobnr) / nb_jobs;
428 int end = (n * (jobnr+1)) / nb_jobs;
431 for (y = start; y < end; y++) {
432 s->itx_fn[plane](
s->ifft[plane][jobnr], hdata_out + y * n, hdata_in + y * n,
sizeof(
AVComplexFloat));
439 int w,
int h,
int n,
int plane,
float scale)
441 const int imax = (1 <<
s->depth) - 1;
445 for (
int y = 0; y <
h; y++) {
446 uint8_t *dst =
out->data[plane] + y *
out->linesize[plane];
447 for (
int x = 0; x <
w; x++)
451 for (
int y = 0; y <
h; y++) {
452 uint16_t *dst = (uint16_t *)(
out->data[plane] + y *
out->linesize[plane]);
453 for (
int x = 0; x <
w; x++)
460 int w,
int h,
int n,
int plane,
float scale)
462 const int max = (1 <<
s->depth) - 1;
463 const int hh =
h / 2;
464 const int hw =
w / 2;
468 for (y = 0; y < hh; y++) {
469 uint8_t *dst =
out->data[plane] + (y + hh) *
out->linesize[plane] + hw;
470 for (x = 0; x < hw; x++)
473 for (y = 0; y < hh; y++) {
474 uint8_t *dst =
out->data[plane] + (y + hh) *
out->linesize[plane];
475 for (x = 0; x < hw; x++)
478 for (y = 0; y < hh; y++) {
479 uint8_t *dst =
out->data[plane] + y *
out->linesize[plane] + hw;
480 for (x = 0; x < hw; x++)
483 for (y = 0; y < hh; y++) {
484 uint8_t *dst =
out->data[plane] + y *
out->linesize[plane];
485 for (x = 0; x < hw; x++)
489 for (y = 0; y < hh; y++) {
490 uint16_t *dst = (uint16_t *)(
out->data[plane] + (y + hh) *
out->linesize[plane] + hw * 2);
491 for (x = 0; x < hw; x++)
494 for (y = 0; y < hh; y++) {
495 uint16_t *dst = (uint16_t *)(
out->data[plane] + (y + hh) *
out->linesize[plane]);
496 for (x = 0; x < hw; x++)
499 for (y = 0; y < hh; y++) {
500 uint16_t *dst = (uint16_t *)(
out->data[plane] + y *
out->linesize[plane] + hw * 2);
501 for (x = 0; x < hw; x++)
504 for (y = 0; y < hh; y++) {
505 uint16_t *dst = (uint16_t *)(
out->data[plane] + y *
out->linesize[plane]);
506 for (x = 0; x < hw; x++)
518 const float noise =
s->noise;
520 int start = (n * jobnr) / nb_jobs;
521 int end = (n * (jobnr+1)) / nb_jobs;
524 for (y = start; y < end; y++) {
527 for (x = 0; x < n; x++) {
528 float re, im, ire, iim;
530 re =
input[yn + x].re;
531 im =
input[yn + x].im;
535 input[yn + x].re = ire * re - iim * im;
536 input[yn + x].im = iim * re + ire * im;
549 const float scale = 1.f / (n * n);
550 int start = (n * jobnr) / nb_jobs;
551 int end = (n * (jobnr+1)) / nb_jobs;
553 for (
int y = start; y < end; y++) {
556 for (
int x = 0; x < n; x++) {
557 float re, im, ire, iim;
559 re =
input[yn + x].re;
560 im =
input[yn + x].im;
564 input[yn + x].re = ire * re - iim * im;
565 input[yn + x].im = iim * re + ire * im;
578 const float noise =
s->noise;
580 int start = (n * jobnr) / nb_jobs;
581 int end = (n * (jobnr+1)) / nb_jobs;
584 for (y = start; y < end; y++) {
587 for (x = 0; x < n; x++) {
588 float re, im, ire, iim, div;
590 re =
input[yn + x].re;
591 im =
input[yn + x].im;
594 div = ire * ire + iim * iim +
noise;
596 input[yn + x].re = (ire * re + iim * im) / div;
597 input[yn + x].im = (ire * im - iim * re) / div;
607 const int n =
s->fft_len[plane];
608 const int w =
s->secondarywidth[plane];
609 const int h =
s->secondaryheight[plane];
614 for (
int y = 0; y <
h; y++) {
615 const uint8_t *
src = (
const uint8_t *)(impulsepic->
data[plane] + y * impulsepic->
linesize[plane]) ;
616 for (
int x = 0; x <
w; x++) {
621 for (
int y = 0; y <
h; y++) {
622 const uint16_t *
src = (
const uint16_t *)(impulsepic->
data[plane] + y * impulsepic->
linesize[plane]) ;
623 for (
int x = 0; x <
w; x++) {
628 total =
FFMAX(1, total);
630 s->get_input(
s,
s->fft_hdata_impulse_in[plane], impulsepic,
w,
h, n, plane, 1.f / total);
634 td.hdata_in =
s->fft_hdata_impulse_in[plane];
635 td.vdata_in =
s->fft_vdata_impulse_in[plane];
636 td.hdata_out =
s->fft_hdata_impulse_out[plane];
637 td.vdata_out =
s->fft_vdata_impulse_out[plane];
644 s->got_impulse[plane] = 1;
650 const int n =
s->fft_len[plane];
653 s->get_input(
s,
s->fft_hdata_impulse_in[plane], secondary,
654 s->secondarywidth[plane],
655 s->secondaryheight[plane],
660 td.hdata_in =
s->fft_hdata_impulse_in[plane];
661 td.vdata_in =
s->fft_vdata_impulse_in[plane];
662 td.hdata_out =
s->fft_hdata_impulse_out[plane];
663 td.vdata_out =
s->fft_vdata_impulse_out[plane];
670 s->got_impulse[plane] = 1;
687 for (plane = 0; plane <
s->nb_planes; plane++) {
690 const int n =
s->fft_len[plane];
691 const int w =
s->primarywidth[plane];
692 const int h =
s->primaryheight[plane];
693 const int ow =
s->planewidth[plane];
694 const int oh =
s->planeheight[plane];
697 if (!(
s->planes & (1 << plane))) {
701 td.plane = plane,
td.n = n;
702 s->get_input(
s,
s->fft_hdata_in[plane], mainpic,
w,
h, n, plane, 1.f);
704 td.hdata_in =
s->fft_hdata_in[plane];
705 td.vdata_in =
s->fft_vdata_in[plane];
706 td.hdata_out =
s->fft_hdata_out[plane];
707 td.vdata_out =
s->fft_vdata_out[plane];
714 if ((!
s->impulse && !
s->got_impulse[plane]) ||
s->impulse) {
715 s->prepare_impulse(
ctx, impulsepic, plane);
724 td.hdata_in =
s->fft_hdata_out[plane];
725 td.vdata_in =
s->fft_vdata_out[plane];
726 td.hdata_out =
s->fft_hdata_in[plane];
727 td.vdata_out =
s->fft_vdata_in[plane];
732 td.hdata_out =
s->fft_hdata_out[plane];
733 td.hdata_in =
s->fft_hdata_in[plane];
738 s->get_output(
s,
s->fft_hdata_out[plane], mainpic, ow, oh, n, plane, 1.f / (n * n));
754 s->primarywidth[0] =
s->primarywidth[3] = mainlink->
w;
756 s->primaryheight[0] =
s->primaryheight[3] = mainlink->
h;
759 s->secondarywidth[0] =
s->secondarywidth[3] = secondlink->
w;
761 s->secondaryheight[0] =
s->secondaryheight[3] = secondlink->
h;
767 outlink->
w = mainlink->
w;
768 outlink->
h = mainlink->
h;
776 for (
i = 0;
i <
s->nb_planes;
i++) {
802 if (!strcmp(
ctx->filter->name,
"convolve")) {
807 }
else if (!strcmp(
ctx->filter->name,
"xcorrelate")) {
812 }
else if (!strcmp(
ctx->filter->name,
"deconvolve")) {
829 for (
i = 0;
i < 4;
i++) {
870 #if CONFIG_CONVOLVE_FILTER
877 .preinit = convolve_framesync_preinit,
882 .priv_class = &convolve_class,
891 #if CONFIG_DECONVOLVE_FILTER
893 static const AVOption deconvolve_options[] = {
896 {
"first",
"process only first impulse, ignore rest", 0,
AV_OPT_TYPE_CONST, {.i64=0}, 0, 0,
FLAGS,
"impulse" },
905 .
name =
"deconvolve",
907 .preinit = convolve_framesync_preinit,
912 .priv_class = &deconvolve_class,
921 #if CONFIG_XCORRELATE_FILTER
923 static const AVOption xcorrelate_options[] = {
926 {
"first",
"process only first secondary frame, ignore rest", 0,
AV_OPT_TYPE_CONST, {.i64=0}, 0, 0,
FLAGS,
"impulse" },
937 if (
ctx->inputs[0]->w <=
ctx->inputs[1]->w ||
938 ctx->inputs[0]->h <=
ctx->inputs[1]->h) {
939 av_log(
ctx,
AV_LOG_ERROR,
"Width and height of second input videos must be less than first input.\n");
954 .config_props = config_input_secondary,
967 .
name =
"xcorrelate",
968 .description =
NULL_IF_CONFIG_SMALL(
"Cross-correlate first video stream with second video stream."),
969 .preinit = convolve_framesync_preinit,
974 .priv_class = &xcorrelate_class,
#define AV_PIX_FMT_YUVA422P16
#define AV_PIX_FMT_GBRAP16
AVComplexFloat * vdata_out
int ff_framesync_configure(FFFrameSync *fs)
Configure a frame sync structure.
AVPixelFormat
Pixel format.
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
#define FRAMESYNC_AUXILIARY_FUNCS(func_prefix, context, field)
int(* filter)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
void ff_framesync_uninit(FFFrameSync *fs)
Free all memory currently allocated.
const AVFilter ff_vf_deconvolve
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define FILTER_PIXFMTS_ARRAY(array)
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
static int complex_divide(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
#define AV_PIX_FMT_YUVA422P9
This structure describes decoded (raw) audio or video data.
#define AV_PIX_FMT_YUVA420P16
#define AV_PIX_FMT_YUVA420P10
#define AV_PIX_FMT_YUV420P10
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
const char * name
Filter name.
A link between two filters.
#define AV_PIX_FMT_YUVA422P10
AVComplexFloat * hdata_in
av_cold int av_tx_init(AVTXContext **ctx, av_tx_fn *tx, enum AVTXType type, int inv, int len, const void *scale, uint64_t flags)
Initialize a transform context with the given configuration (i)MDCTs with an odd length are currently...
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVComplexFloat * vdata_in
AVComplexFloat * fft_hdata_out[4]
#define AV_PIX_FMT_YUVA420P9
#define AV_PIX_FMT_GBRP14
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
#define AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_YUVA444P16
static enum AVPixelFormat pixel_fmts_fftfilt[]
#define AV_PIX_FMT_YUV422P9
static int ifft_horizontal(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static av_always_inline float scale(float x, float s)
#define AV_PIX_FMT_GRAY16
A filter pad used for either input or output.
void(* get_input)(struct ConvolveContext *s, AVComplexFloat *fft_hdata, AVFrame *in, int w, int h, int n, int plane, float scale)
#define AV_PIX_FMT_YUV444P10
@ AV_PIX_FMT_YUVJ411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define AV_PIX_FMT_YUV422P16
void(* av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride)
Function pointer to a function to perform the transform.
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
#define AV_PIX_FMT_GBRAP10
AVComplexFloat * fft_hdata_in[4]
#define AV_PIX_FMT_GBRAP12
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
#define AV_PIX_FMT_YUV444P16
#define AV_CEIL_RSHIFT(a, b)
static const AVFilterPad convolve_inputs[]
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0,...
static void get_output(ConvolveContext *s, AVComplexFloat *input, AVFrame *out, int w, int h, int n, int plane, float scale)
@ AV_TX_FLOAT_FFT
Standard complex to complex FFT with sample data type of AVComplexFloat, AVComplexDouble or AVComplex...
#define AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUV420P16
static void get_zeropadded_input(ConvolveContext *s, AVComplexFloat *fft_hdata, AVFrame *in, int w, int h, int n, int plane, float scale)
#define AV_PIX_FMT_GRAY14
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static int fft_vertical(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
#define FILTER_INPUTS(array)
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
#define AV_PIX_FMT_GRAY10
static int config_input(AVFilterLink *inlink)
#define AV_PIX_FMT_GBRP16
Describe the class of an AVClass context structure.
#define fs(width, name, subs,...)
AVTXContext * ifft[4][MAX_THREADS]
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
void(* prepare_impulse)(AVFilterContext *ctx, AVFrame *impulsepic, int plane)
static int config_input_impulse(AVFilterLink *inlink)
static void prepare_secondary(AVFilterContext *ctx, AVFrame *secondary, int plane)
static __device__ float sqrtf(float a)
#define AV_PIX_FMT_YUV422P10
AVComplexFloat * fft_hdata_impulse_out[4]
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
AVComplexFloat * fft_vdata_impulse_in[4]
AVTXContext * fft[4][MAX_THREADS]
AVComplexFloat * fft_vdata_out[4]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int ff_framesync_init_dualinput(FFFrameSync *fs, AVFilterContext *parent)
Initialize a frame sync structure for dualinput.
void(* get_output)(struct ConvolveContext *s, AVComplexFloat *input, AVFrame *out, int w, int h, int n, int plane, float scale)
int format
agreed upon media format
#define AV_PIX_FMT_YUV422P12
#define FRAMESYNC_DEFINE_PURE_CLASS(name, desc, func_prefix, options)
#define AV_PIX_FMT_YUV444P12
static const AVFilterPad convolve_outputs[]
static int complex_multiply(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
AVFilterContext * src
source filter
static void convolve(float *tgt, const float *src, int len, int n)
static int activate(AVFilterContext *ctx)
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
#define AV_PIX_FMT_YUVA444P10
AVComplexFloat * fft_hdata_impulse_in[4]
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some input
av_cold void av_tx_uninit(AVTXContext **ctx)
Frees a context and sets *ctx to NULL, does nothing when *ctx == NULL.
AVComplexFloat * hdata_out
static av_cold void uninit(AVFilterContext *ctx)
static int do_convolve(FFFrameSync *fs)
static int fft_horizontal(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
#define i(width, name, range_min, range_max)
static int ifft_vertical(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
int w
agreed upon image width
#define AV_PIX_FMT_GBRP12
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Used for passing data between threads.
static const struct @363 planes[]
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
const char * name
Pad name.
void * av_calloc(size_t nmemb, size_t size)
#define AV_PIX_FMT_YUV444P9
static const AVOption convolve_options[]
static void prepare_impulse(AVFilterContext *ctx, AVFrame *impulsepic, int plane)
#define AV_PIX_FMT_YUVA444P9
static void get_input(ConvolveContext *s, AVComplexFloat *fft_hdata, AVFrame *in, int w, int h, int n, int plane, float scale)
const AVFilter ff_vf_convolve
#define AV_PIX_FMT_YUV420P12
AVComplexFloat * fft_vdata_in[4]
static int complex_xcorrelate(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
#define AV_PIX_FMT_YUV422P14
AVComplexFloat * fft_vdata_impulse_out[4]
int h
agreed upon image height
static int noise(AVBSFContext *ctx, AVPacket *pkt)
static void get_xoutput(ConvolveContext *s, AVComplexFloat *input, AVFrame *out, int w, int h, int n, int plane, float scale)
static float mean(const float *input, int size)
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
const AVFilter ff_vf_xcorrelate
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
static av_cold int init(AVFilterContext *ctx)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
#define FILTER_OUTPUTS(array)
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
#define AV_PIX_FMT_YUV440P12
#define AV_PIX_FMT_YUV444P14
int ff_framesync_activate(FFFrameSync *fs)
Examine the frames in the filter's input and try to produce output.
static int config_output(AVFilterLink *outlink)
int ff_framesync_dualinput_get(FFFrameSync *fs, AVFrame **f0, AVFrame **f1)
#define AV_PIX_FMT_GRAY12
static av_always_inline int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
#define AV_PIX_FMT_YUV420P14