FFmpeg
Data Structures | Macros | Functions | Variables
af_surround.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/audio_fifo.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "libavcodec/avfft.h"
#include "avfilter.h"
#include "audio.h"
#include "filters.h"
#include "internal.h"
#include "formats.h"
#include "window_func.h"

Go to the source code of this file.

Data Structures

struct  AudioSurroundContext
 

Macros

#define OFFSET(x)   offsetof(AudioSurroundContext, x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Functions

static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int config_output (AVFilterLink *outlink)
 
static void stereo_transform (float *x, float *y, float angle)
 
static void stereo_position (float a, float p, float *x, float *y)
 
static void get_lfe (int output_lfe, int n, float lowcut, float highcut, float *lfe_mag, float *mag_total, int lfe_mode)
 
static void upmix_1_0 (AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
 
static void upmix_stereo (AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
 
static void upmix_2_1 (AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
 
static void upmix_3_0 (AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
 
static void upmix_3_1 (AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
 
static void upmix_3_1_surround (AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float c_mag, float mag_total, float x, float y, int n)
 
static void upmix_4_0 (AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
 
static void upmix_4_1 (AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
 
static void upmix_5_0_back (AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
 
static void upmix_5_1_back (AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
 
static void upmix_6_0 (AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
 
static void upmix_6_1 (AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
 
static void upmix_5_1_back_surround (AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float c_mag, float mag_total, float x, float y, int n)
 
static void upmix_5_1_back_2_1 (AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float lfe_re, float lfe_im, float x, float y, int n)
 
static void upmix_7_0 (AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
 
static void upmix_7_1 (AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
 
static void upmix_7_1_5_0_side (AVFilterContext *ctx, float c_re, float c_im, float mag_totall, float mag_totalr, float fl_phase, float fr_phase, float bl_phase, float br_phase, float sl_phase, float sr_phase, float xl, float yl, float xr, float yr, int n)
 
static void upmix_7_1_5_1 (AVFilterContext *ctx, float c_re, float c_im, float lfe_re, float lfe_im, float mag_totall, float mag_totalr, float fl_phase, float fr_phase, float bl_phase, float br_phase, float sl_phase, float sr_phase, float xl, float yl, float xr, float yr, int n)
 
static void filter_stereo (AVFilterContext *ctx)
 
static void filter_surround (AVFilterContext *ctx)
 
static void filter_2_1 (AVFilterContext *ctx)
 
static void filter_5_0_side (AVFilterContext *ctx)
 
static void filter_5_1_side (AVFilterContext *ctx)
 
static void filter_5_1_back (AVFilterContext *ctx)
 
static av_cold int init (AVFilterContext *ctx)
 
static int fft_channel (AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
 
static int ifft_channel (AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
 
static int filter_frame (AVFilterLink *inlink)
 
static int activate (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (surround)
 

Variables

static const AVOption surround_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
AVFilter ff_af_surround
 

Macro Definition Documentation

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

Definition at line 1690 of file af_surround.c.

Definition at line 1691 of file af_surround.c.

Function Documentation

static int query_formats ( AVFilterContext ctx)
static

Definition at line 159 of file af_surround.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 197 of file af_surround.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 260 of file af_surround.c.

static void stereo_transform ( float *  x,
float *  y,
float  angle 
)
static

Definition at line 317 of file af_surround.c.

Referenced by filter_2_1(), filter_stereo(), and filter_surround().

static void stereo_position ( float  a,
float  p,
float *  x,
float *  y 
)
static
static void get_lfe ( int  output_lfe,
int  n,
float  lowcut,
float  highcut,
float *  lfe_mag,
float *  mag_total,
int  lfe_mode 
)
inlinestatic
static void upmix_1_0 ( AVFilterContext ctx,
float  l_phase,
float  r_phase,
float  c_phase,
float  mag_total,
float  x,
float  y,
int  n 
)
static

Definition at line 358 of file af_surround.c.

Referenced by init().

static void upmix_stereo ( AVFilterContext ctx,
float  l_phase,
float  r_phase,
float  c_phase,
float  mag_total,
float  x,
float  y,
int  n 
)
static

Definition at line 377 of file af_surround.c.

static void upmix_2_1 ( AVFilterContext ctx,
float  l_phase,
float  r_phase,
float  c_phase,
float  mag_total,
float  x,
float  y,
int  n 
)
static

Definition at line 401 of file af_surround.c.

static void upmix_3_0 ( AVFilterContext ctx,
float  l_phase,
float  r_phase,
float  c_phase,
float  mag_total,
float  x,
float  y,
int  n 
)
static

Definition at line 431 of file af_surround.c.

static void upmix_3_1 ( AVFilterContext ctx,
float  l_phase,
float  r_phase,
float  c_phase,
float  mag_total,
float  x,
float  y,
int  n 
)
static

Definition at line 460 of file af_surround.c.

Referenced by init().

static void upmix_3_1_surround ( AVFilterContext ctx,
float  l_phase,
float  r_phase,
float  c_phase,
float  c_mag,
float  mag_total,
float  x,
float  y,
int  n 
)
static

Definition at line 495 of file af_surround.c.

Referenced by init().

static void upmix_4_0 ( AVFilterContext ctx,
float  l_phase,
float  r_phase,
float  c_phase,
float  mag_total,
float  x,
float  y,
int  n 
)
static

Definition at line 530 of file af_surround.c.

Referenced by init().

static void upmix_4_1 ( AVFilterContext ctx,
float  l_phase,
float  r_phase,
float  c_phase,
float  mag_total,
float  x,
float  y,
int  n 
)
static

Definition at line 564 of file af_surround.c.

Referenced by init().

static void upmix_5_0_back ( AVFilterContext ctx,
float  l_phase,
float  r_phase,
float  c_phase,
float  mag_total,
float  x,
float  y,
int  n 
)
static

Definition at line 604 of file af_surround.c.

Referenced by init().

static void upmix_5_1_back ( AVFilterContext ctx,
float  l_phase,
float  r_phase,
float  c_phase,
float  mag_total,
float  x,
float  y,
int  n 
)
static

Definition at line 643 of file af_surround.c.

Referenced by init().

static void upmix_6_0 ( AVFilterContext ctx,
float  l_phase,
float  r_phase,
float  c_phase,
float  mag_total,
float  x,
float  y,
int  n 
)
static

Definition at line 688 of file af_surround.c.

Referenced by init().

static void upmix_6_1 ( AVFilterContext ctx,
float  l_phase,
float  r_phase,
float  c_phase,
float  mag_total,
float  x,
float  y,
int  n 
)
static

Definition at line 732 of file af_surround.c.

Referenced by init().

static void upmix_5_1_back_surround ( AVFilterContext ctx,
float  l_phase,
float  r_phase,
float  c_phase,
float  c_mag,
float  mag_total,
float  x,
float  y,
int  n 
)
static

Definition at line 782 of file af_surround.c.

Referenced by init().

static void upmix_5_1_back_2_1 ( AVFilterContext ctx,
float  l_phase,
float  r_phase,
float  c_phase,
float  mag_total,
float  lfe_re,
float  lfe_im,
float  x,
float  y,
int  n 
)
static

Definition at line 828 of file af_surround.c.

Referenced by init().

static void upmix_7_0 ( AVFilterContext ctx,
float  l_phase,
float  r_phase,
float  c_phase,
float  mag_total,
float  x,
float  y,
int  n 
)
static

Definition at line 874 of file af_surround.c.

Referenced by init().

static void upmix_7_1 ( AVFilterContext ctx,
float  l_phase,
float  r_phase,
float  c_phase,
float  mag_total,
float  x,
float  y,
int  n 
)
static

Definition at line 924 of file af_surround.c.

Referenced by init().

static void upmix_7_1_5_0_side ( AVFilterContext ctx,
float  c_re,
float  c_im,
float  mag_totall,
float  mag_totalr,
float  fl_phase,
float  fr_phase,
float  bl_phase,
float  br_phase,
float  sl_phase,
float  sr_phase,
float  xl,
float  yl,
float  xr,
float  yr,
int  n 
)
static

Definition at line 980 of file af_surround.c.

Referenced by init().

static void upmix_7_1_5_1 ( AVFilterContext ctx,
float  c_re,
float  c_im,
float  lfe_re,
float  lfe_im,
float  mag_totall,
float  mag_totalr,
float  fl_phase,
float  fr_phase,
float  bl_phase,
float  br_phase,
float  sl_phase,
float  sr_phase,
float  xl,
float  yl,
float  xr,
float  yr,
int  n 
)
static

Definition at line 1040 of file af_surround.c.

Referenced by init().

static void filter_stereo ( AVFilterContext ctx)
static

Definition at line 1096 of file af_surround.c.

Referenced by init().

static void filter_surround ( AVFilterContext ctx)
static

Definition at line 1129 of file af_surround.c.

Referenced by init().

static void filter_2_1 ( AVFilterContext ctx)
static

Definition at line 1165 of file af_surround.c.

Referenced by init().

static void filter_5_0_side ( AVFilterContext ctx)
static

Definition at line 1200 of file af_surround.c.

Referenced by init().

static void filter_5_1_side ( AVFilterContext ctx)
static

Definition at line 1257 of file af_surround.c.

Referenced by init().

static void filter_5_1_back ( AVFilterContext ctx)
static

Definition at line 1316 of file af_surround.c.

Referenced by init().

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 1375 of file af_surround.c.

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

Definition at line 1531 of file af_surround.c.

Referenced by filter_frame().

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

Definition at line 1550 of file af_surround.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink)
static

Definition at line 1580 of file af_surround.c.

Referenced by activate().

static int activate ( AVFilterContext ctx)
static

Definition at line 1610 of file af_surround.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 1667 of file af_surround.c.

AVFILTER_DEFINE_CLASS ( surround  )

Variable Documentation

const AVOption surround_options[]
static

Definition at line 1693 of file af_surround.c.

const AVFilterPad inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_input(AVFilterLink *inlink)
Definition: af_surround.c:197

Definition at line 1770 of file af_surround.c.

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_output(AVFilterLink *outlink)
Definition: af_surround.c:260

Definition at line 1779 of file af_surround.c.

AVFilter ff_af_surround
Initial value:
= {
.name = "surround",
.description = NULL_IF_CONFIG_SMALL("Apply audio surround upmix filter."),
.query_formats = query_formats,
.priv_size = sizeof(AudioSurroundContext),
.priv_class = &surround_class,
.init = init,
}
static int query_formats(AVFilterContext *ctx)
Definition: af_surround.c:159
static av_cold int init(AVFilterContext *ctx)
Definition: af_surround.c:1375
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_surround.c:1667
#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 outputs[]
Definition: af_surround.c:1779
static int activate(AVFilterContext *ctx)
Definition: af_surround.c:1610
#define flags(name, subs,...)
Definition: cbs_av1.c:561
static const AVFilterPad inputs[]
Definition: af_surround.c:1770

Definition at line 1788 of file af_surround.c.