FFmpeg
Data Structures | Macros | Functions | Variables
af_virtualbass.c File Reference
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "filters.h"
#include "internal.h"
#include <float.h>

Go to the source code of this file.

Data Structures

struct  AudioVirtualBassContext
 

Macros

#define OFFSET(x)   offsetof(AudioVirtualBassContext, x)
 
#define TFLAGS   AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
 
#define SQR(x)   ((x) * (x))
 

Functions

 AVFILTER_DEFINE_CLASS (virtualbass)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static double vb_fun (double x)
 
static void vb_stereo (AVFilterContext *ctx, AVFrame *out, AVFrame *in)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 

Variables

static const AVOption virtualbass_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
const AVFilter ff_af_virtualbass
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 39 of file af_virtualbass.c.

◆ TFLAGS

Definition at line 40 of file af_virtualbass.c.

◆ FLAGS

Definition at line 41 of file af_virtualbass.c.

◆ SQR

#define SQR (   x)    ((x) * (x))

Definition at line 87 of file af_virtualbass.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( virtualbass  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 51 of file af_virtualbass.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 68 of file af_virtualbass.c.

◆ vb_fun()

static double vb_fun ( double  x)
static

Definition at line 89 of file af_virtualbass.c.

Referenced by vb_stereo().

◆ vb_stereo()

static void vb_stereo ( AVFilterContext ctx,
AVFrame out,
AVFrame in 
)
static

Definition at line 96 of file af_virtualbass.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 138 of file af_virtualbass.c.

Variable Documentation

◆ virtualbass_options

const AVOption virtualbass_options[]
static
Initial value:
= {
{ "cutoff", "set virtual bass cutoff", OFFSET(cutoff), AV_OPT_TYPE_DOUBLE, {.dbl=250},100,500, FLAGS },
{ "strength", "set virtual bass strength", OFFSET(strength), AV_OPT_TYPE_DOUBLE, {.dbl=3}, 0.5, 3, TFLAGS },
{NULL}
}

Definition at line 43 of file af_virtualbass.c.

◆ inputs

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

Definition at line 157 of file af_virtualbass.c.

◆ outputs

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

Definition at line 166 of file af_virtualbass.c.

◆ ff_af_virtualbass

const AVFilter ff_af_virtualbass
Initial value:
= {
.name = "virtualbass",
.description = NULL_IF_CONFIG_SMALL("Audio Virtual Bass."),
.priv_size = sizeof(AudioVirtualBassContext),
.priv_class = &virtualbass_class,
.process_command = ff_filter_process_command,
}

Definition at line 173 of file af_virtualbass.c.

FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:167
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_virtualbass.c:51
TFLAGS
#define TFLAGS
Definition: af_virtualbass.c:40
FLAGS
#define FLAGS
Definition: af_virtualbass.c:41
inputs
static const AVFilterPad inputs[]
Definition: af_virtualbass.c:157
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:227
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:190
NULL
#define NULL
Definition: coverity.c:32
outputs
static const AVFilterPad outputs[]
Definition: af_virtualbass.c:166
OFFSET
#define OFFSET(x)
Definition: af_virtualbass.c:39
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:115
ff_filter_process_command
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
Definition: avfilter.c:873
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_virtualbass.c:68
AudioVirtualBassContext
Definition: af_virtualbass.c:30
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_virtualbass.c:138
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:191
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:160