FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
af_afir.c File Reference

An arbitrary audio FIR filter. More...

#include "libavutil/audio_fifo.h"
#include "libavutil/common.h"
#include "libavutil/float_dsp.h"
#include "libavutil/opt.h"
#include "libavcodec/avfft.h"
#include "audio.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "af_afir.h"

Go to the source code of this file.

Macros

#define AF   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define OFFSET(x)   offsetof(AudioFIRContext, x)
 

Functions

static void fcmul_add_c (float *sum, const float *t, const float *c, ptrdiff_t len)
 
static int fir_channel (AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
 
static int fir_frame (AudioFIRContext *s, AVFilterLink *outlink)
 
static int convert_coeffs (AVFilterContext *ctx)
 
static int read_ir (AVFilterLink *link, AVFrame *frame)
 
static int filter_frame (AVFilterLink *link, AVFrame *frame)
 
static int request_frame (AVFilterLink *outlink)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_output (AVFilterLink *outlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static av_cold int init (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (afir)
 

Variables

static const AVFilterPad afir_inputs []
 
static const AVFilterPad afir_outputs []
 
static const AVOption afir_options []
 
AVFilter ff_af_afir
 

Detailed Description

An arbitrary audio FIR filter.

Definition in file af_afir.c.

Macro Definition Documentation

Definition at line 511 of file af_afir.c.

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

Definition at line 512 of file af_afir.c.

Function Documentation

static void fcmul_add_c ( float *  sum,
const float *  t,
const float *  c,
ptrdiff_t  len 
)
static

Definition at line 38 of file af_afir.c.

Referenced by init().

static int fir_channel ( AVFilterContext ctx,
void arg,
int  ch,
int  nb_jobs 
)
static

Definition at line 55 of file af_afir.c.

Referenced by fir_frame().

static int fir_frame ( AudioFIRContext s,
AVFilterLink outlink 
)
static

Definition at line 115 of file af_afir.c.

Referenced by filter_frame(), and request_frame().

static int convert_coeffs ( AVFilterContext ctx)
static

Definition at line 165 of file af_afir.c.

Referenced by filter_frame().

static int read_ir ( AVFilterLink link,
AVFrame frame 
)
static

Definition at line 266 of file af_afir.c.

static int filter_frame ( AVFilterLink link,
AVFrame frame 
)
static

Definition at line 286 of file af_afir.c.

static int request_frame ( AVFilterLink outlink)
static

Definition at line 316 of file af_afir.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 353 of file af_afir.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 381 of file af_afir.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 422 of file af_afir.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 472 of file af_afir.c.

AVFILTER_DEFINE_CLASS ( afir  )

Variable Documentation

const AVFilterPad afir_inputs[]
static
Initial value:
= {
{
.name = "main",
.filter_frame = filter_frame,
},{
.name = "ir",
.filter_frame = read_ir,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int read_ir(AVFilterLink *link, AVFrame *frame)
Definition: af_afir.c:266
static int filter_frame(AVFilterLink *link, AVFrame *frame)
Definition: af_afir.c:286

Definition at line 488 of file af_afir.c.

const AVFilterPad afir_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
.request_frame = request_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_output(AVFilterLink *outlink)
Definition: af_afir.c:381
static int request_frame(AVFilterLink *outlink)
Definition: af_afir.c:316

Definition at line 501 of file af_afir.c.

const AVOption afir_options[]
static
Initial value:
= {
{ "dry", "set dry gain", OFFSET(dry_gain), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, AF },
{ "wet", "set wet gain", OFFSET(wet_gain), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, AF },
{ "length", "set IR length", OFFSET(length), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, AF },
{ "again", "enable auto gain", OFFSET(again), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, AF },
{ NULL }
}
#define NULL
Definition: coverity.c:32
GLsizei GLsizei * length
Definition: opengl_enc.c:115
#define AF
Definition: af_afir.c:511
#define OFFSET(x)
Definition: af_afir.c:512

Definition at line 514 of file af_afir.c.

AVFilter ff_af_afir
Initial value:
= {
.name = "afir",
.description = NULL_IF_CONFIG_SMALL("Apply Finite Impulse Response filter with supplied coefficients in 2nd stream."),
.priv_size = sizeof(AudioFIRContext),
.priv_class = &afir_class,
.init = init,
}
static int flags
Definition: log.c:57
static av_cold int init(AVFilterContext *ctx)
Definition: af_afir.c:472
static int query_formats(AVFilterContext *ctx)
Definition: af_afir.c:353
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:179
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
static const AVFilterPad afir_outputs[]
Definition: af_afir.c:501
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:389
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:379
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_afir.c:422
static const AVFilterPad afir_inputs[]
Definition: af_afir.c:488

Definition at line 524 of file af_afir.c.