FFmpeg  4.0
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 "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_VARS_NB
}
 

Functions

 AVFILTER_DEFINE_CLASS (afftfilt)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
 
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", NULL }
 
static const AVOption afftfilt_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
AVFilter ff_af_afftfilt
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 57 of file af_afftfilt.c.

◆ A

Definition at line 58 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_VARS_NB 

Definition at line 55 of file af_afftfilt.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( afftfilt  )

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 91 of file af_afftfilt.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 188 of file af_afftfilt.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 324 of file af_afftfilt.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 354 of file af_afftfilt.c.

Variable Documentation

◆ var_names

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

Definition at line 54 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 = "1" }, 0, 0, A },
{ "imag", "set channels imaginary expressions", OFFSET(img_str), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, A },
{ "win_size", "set window size", OFFSET(fft_bits), AV_OPT_TYPE_INT, {.i64=12}, 4, 17, A, "fft" },
{ "w16", 0, 0, AV_OPT_TYPE_CONST, {.i64=4}, 0, 0, A, "fft" },
{ "w32", 0, 0, AV_OPT_TYPE_CONST, {.i64=5}, 0, 0, A, "fft" },
{ "w64", 0, 0, AV_OPT_TYPE_CONST, {.i64=6}, 0, 0, A, "fft" },
{ "w128", 0, 0, AV_OPT_TYPE_CONST, {.i64=7}, 0, 0, A, "fft" },
{ "w256", 0, 0, AV_OPT_TYPE_CONST, {.i64=8}, 0, 0, A, "fft" },
{ "w512", 0, 0, AV_OPT_TYPE_CONST, {.i64=9}, 0, 0, A, "fft" },
{ "w1024", 0, 0, AV_OPT_TYPE_CONST, {.i64=10}, 0, 0, A, "fft" },
{ "w2048", 0, 0, AV_OPT_TYPE_CONST, {.i64=11}, 0, 0, A, "fft" },
{ "w4096", 0, 0, AV_OPT_TYPE_CONST, {.i64=12}, 0, 0, A, "fft" },
{ "w8192", 0, 0, AV_OPT_TYPE_CONST, {.i64=13}, 0, 0, A, "fft" },
{ "w16384", 0, 0, AV_OPT_TYPE_CONST, {.i64=14}, 0, 0, A, "fft" },
{ "w32768", 0, 0, AV_OPT_TYPE_CONST, {.i64=15}, 0, 0, A, "fft" },
{ "w65536", 0, 0, AV_OPT_TYPE_CONST, {.i64=16}, 0, 0, A, "fft" },
{ "w131072",0, 0, AV_OPT_TYPE_CONST, {.i64=17}, 0, 0, A, "fft" },
{ "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" },
{ "sine", "Sine", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_SINE}, 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:57
#define A
Definition: af_afftfilt.c:58

Definition at line 60 of file af_afftfilt.c.

◆ inputs

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

Definition at line 381 of file af_afftfilt.c.

◆ outputs

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

Definition at line 391 of file af_afftfilt.c.

◆ ff_af_afftfilt

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:354
#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:324
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:391
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:381

Definition at line 399 of file af_afftfilt.c.