FFmpeg  4.0
Data Structures | Macros | Functions | Variables
vf_convolve.c File Reference
#include <float.h>
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavcodec/avfft.h"
#include "avfilter.h"
#include "formats.h"
#include "framesync.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  ConvolveContext
 
struct  ThreadData
 

Macros

#define MAX_THREADS   16
 
#define OFFSET(x)   offsetof(ConvolveContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Functions

static int query_formats (AVFilterContext *ctx)
 
static int config_input_main (AVFilterLink *inlink)
 
static int config_input_impulse (AVFilterLink *inlink)
 
static int fft_horizontal (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static void get_input (ConvolveContext *s, FFTComplex *fft_hdata, AVFrame *in, int w, int h, int n, int plane, float scale)
 
static int fft_vertical (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int ifft_vertical (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int ifft_horizontal (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static void get_output (ConvolveContext *s, FFTComplex *input, AVFrame *out, int w, int h, int n, int plane, float scale)
 
static int complex_multiply (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int complex_divide (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int do_convolve (FFFrameSync *fs)
 
static int config_output (AVFilterLink *outlink)
 
static int activate (AVFilterContext *ctx)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption convolve_options []
 
static const AVFilterPad convolve_inputs []
 
static const AVFilterPad convolve_outputs []
 

Macro Definition Documentation

◆ MAX_THREADS

#define MAX_THREADS   16

Definition at line 34 of file vf_convolve.c.

Referenced by config_output(), do_convolve(), and uninit().

◆ OFFSET

#define OFFSET (   x)    offsetof(ConvolveContext, x)

Definition at line 63 of file vf_convolve.c.

◆ FLAGS

Definition at line 64 of file vf_convolve.c.

Function Documentation

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 75 of file vf_convolve.c.

◆ config_input_main()

static int config_input_main ( AVFilterLink inlink)
static

Definition at line 104 of file vf_convolve.c.

◆ config_input_impulse()

static int config_input_impulse ( AVFilterLink inlink)
static

Definition at line 144 of file vf_convolve.c.

◆ fft_horizontal()

static int fft_horizontal ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 166 of file vf_convolve.c.

Referenced by do_convolve().

◆ get_input()

static void get_input ( ConvolveContext s,
FFTComplex fft_hdata,
AVFrame in,
int  w,
int  h,
int  n,
int  plane,
float  scale 
)
static

Definition at line 185 of file vf_convolve.c.

Referenced by do_convolve().

◆ fft_vertical()

static int fft_vertical ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 260 of file vf_convolve.c.

Referenced by do_convolve().

◆ ifft_vertical()

static int ifft_vertical ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 285 of file vf_convolve.c.

Referenced by do_convolve().

◆ ifft_horizontal()

static int ifft_horizontal ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 310 of file vf_convolve.c.

Referenced by do_convolve().

◆ get_output()

static void get_output ( ConvolveContext s,
FFTComplex input,
AVFrame out,
int  w,
int  h,
int  n,
int  plane,
float  scale 
)
static

Definition at line 329 of file vf_convolve.c.

Referenced by do_convolve().

◆ complex_multiply()

static int complex_multiply ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 382 of file vf_convolve.c.

Referenced by init().

◆ complex_divide()

static int complex_divide ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 413 of file vf_convolve.c.

Referenced by init().

◆ do_convolve()

static int do_convolve ( FFFrameSync fs)
static

Definition at line 445 of file vf_convolve.c.

Referenced by config_output().

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 527 of file vf_convolve.c.

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 559 of file vf_convolve.c.

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 565 of file vf_convolve.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 580 of file vf_convolve.c.

Variable Documentation

◆ convolve_options

const AVOption convolve_options[]
static
Initial value:
= {
{ "planes", "set planes to convolve", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=7}, 0, 15, FLAGS },
{ "impulse", "when to process impulses", OFFSET(impulse), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS, "impulse" },
{ "first", "process only first impulse, ignore rest", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "impulse" },
{ "all", "process all impulses", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "impulse" },
{ "noise", "set noise", OFFSET(noise), AV_OPT_TYPE_FLOAT, {.dbl=0.0000001}, 0, 1, FLAGS },
{ NULL },
}
#define NULL
Definition: coverity.c:32
#define FLAGS
Definition: vf_convolve.c:64
#define OFFSET(x)
Definition: vf_convolve.c:63
static int noise(AVBSFContext *ctx, AVPacket *pkt)
Definition: noise_bsf.c:38
static const struct @272 planes[]

Definition at line 66 of file vf_convolve.c.

◆ convolve_inputs

const AVFilterPad convolve_inputs[]
static
Initial value:
= {
{
.name = "main",
.config_props = config_input_main,
},{
.name = "impulse",
.config_props = config_input_impulse,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_input_main(AVFilterLink *inlink)
Definition: vf_convolve.c:104
static int config_input_impulse(AVFilterLink *inlink)
Definition: vf_convolve.c:144

Definition at line 600 of file vf_convolve.c.

◆ convolve_outputs

const AVFilterPad convolve_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_output(AVFilterLink *outlink)
Definition: vf_convolve.c:527

Definition at line 613 of file vf_convolve.c.