FFmpeg
Data Structures | Macros | Typedefs | Functions | Variables
af_bs2b.c File Reference
#include <bs2b.h>
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "filters.h"
#include "formats.h"

Go to the source code of this file.

Data Structures

struct  Bs2bContext
 

Macros

#define OFFSET(x)   offsetof(Bs2bContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
 

Typedefs

typedef void(* filter_func) (t_bs2bdp bs2bdp, uint8_t *sample, int n)
 

Functions

 AVFILTER_DEFINE_CLASS (bs2b)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int query_formats (const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
 
static int config_output (AVFilterLink *outlink)
 

Variables

static const AVOption bs2b_options []
 
static const AVFilterPad bs2b_inputs []
 
static const AVFilterPad bs2b_outputs []
 
const AVFilter ff_af_bs2b
 

Detailed Description

Bauer stereo-to-binaural filter

Definition in file af_bs2b.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 49 of file af_bs2b.c.

◆ A

Definition at line 50 of file af_bs2b.c.

Typedef Documentation

◆ filter_func

typedef void(* filter_func) (t_bs2bdp bs2bdp, uint8_t *sample, int n)

Definition at line 35 of file af_bs2b.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( bs2b  )

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 67 of file af_bs2b.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 85 of file af_bs2b.c.

◆ query_formats()

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

Definition at line 93 of file af_bs2b.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 123 of file af_bs2b.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 156 of file af_bs2b.c.

Variable Documentation

◆ bs2b_options

const AVOption bs2b_options[]
static
Initial value:
= {
{ "profile", "Apply a pre-defined crossfeed level",
OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = BS2B_DEFAULT_CLEVEL }, 0, INT_MAX, A, .unit = "profile" },
{ "default", "default profile", 0, AV_OPT_TYPE_CONST, { .i64 = BS2B_DEFAULT_CLEVEL }, 0, 0, A, .unit = "profile" },
{ "cmoy", "Chu Moy circuit", 0, AV_OPT_TYPE_CONST, { .i64 = BS2B_CMOY_CLEVEL }, 0, 0, A, .unit = "profile" },
{ "jmeier", "Jan Meier circuit", 0, AV_OPT_TYPE_CONST, { .i64 = BS2B_JMEIER_CLEVEL }, 0, 0, A, .unit = "profile" },
{ "fcut", "Set cut frequency (in Hz)",
OFFSET(fcut), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, BS2B_MAXFCUT, A },
{ "feed", "Set feed level (in Hz)",
OFFSET(feed), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, BS2B_MAXFEED, A },
{ NULL },
}

Definition at line 52 of file af_bs2b.c.

◆ bs2b_inputs

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

Definition at line 192 of file af_bs2b.c.

◆ bs2b_outputs

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

Definition at line 200 of file af_bs2b.c.

◆ ff_af_bs2b

const AVFilter ff_af_bs2b
Initial value:
= {
.name = "bs2b",
.description = NULL_IF_CONFIG_SMALL("Bauer stereo-to-binaural filter."),
.priv_size = sizeof(Bs2bContext),
.priv_class = &bs2b_class,
.init = init,
}

Definition at line 208 of file af_bs2b.c.

feed
static void feed(AVFilterContext *ctx, int ch, const float *in_samples, float *out_samples, float *in_frame, float *out_dist_frame, float *windowed_frame, float *drc_frame, float *spectrum_buf, float *energy, float *target_gain, float *envelope, float *factors)
Definition: af_adrc.c:275
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
query_formats
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition: af_bs2b.c:93
bs2b_outputs
static const AVFilterPad bs2b_outputs[]
Definition: af_bs2b.c:200
Bs2bContext
Definition: af_bs2b.c:37
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
A
#define A
Definition: af_bs2b.c:50
NULL
#define NULL
Definition: coverity.c:32
init
static av_cold int init(AVFilterContext *ctx)
Definition: af_bs2b.c:67
config_output
static int config_output(AVFilterLink *outlink)
Definition: af_bs2b.c:156
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
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: af_bs2b.c:123
OFFSET
#define OFFSET(x)
Definition: af_bs2b.c:49
FILTER_QUERY_FUNC2
#define FILTER_QUERY_FUNC2(func)
Definition: filters.h:239
profile
int profile
Definition: mxfenc.c:2228
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_bs2b.c:85
bs2b_inputs
static const AVFilterPad bs2b_inputs[]
Definition: af_bs2b.c:192