FFmpeg
Data Structures | Macros | Functions | Variables
af_crossfeed.c File Reference
#include "libavutil/channel_layout.h"
#include "libavutil/ffmath.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "audio.h"
#include "filters.h"
#include "formats.h"

Go to the source code of this file.

Data Structures

struct  CrossfeedContext
 

Macros

#define OFFSET(x)   offsetof(CrossfeedContext, x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
#define AF   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Functions

static int query_formats (const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
 
static int config_input (AVFilterLink *inlink)
 
static void reverse_samples (double *dst, const double *src, int nb_samples)
 
static void filter_samples (double *dst, const double *src, int nb_samples, double b0, double b1, double b2, double a1, double a2, double *sw1, double *sw2)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in, int eof)
 
static int activate (AVFilterContext *ctx)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 
static av_cold void uninit (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (crossfeed)
 

Variables

static const AVOption crossfeed_options []
 
static const AVFilterPad inputs []
 
const AVFilter ff_af_crossfeed
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 352 of file af_crossfeed.c.

◆ FLAGS

Definition at line 353 of file af_crossfeed.c.

◆ AF

Definition at line 354 of file af_crossfeed.c.

Function Documentation

◆ query_formats()

static int query_formats ( const AVFilterContext ctx,
AVFilterFormatsConfig **  cfg_in,
AVFilterFormatsConfig **  cfg_out 
)
static

Definition at line 51 of file af_crossfeed.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 77 of file af_crossfeed.c.

Referenced by process_command().

◆ reverse_samples()

static void reverse_samples ( double dst,
const double src,
int  nb_samples 
)
static

Definition at line 113 of file af_crossfeed.c.

Referenced by filter_frame().

◆ filter_samples()

static void filter_samples ( double dst,
const double src,
int  nb_samples,
double  b0,
double  b1,
double  b2,
double  a1,
double  a2,
double sw1,
double sw2 
)
static

Definition at line 120 of file af_crossfeed.c.

Referenced by filter_frame().

◆ filter_frame()

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

Definition at line 143 of file af_crossfeed.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 285 of file af_crossfeed.c.

◆ process_command()

static int process_command ( AVFilterContext ctx,
const char *  cmd,
const char *  args,
char *  res,
int  res_len,
int  flags 
)
static

Definition at line 331 of file af_crossfeed.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 343 of file af_crossfeed.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( crossfeed  )

Variable Documentation

◆ crossfeed_options

const AVOption crossfeed_options[]
static
Initial value:
= {
{ "strength", "set crossfeed strength", OFFSET(strength), AV_OPT_TYPE_DOUBLE, {.dbl=.2}, 0, 1, FLAGS },
{ "range", "set soundstage wideness", OFFSET(range), AV_OPT_TYPE_DOUBLE, {.dbl=.5}, 0, 1, FLAGS },
{ "slope", "set curve slope", OFFSET(slope), AV_OPT_TYPE_DOUBLE, {.dbl=.5}, .01, 1, FLAGS },
{ "level_in", "set level in", OFFSET(level_in), AV_OPT_TYPE_DOUBLE, {.dbl=.9}, 0, 1, FLAGS },
{ "level_out", "set level out", OFFSET(level_out), AV_OPT_TYPE_DOUBLE, {.dbl=1.}, 0, 1, FLAGS },
{ "block_size", "set the block size", OFFSET(block_size),AV_OPT_TYPE_INT, {.i64=0}, 0, 32768, AF },
{ NULL }
}

Definition at line 356 of file af_crossfeed.c.

◆ inputs

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

Definition at line 368 of file af_crossfeed.c.

◆ ff_af_crossfeed

const AVFilter ff_af_crossfeed
Initial value:
= {
.name = "crossfeed",
.description = NULL_IF_CONFIG_SMALL("Apply headphone crossfeed filter."),
.priv_size = sizeof(CrossfeedContext),
.priv_class = &crossfeed_class,
.process_command = process_command,
}

Definition at line 376 of file af_crossfeed.c.

activate
static int activate(AVFilterContext *ctx)
Definition: af_crossfeed.c:285
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_crossfeed.c:331
inputs
static const AVFilterPad inputs[]
Definition: af_crossfeed.c:368
AF
#define AF
Definition: af_crossfeed.c:354
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_crossfeed.c:77
CrossfeedContext
Definition: af_crossfeed.c:28
FLAGS
#define FLAGS
Definition: af_crossfeed.c:353
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
Definition: opt.h:267
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
NULL
#define NULL
Definition: coverity.c:32
ff_audio_default_filterpad
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
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:94
range
enum AVColorRange range
Definition: mediacodec_wrapper.c:2594
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_crossfeed.c:343
FILTER_QUERY_FUNC2
#define FILTER_QUERY_FUNC2(func)
Definition: filters.h:239
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
OFFSET
#define OFFSET(x)
Definition: af_crossfeed.c:352
query_formats
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition: af_crossfeed.c:51
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:190