FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
af_afftfilt.c File Reference
#include "libavutil/audio_fifo.h"
#include "libavutil/avstring.h"
#include "libavfilter/internal.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "libavcodec/avfft.h"
#include "libavutil/eval.h"
#include "audio.h"
#include "filters.h"
#include "window_func.h"

Go to the source code of this file.

Data Structures

struct  AFFTFiltContext
 

Macros

#define OFFSET(x)   offsetof(AFFTFiltContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Enumerations

enum  {
  VAR_SAMPLE_RATE, VAR_BIN, VAR_NBBINS, VAR_CHANNEL,
  VAR_CHANNELS, VAR_PTS, VAR_REAL, VAR_IMAG,
  VAR_VARS_NB
}
 

Functions

 AVFILTER_DEFINE_CLASS (afftfilt)
 
static double getreal (void *priv, double x, double ch)
 
static double getimag (void *priv, double x, double ch)
 
static double realf (void *priv, double x, double ch)
 
static double imagf (void *priv, double x, double ch)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink)
 
static int activate (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const char *const var_names [] = { "sr", "b", "nb", "ch", "chs", "pts", "re", "im", NULL }
 
static const AVOption afftfilt_options []
 
static const char *const func2_names [] = { "real", "imag", NULL }
 
double(* func2 [])(void *, double, double) = { realf, imagf, NULL }
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
AVFilter ff_af_afftfilt
 

Macro Definition Documentation

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

Definition at line 59 of file af_afftfilt.c.

Definition at line 60 of file af_afftfilt.c.

Enumeration Type Documentation

anonymous enum
Enumerator
VAR_SAMPLE_RATE 
VAR_BIN 
VAR_NBBINS 
VAR_CHANNEL 
VAR_CHANNELS 
VAR_PTS 
VAR_REAL 
VAR_IMAG 
VAR_VARS_NB 

Definition at line 57 of file af_afftfilt.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( afftfilt  )
static double getreal ( void priv,
double  x,
double  ch 
)
inlinestatic

Definition at line 94 of file af_afftfilt.c.

Referenced by realf().

static double getimag ( void priv,
double  x,
double  ch 
)
inlinestatic

Definition at line 105 of file af_afftfilt.c.

Referenced by imagf().

static double realf ( void priv,
double  x,
double  ch 
)
static

Definition at line 116 of file af_afftfilt.c.

static double imagf ( void priv,
double  x,
double  ch 
)
static

Definition at line 117 of file af_afftfilt.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 122 of file af_afftfilt.c.

static int filter_frame ( AVFilterLink inlink)
static

Definition at line 229 of file af_afftfilt.c.

Referenced by activate().

static int activate ( AVFilterContext ctx)
static

Definition at line 340 of file af_afftfilt.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 397 of file af_afftfilt.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 427 of file af_afftfilt.c.

Variable Documentation

const char* const var_names[] = { "sr", "b", "nb", "ch", "chs", "pts", "re", "im", NULL }
static

Definition at line 56 of file af_afftfilt.c.

Referenced by config_input().

const AVOption afftfilt_options[]
static
Initial value:
= {
{ "real", "set channels real expressions", OFFSET(real_str), AV_OPT_TYPE_STRING, {.str = "re" }, 0, 0, A },
{ "imag", "set channels imaginary expressions", OFFSET(img_str), AV_OPT_TYPE_STRING, {.str = "im" }, 0, 0, A },
{ "win_size", "set window size", OFFSET(fft_size), AV_OPT_TYPE_INT, {.i64=4096}, 16, 131072, A },
{ "win_func", "set window function", OFFSET(win_func), AV_OPT_TYPE_INT, {.i64 = WFUNC_HANNING}, 0, NB_WFUNC-1, A, "win_func" },
{ "rect", "Rectangular", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_RECT}, 0, 0, A, "win_func" },
{ "bartlett", "Bartlett", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BARTLETT}, 0, 0, A, "win_func" },
{ "hann", "Hann", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_HANNING}, 0, 0, A, "win_func" },
{ "hanning", "Hanning", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_HANNING}, 0, 0, A, "win_func" },
{ "hamming", "Hamming", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_HAMMING}, 0, 0, A, "win_func" },
{ "blackman", "Blackman", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BLACKMAN}, 0, 0, A, "win_func" },
{ "welch", "Welch", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_WELCH}, 0, 0, A, "win_func" },
{ "flattop", "Flat-top", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_FLATTOP}, 0, 0, A, "win_func" },
{ "bharris", "Blackman-Harris", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BHARRIS}, 0, 0, A, "win_func" },
{ "bnuttall", "Blackman-Nuttall", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BNUTTALL}, 0, 0, A, "win_func" },
{ "bhann", "Bartlett-Hann", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BHANN}, 0, 0, A, "win_func" },
{ "sine", "Sine", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_SINE}, 0, 0, A, "win_func" },
{ "nuttall", "Nuttall", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_NUTTALL}, 0, 0, A, "win_func" },
{ "lanczos", "Lanczos", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_LANCZOS}, 0, 0, A, "win_func" },
{ "gauss", "Gauss", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_GAUSS}, 0, 0, A, "win_func" },
{ "tukey", "Tukey", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_TUKEY}, 0, 0, A, "win_func" },
{ "dolph", "Dolph-Chebyshev", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_DOLPH}, 0, 0, A, "win_func" },
{ "cauchy", "Cauchy", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_CAUCHY}, 0, 0, A, "win_func" },
{ "parzen", "Parzen", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_PARZEN}, 0, 0, A, "win_func" },
{ "poisson", "Poisson", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_POISSON}, 0, 0, A, "win_func" },
{ "bohman", "Bohman", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BOHMAN}, 0, 0, A, "win_func" },
{ "overlap", "set window overlap", OFFSET(overlap), AV_OPT_TYPE_FLOAT, {.dbl=0.75}, 0, 1, A },
{ NULL },
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: af_afftfilt.c:59
#define A
Definition: af_afftfilt.c:60

Definition at line 62 of file af_afftfilt.c.

const char* const func2_names[] = { "real", "imag", NULL }
static

Definition at line 119 of file af_afftfilt.c.

Referenced by config_input(), geq_init(), and initialize().

double(* func2[])(void *, double, double) = { realf, imagf, NULL }

Definition at line 120 of file af_afftfilt.c.

Referenced by config_input(), geq_init(), and initialize().

const AVFilterPad inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_input(AVFilterLink *inlink)
Definition: af_afftfilt.c:122

Definition at line 457 of file af_afftfilt.c.

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32

Definition at line 466 of file af_afftfilt.c.

AVFilter ff_af_afftfilt
Initial value:
= {
.name = "afftfilt",
.description = NULL_IF_CONFIG_SMALL("Apply arbitrary expressions to samples in frequency domain."),
.priv_size = sizeof(AFFTFiltContext),
.priv_class = &afftfilt_class,
}
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_afftfilt.c:427
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static int query_formats(AVFilterContext *ctx)
Definition: af_afftfilt.c:397
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:466
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:457
static int activate(AVFilterContext *ctx)
Definition: af_afftfilt.c:340

Definition at line 474 of file af_afftfilt.c.