FFmpeg  4.0
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

◆ AF

Definition at line 532 of file af_afir.c.

◆ OFFSET

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

Definition at line 533 of file af_afir.c.

Function Documentation

◆ fcmul_add_c()

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().

◆ fir_channel()

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().

◆ 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().

◆ convert_coeffs()

static int convert_coeffs ( AVFilterContext ctx)
static

Definition at line 165 of file af_afir.c.

Referenced by filter_frame().

◆ read_ir()

static int read_ir ( AVFilterLink link,
AVFrame frame 
)
static

Definition at line 280 of file af_afir.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink link,
AVFrame frame 
)
static

Definition at line 302 of file af_afir.c.

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 335 of file af_afir.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 374 of file af_afir.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 402 of file af_afir.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 443 of file af_afir.c.

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 493 of file af_afir.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( afir  )

Variable Documentation

◆ afir_inputs

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:280
static int filter_frame(AVFilterLink *link, AVFrame *frame)
Definition: af_afir.c:302

Definition at line 509 of file af_afir.c.

◆ afir_outputs

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:402
static int request_frame(AVFilterLink *outlink)
Definition: af_afir.c:335

Definition at line 522 of file af_afir.c.

◆ afir_options

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
#define AF
Definition: af_afir.c:532
#define OFFSET(x)
Definition: af_afir.c:533
const char int length
Definition: avisynth_c.h:768

Definition at line 535 of file af_afir.c.

◆ ff_af_afir

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:55
static av_cold int init(AVFilterContext *ctx)
Definition: af_afir.c:493
static int query_formats(AVFilterContext *ctx)
Definition: af_afir.c:374
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
#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:522
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_afir.c:443
static const AVFilterPad afir_inputs[]
Definition: af_afir.c:509

Definition at line 545 of file af_afir.c.