FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
af_afftfilt.c File Reference
#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 tx_channel (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_channel (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
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 59 of file af_afftfilt.c.

◆ A

Definition at line 60 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 57 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 73 of file af_afftfilt.c.

Referenced by realf().

◆ getimag()

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

Definition at line 84 of file af_afftfilt.c.

Referenced by imagf().

◆ realf()

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

Definition at line 95 of file af_afftfilt.c.

◆ imagf()

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

Definition at line 96 of file af_afftfilt.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 101 of file af_afftfilt.c.

◆ tx_channel()

static int tx_channel ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 232 of file af_afftfilt.c.

Referenced by filter_frame().

◆ filter_channel()

static int filter_channel ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 249 of file af_afftfilt.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 305 of file af_afftfilt.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 367 of file af_afftfilt.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 397 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 56 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 62 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 434 of file af_afftfilt.c.

◆ outputs

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

Definition at line 442 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 449 of file af_afftfilt.c.

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:66
FILTER_SINGLE_SAMPLEFMT
#define FILTER_SINGLE_SAMPLEFMT(sample_fmt_)
Definition: internal.h:183
WIN_FUNC_OPTION
#define WIN_FUNC_OPTION(win_func_opt_name, win_func_offset, flag, default_window_func)
Definition: window_func.h:37
outputs
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:442
inputs
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:434
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:190
NULL
#define NULL
Definition: coverity.c:32
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_afftfilt.c:101
WFUNC_HANNING
@ WFUNC_HANNING
Definition: window_func.h:29
A
#define A
Definition: af_afftfilt.c:60
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:367
AFFTFiltContext
Definition: af_afftfilt.c:32
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:228
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_afftfilt.c:397
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:127
OFFSET
#define OFFSET(x)
Definition: af_afftfilt.c:59
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:191
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:160
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229