FFmpeg
Loading...
Searching...
No Matches
af_afftfilt.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/mem.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)
 
#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 []
 
const FFFilter ff_af_afftfilt
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET ( x)
Value:

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

◆ filter_frame()

static int filter_frame ( AVFilterLink * inlink,
AVFrame * in )
static

Definition at line 306 of file af_afftfilt.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext * ctx)
static

Definition at line 368 of file af_afftfilt.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext * ctx)
static

Definition at line 398 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.

◆ 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 },
}
#define A(x)
Definition vpx_arith.h:28
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
Definition opt.h:270
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition opt.h:275
#define WIN_FUNC_OPTION(win_func_opt_name, win_func_offset, flag, default_window_func)
Definition window_func.h:37
@ WFUNC_HANNING
Definition window_func.h:29

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) ( void * ,
double ,
double  ) = { realf, imagf, NULL }
static

◆ inputs

const AVFilterPad inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
},
}
static int config_input(AVFilterLink *inlink)
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201

Definition at line 435 of file af_afftfilt.c.

◆ ff_af_afftfilt

const FFFilter ff_af_afftfilt
Initial value:
= {
.p.name = "afftfilt",
.p.description = NULL_IF_CONFIG_SMALL("Apply arbitrary expressions to samples in frequency domain."),
.p.priv_class = &afftfilt_class,
.priv_size = sizeof(AFFTFiltContext),
.activate = activate,
.uninit = uninit,
}
static const AVFilterPad inputs[]
Definition af_aap.c:299
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
Definition audio.c:34
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition avfilter.h:166
#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:204
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition samplefmt.h:66
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int activate(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FILTER_SINGLE_SAMPLEFMT(sample_fmt_)
Definition filters.h:257
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88

Definition at line 443 of file af_afftfilt.c.