21#include "config_components.h"
76 int w,
int h,
int n,
int plane,
float scale);
82#define OFFSET(x) offsetof(ConvolveContext, x)
83#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
88 {
"first",
"process only first impulse, ignore rest", 0,
AV_OPT_TYPE_CONST, {.i64=0}, 0, 0,
FLAGS, .unit =
"impulse" },
119 const int w = inlink->
w;
120 const int h = inlink->
h;
123 s->planewidth[0] =
s->planewidth[3] =
w;
125 s->planeheight[0] =
s->planeheight[3] =
h;
127 s->nb_planes =
desc->nb_components;
128 s->depth =
desc->comp[0].depth;
130 for (
int i = 0;
i <
s->nb_planes;
i++) {
131 int w =
s->planewidth[
i];
132 int h =
s->planeheight[
i];
135 s->fft_len[
i] = 1 << (
av_log2(2 * n - 1));
169 if (
ctx->inputs[0]->w !=
ctx->inputs[1]->w ||
170 ctx->inputs[0]->h !=
ctx->inputs[1]->h) {
190 const int plane = td->
plane;
196 for (y = start; y < end; y++) {
197 s->tx_fn[plane](
s->fft[plane][jobnr], hdata_out + y * n, hdata_in + y * n,
sizeof(
AVComplexFloat));
203#define SQR(x) ((x) * (x))
208 int n,
int plane,
float scale)
215 for (y = 0; y <
h; y++) {
218 for (x = 0; x <
w; x++)
224 for (y = 0; y <
h; y++) {
227 for (x = 0; x <
w; x++)
233 for (y = 0; y <
h; y++) {
236 for (x = 0; x <
w; x++) {
238 fft_hdata[y * n + x].
im = 0;
241 for (x =
w; x < n; x++) {
242 fft_hdata[y * n + x].
re = 0;
243 fft_hdata[y * n + x].
im = 0;
247 for (y =
h; y < n; y++) {
248 for (x = 0; x < n; x++) {
249 fft_hdata[y * n + x].
re = 0;
250 fft_hdata[y * n + x].
im = 0;
254 for (y = 0; y <
h; y++) {
255 const uint16_t *
src = (
const uint16_t *)(in->
data[plane] + in->
linesize[plane] * y);
257 for (x = 0; x <
w; x++)
263 for (y = 0; y <
h; y++) {
264 const uint16_t *
src = (
const uint16_t *)(in->
data[plane] + in->
linesize[plane] * y);
266 for (x = 0; x <
w; x++)
272 for (y = 0; y <
h; y++) {
273 const uint16_t *
src = (
const uint16_t *)(in->
data[plane] + in->
linesize[plane] * y);
275 for (x = 0; x <
w; x++) {
277 fft_hdata[y * n + x].
im = 0;
280 for (x =
w; x < n; x++) {
281 fft_hdata[y * n + x].
re = 0;
282 fft_hdata[y * n + x].
im = 0;
286 for (y =
h; y < n; y++) {
287 for (x = 0; x < n; x++) {
288 fft_hdata[y * n + x].
re = 0;
289 fft_hdata[y * n + x].
im = 0;
298 const int iw = (n -
w) / 2, ih = (n -
h) / 2;
302 for (y = 0; y <
h; y++) {
305 for (x = 0; x <
w; x++) {
306 fft_hdata[(y + ih) * n + iw + x].re =
src[x] *
scale;
307 fft_hdata[(y + ih) * n + iw + x].im = 0;
310 for (x = 0; x < iw; x++) {
311 fft_hdata[(y + ih) * n + x].re = fft_hdata[(y + ih) * n + iw].
re;
312 fft_hdata[(y + ih) * n + x].im = 0;
315 for (x = n - iw; x < n; x++) {
316 fft_hdata[(y + ih) * n + x].re = fft_hdata[(y + ih) * n + n - iw - 1].
re;
317 fft_hdata[(y + ih) * n + x].im = 0;
321 for (y = 0; y < ih; y++) {
322 for (x = 0; x < n; x++) {
323 fft_hdata[y * n + x].
re = fft_hdata[ih * n + x].
re;
324 fft_hdata[y * n + x].
im = 0;
328 for (y = n - ih; y < n; y++) {
329 for (x = 0; x < n; x++) {
330 fft_hdata[y * n + x].
re = fft_hdata[(n - ih - 1) * n + x].re;
331 fft_hdata[y * n + x].
im = 0;
335 for (y = 0; y <
h; y++) {
336 const uint16_t *
src = (
const uint16_t *)(in->
data[plane] + in->
linesize[plane] * y);
338 for (x = 0; x <
w; x++) {
339 fft_hdata[(y + ih) * n + iw + x].re =
src[x] *
scale;
340 fft_hdata[(y + ih) * n + iw + x].im = 0;
343 for (x = 0; x < iw; x++) {
344 fft_hdata[(y + ih) * n + x].re = fft_hdata[(y + ih) * n + iw].
re;
345 fft_hdata[(y + ih) * n + x].im = 0;
348 for (x = n - iw; x < n; x++) {
349 fft_hdata[(y + ih) * n + x].re = fft_hdata[(y + ih) * n + n - iw - 1].
re;
350 fft_hdata[(y + ih) * n + x].im = 0;
354 for (y = 0; y < ih; y++) {
355 for (x = 0; x < n; x++) {
356 fft_hdata[y * n + x].
re = fft_hdata[ih * n + x].
re;
357 fft_hdata[y * n + x].
im = 0;
361 for (y = n - ih; y < n; y++) {
362 for (x = 0; x < n; x++) {
363 fft_hdata[y * n + x].
re = fft_hdata[(n - ih - 1) * n + x].re;
364 fft_hdata[y * n + x].
im = 0;
377 const int plane = td->
plane;
383 for (y = start; y < end; y++) {
384 for (x = 0; x < n; x++) {
385 vdata_in[y * n + x].
re = hdata[x * n + y].
re;
386 vdata_in[y * n + x].
im = hdata[x * n + y].
im;
389 s->tx_fn[plane](
s->fft[plane][jobnr], vdata_out + y * n, vdata_in + y * n,
sizeof(
AVComplexFloat));
402 const int plane = td->
plane;
408 for (y = start; y < end; y++) {
409 s->itx_fn[plane](
s->ifft[plane][jobnr], vdata_out + y * n, vdata_in + y * n,
sizeof(
AVComplexFloat));
411 for (x = 0; x < n; x++) {
412 hdata[x * n + y].
re = vdata_out[y * n + x].
re;
413 hdata[x * n + y].
im = vdata_out[y * n + x].
im;
426 const int plane = td->
plane;
432 for (y = start; y < end; y++) {
433 s->itx_fn[plane](
s->ifft[plane][jobnr], hdata_out + y * n, hdata_in + y * n,
sizeof(
AVComplexFloat));
440 int w,
int h,
int n,
int plane,
float scale)
442 const int imax = (1 <<
s->depth) - 1;
446 for (
int y = 0; y <
h; y++) {
447 uint8_t *
dst =
out->data[plane] + y *
out->linesize[plane];
448 for (
int x = 0; x <
w; x++)
452 for (
int y = 0; y <
h; y++) {
453 uint16_t *
dst = (uint16_t *)(
out->data[plane] + y *
out->linesize[plane]);
454 for (
int x = 0; x <
w; x++)
461 int w,
int h,
int n,
int plane,
float scale)
463 const int max = (1 <<
s->depth) - 1;
464 const int hh =
h / 2;
465 const int hw =
w / 2;
469 for (y = 0; y < hh; y++) {
470 uint8_t *
dst =
out->data[plane] + (y + hh) *
out->linesize[plane] + hw;
471 for (x = 0; x < hw; x++)
474 for (y = 0; y < hh; y++) {
475 uint8_t *
dst =
out->data[plane] + (y + hh) *
out->linesize[plane];
476 for (x = 0; x < hw; x++)
479 for (y = 0; y < hh; y++) {
480 uint8_t *
dst =
out->data[plane] + y *
out->linesize[plane] + hw;
481 for (x = 0; x < hw; x++)
484 for (y = 0; y < hh; y++) {
485 uint8_t *
dst =
out->data[plane] + y *
out->linesize[plane];
486 for (x = 0; x < hw; x++)
490 for (y = 0; y < hh; y++) {
491 uint16_t *
dst = (uint16_t *)(
out->data[plane] + (y + hh) *
out->linesize[plane] + hw * 2);
492 for (x = 0; x < hw; x++)
495 for (y = 0; y < hh; y++) {
496 uint16_t *
dst = (uint16_t *)(
out->data[plane] + (y + hh) *
out->linesize[plane]);
497 for (x = 0; x < hw; x++)
500 for (y = 0; y < hh; y++) {
501 uint16_t *
dst = (uint16_t *)(
out->data[plane] + y *
out->linesize[plane] + hw * 2);
502 for (x = 0; x < hw; x++)
505 for (y = 0; y < hh; y++) {
506 uint16_t *
dst = (uint16_t *)(
out->data[plane] + y *
out->linesize[plane]);
507 for (x = 0; x < hw; x++)
519 const float noise =
s->noise;
525 for (y = start; y < end; y++) {
528 for (x = 0; x < n; x++) {
529 float re, im, ire, iim;
531 re = input[yn + x].
re;
532 im = input[yn + x].
im;
536 input[yn + x].
re = ire * re - iim * im;
537 input[yn + x].
im = iim * re + ire * im;
550 const float scale = 1.f / (n * n);
554 for (
int y = start; y < end; y++) {
557 for (
int x = 0; x < n; x++) {
558 float re, im, ire, iim;
560 re = input[yn + x].
re;
561 im = input[yn + x].
im;
565 input[yn + x].
re = ire * re - iim * im;
566 input[yn + x].
im = iim * re + ire * im;
579 const float noise =
s->noise;
585 for (y = start; y < end; y++) {
588 for (x = 0; x < n; x++) {
589 float re, im, ire, iim, div;
591 re = input[yn + x].
re;
592 im = input[yn + x].
im;
595 div = ire * ire + iim * iim +
noise;
597 input[yn + x].
re = (ire * re + iim * im) / div;
598 input[yn + x].
im = (ire * im - iim * re) / div;
608 const int n =
s->fft_len[plane];
609 const int w =
s->secondarywidth[plane];
610 const int h =
s->secondaryheight[plane];
615 for (
int y = 0; y <
h; y++) {
616 const uint8_t *
src = (
const uint8_t *)(impulsepic->
data[plane] + y * impulsepic->
linesize[plane]) ;
617 for (
int x = 0; x <
w; x++) {
622 for (
int y = 0; y <
h; y++) {
623 const uint16_t *
src = (
const uint16_t *)(impulsepic->
data[plane] + y * impulsepic->
linesize[plane]) ;
624 for (
int x = 0; x <
w; x++) {
629 total =
FFMAX(1, total);
631 s->get_input(
s,
s->fft_hdata_impulse_in[plane], impulsepic,
w,
h, n, plane, 1.f / total);
635 td.
hdata_in =
s->fft_hdata_impulse_in[plane];
636 td.
vdata_in =
s->fft_vdata_impulse_in[plane];
637 td.
hdata_out =
s->fft_hdata_impulse_out[plane];
638 td.
vdata_out =
s->fft_vdata_impulse_out[plane];
645 s->got_impulse[plane] = 1;
651 const int n =
s->fft_len[plane];
654 s->get_input(
s,
s->fft_hdata_impulse_in[plane], secondary,
655 s->secondarywidth[plane],
656 s->secondaryheight[plane],
661 td.
hdata_in =
s->fft_hdata_impulse_in[plane];
662 td.
vdata_in =
s->fft_vdata_impulse_in[plane];
663 td.
hdata_out =
s->fft_hdata_impulse_out[plane];
664 td.
vdata_out =
s->fft_vdata_impulse_out[plane];
671 s->got_impulse[plane] = 1;
688 for (plane = 0; plane <
s->nb_planes; plane++) {
691 const int n =
s->fft_len[plane];
692 const int w =
s->primarywidth[plane];
693 const int h =
s->primaryheight[plane];
694 const int ow =
s->planewidth[plane];
695 const int oh =
s->planeheight[plane];
698 if (!(
s->planes & (1 << plane))) {
702 td.
plane = plane, td.
n = n;
703 s->get_input(
s,
s->fft_hdata_in[plane], mainpic,
w,
h, n, plane, 1.f);
715 if ((!
s->impulse && !
s->got_impulse[plane]) ||
s->impulse) {
716 s->prepare_impulse(
ctx, impulsepic, plane);
739 s->get_output(
s,
s->fft_hdata_out[plane], mainpic, ow, oh, n, plane, 1.f / (n * n));
757 s->primarywidth[0] =
s->primarywidth[3] = mainlink->
w;
759 s->primaryheight[0] =
s->primaryheight[3] = mainlink->
h;
762 s->secondarywidth[0] =
s->secondarywidth[3] = secondlink->
w;
764 s->secondaryheight[0] =
s->secondaryheight[3] = secondlink->
h;
770 outlink->
w = mainlink->
w;
771 outlink->
h = mainlink->
h;
779 for (
i = 0;
i <
s->nb_planes;
i++) {
805 if (!strcmp(
ctx->filter->name,
"convolve")) {
810 }
else if (!strcmp(
ctx->filter->name,
"xcorrelate")) {
815 }
else if (!strcmp(
ctx->filter->name,
"deconvolve")) {
832 for (
i = 0;
i < 4;
i++) {
873#if CONFIG_CONVOLVE_FILTER
878 .p.name =
"convolve",
880 .p.priv_class = &convolve_class,
882 .preinit = convolve_framesync_preinit,
894#if CONFIG_DECONVOLVE_FILTER
896static const AVOption deconvolve_options[] = {
899 {
"first",
"process only first impulse, ignore rest", 0,
AV_OPT_TYPE_CONST, {.i64=0}, 0, 0,
FLAGS, .unit =
"impulse" },
908 .p.name =
"deconvolve",
909 .p.description =
NULL_IF_CONFIG_SMALL(
"Deconvolve first video stream with second video stream."),
910 .p.priv_class = &deconvolve_class,
912 .preinit = convolve_framesync_preinit,
924#if CONFIG_XCORRELATE_FILTER
926static const AVOption xcorrelate_options[] = {
928 {
"secondary",
"when to process secondary frame",
OFFSET(impulse),
AV_OPT_TYPE_INT, {.i64=1}, 0, 1,
FLAGS, .unit =
"impulse" },
929 {
"first",
"process only first secondary frame, ignore rest", 0,
AV_OPT_TYPE_CONST, {.i64=0}, 0, 0,
FLAGS, .unit =
"impulse" },
930 {
"all",
"process all secondary frames", 0,
AV_OPT_TYPE_CONST, {.i64=1}, 0, 0,
FLAGS, .unit =
"impulse" },
940 if (
ctx->inputs[0]->w <=
ctx->inputs[1]->w ||
941 ctx->inputs[0]->h <=
ctx->inputs[1]->h) {
942 av_log(
ctx,
AV_LOG_ERROR,
"Width and height of second input videos must be less than first input.\n");
957 .config_props = config_input_secondary,
961#define xcorrelate_outputs convolve_outputs
964 .p.name =
"xcorrelate",
965 .p.description =
NULL_IF_CONFIG_SMALL(
"Cross-correlate first video stream with second video stream."),
966 .p.priv_class = &xcorrelate_class,
968 .preinit = convolve_framesync_preinit,
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static int config_input(AVFilterLink *inlink)
const FFFilter ff_vf_xcorrelate
const FFFilter ff_vf_convolve
const FFFilter ff_vf_deconvolve
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Main libavfilter public API header.
#define i(width, name, range_min, range_max)
#define fs(width, name, subs,...)
#define AV_CEIL_RSHIFT(a, b)
static __device__ float sqrtf(float a)
int(* init)(AVBSFContext *ctx)
static int get_input(AVFrame *frame, int frame_num)
int ff_framesync_configure(FFFrameSync *fs)
Configure a frame sync structure.
int ff_framesync_dualinput_get(FFFrameSync *fs, AVFrame **f0, AVFrame **f1)
int ff_framesync_activate(FFFrameSync *fs)
Examine the frames in the filter's input and try to produce output.
int ff_framesync_init_dualinput(FFFrameSync *fs, AVFilterContext *parent)
Initialize a frame sync structure for dualinput.
void ff_framesync_uninit(FFFrameSync *fs)
Free all memory currently allocated.
#define FRAMESYNC_AUXILIARY_FUNCS(func_prefix, context, field)
#define FRAMESYNC_DEFINE_PURE_CLASS(name, desc, func_prefix, options)
static void convolve(float *tgt, const float *src, int len, int n)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
#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.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void scale(int *out, const int *in, const int w, const int h, const int shift)
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int activate(AVBitStreamFilterContext *ctx)
static int config_output(AVBitStreamFilterLink *outlink)
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
static int ff_slice_pos(int total, int jobnr, int nb_jobs)
Compute the boundary index for a slice when work of size total is split into nb_jobs slices.
#define FILTER_PIXFMTS_ARRAY(array)
static FilterLink * ff_filter_link(AVFilterLink *link)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static const struct @257111027162314367033347246032313251342043035002 planes[]
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
static int noise(AVBSFContext *ctx, AVPacket *pkt)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_GBRAP12
#define AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV440P12
#define AV_PIX_FMT_GBRAP16
#define AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_YUVA444P10
#define AV_PIX_FMT_YUVA420P16
#define AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUVA420P10
#define AV_PIX_FMT_YUVA422P9
#define AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_GBRP12
#define AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUVA420P9
#define AV_PIX_FMT_YUVA422P10
#define AV_PIX_FMT_YUV420P14
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
@ AV_PIX_FMT_YUVJ411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
#define AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_GRAY10
#define AV_PIX_FMT_GRAY14
#define AV_PIX_FMT_YUV422P16
#define AV_PIX_FMT_GRAY16
#define AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_YUVA444P16
#define AV_PIX_FMT_YUVA422P16
#define AV_PIX_FMT_GBRP16
#define AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_YUVA444P9
#define AV_PIX_FMT_GBRP14
#define AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV444P10
Describe the class of an AVClass context structure.
void * priv
private data for use by the filter
A link between two filters.
int w
agreed upon image width
int h
agreed upon image height
AVFilterContext * src
source filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
AVFilterContext * dst
dest filter
int format
agreed upon media format
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
AVComplexFloat * fft_vdata_impulse_in[4]
void(* get_output)(struct ConvolveContext *s, AVComplexFloat *input, AVFrame *out, int w, int h, int n, int plane, float scale)
AVComplexFloat * fft_hdata_out[4]
void(* prepare_impulse)(AVFilterContext *ctx, AVFrame *impulsepic, int plane)
int(* filter)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
AVComplexFloat * fft_vdata_in[4]
AVTXContext * fft[4][MAX_THREADS]
AVComplexFloat * fft_vdata_out[4]
void(* get_input)(struct ConvolveContext *s, AVComplexFloat *fft_hdata, AVFrame *in, int w, int h, int n, int plane, float scale)
AVComplexFloat * fft_vdata_impulse_out[4]
AVTXContext * ifft[4][MAX_THREADS]
AVComplexFloat * fft_hdata_impulse_in[4]
AVComplexFloat * fft_hdata_impulse_out[4]
AVComplexFloat * fft_hdata_in[4]
Link properties exposed to filter code, but not external callers.
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable.
Used for passing data between threads.
AVComplexFloat * hdata_out
AVComplexFloat * vdata_out
AVComplexFloat * hdata_in
AVComplexFloat * vdata_in
static int imax(const int a, const int b)
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)
static AVFormatContext * ctx
av_cold void av_tx_uninit(AVTXContext **ctx)
Frees a context and sets *ctx to NULL, does nothing when *ctx == NULL.
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...
@ AV_TX_FLOAT_FFT
Standard complex to complex FFT with sample data type of AVComplexFloat, AVComplexDouble or AVComplex...
void(* av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride)
Function pointer to a function to perform the transform.
static int complex_xcorrelate(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static const AVFilterPad convolve_outputs[]
static const AVOption convolve_options[]
static int do_convolve(FFFrameSync *fs)
static int config_input_impulse(AVFilterLink *inlink)
static void prepare_impulse(AVFilterContext *ctx, AVFrame *impulsepic, int plane)
static void get_xoutput(ConvolveContext *s, AVComplexFloat *input, AVFrame *out, int w, int h, int n, int plane, float scale)
static int fft_horizontal(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int config_input(AVFilterLink *inlink)
static int fft_vertical(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static const AVFilterPad convolve_inputs[]
static int complex_multiply(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int activate(AVFilterContext *ctx)
static av_cold void uninit(AVFilterContext *ctx)
static int ifft_vertical(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static void prepare_secondary(AVFilterContext *ctx, AVFrame *secondary, int plane)
static void get_zeropadded_input(ConvolveContext *s, AVComplexFloat *fft_hdata, AVFrame *in, int w, int h, int n, int plane, float scale)
static int ifft_horizontal(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int config_output(AVFilterLink *outlink)
static void get_input(ConvolveContext *s, AVComplexFloat *fft_hdata, AVFrame *in, int w, int h, int n, int plane, float scale)
static int complex_divide(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static enum AVPixelFormat pixel_fmts_fftfilt[]
static void get_output(ConvolveContext *s, AVComplexFloat *input, AVFrame *out, int w, int h, int n, int plane, float scale)
static float mean(const float *input, int size)