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/cpu.h"
#include "libavutil/opt.h"
#include "libavutil/eval.h"
#include "libavutil/tx.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 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 }
 
static double(*const func2 [])(void *, double, double) = { realf, imagf, NULL }
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
const AVFilter ff_af_afftfilt
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 62 of file af_afftfilt.c.

◆ A

Definition at line 63 of file af_afftfilt.c.

Enumeration Type Documentation

◆ anonymous enum

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 60 of file af_afftfilt.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( afftfilt  )

◆ getreal()

static double getreal ( void *  priv,
double  x,
double  ch 
)
inlinestatic

Definition at line 76 of file af_afftfilt.c.

Referenced by realf().

◆ getimag()

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

Definition at line 87 of file af_afftfilt.c.

Referenced by imagf().

◆ realf()

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

Definition at line 98 of file af_afftfilt.c.

◆ imagf()

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

Definition at line 99 of file af_afftfilt.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 104 of file af_afftfilt.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink)
static

Definition at line 225 of file af_afftfilt.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 342 of file af_afftfilt.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 399 of file af_afftfilt.c.

Variable Documentation

◆ var_names

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

Definition at line 59 of file af_afftfilt.c.

Referenced by config_input().

◆ afftfilt_options

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_OPTION("win_func", OFFSET(win_func), A, WFUNC_HANNING),
{ "overlap", "set window overlap", OFFSET(overlap), AV_OPT_TYPE_FLOAT, {.dbl=0.75}, 0, 1, A },
{ NULL },
}

Definition at line 65 of file af_afftfilt.c.

◆ func2_names

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

◆ func2

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

◆ inputs

const AVFilterPad inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
},
}

Definition at line 432 of file af_afftfilt.c.

◆ outputs

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
},
}

Definition at line 440 of file af_afftfilt.c.

◆ ff_af_afftfilt

const 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,
.activate = activate,
.uninit = uninit,
}

Definition at line 447 of file af_afftfilt.c.

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:69
FILTER_SINGLE_SAMPLEFMT
#define FILTER_SINGLE_SAMPLEFMT(sample_fmt_)
Definition: internal.h:184
WIN_FUNC_OPTION
#define WIN_FUNC_OPTION(win_func_opt_name, win_func_offset, flag, default_window_func)
Definition: window_func.h:36
outputs
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:440
inputs
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:432
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:191
NULL
#define NULL
Definition: coverity.c:32
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_afftfilt.c:104
WFUNC_HANNING
@ WFUNC_HANNING
Definition: window_func.h:28
A
#define A
Definition: af_afftfilt.c:63
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:117
activate
static int activate(AVFilterContext *ctx)
Definition: af_afftfilt.c:342
AFFTFiltContext
Definition: af_afftfilt.c:33
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:227
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_afftfilt.c:399
OFFSET
#define OFFSET(x)
Definition: af_afftfilt.c:62
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:192
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:138
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:228