FFmpeg
Loading...
Searching...
No Matches
rematrix.c File Reference

Go to the source code of this file.

Macros

#define TEMPLATE_REMATRIX_FLT
 
#define TEMPLATE_REMATRIX_DBL
 
#define TEMPLATE_REMATRIX_S16
 
#define TEMPLATE_CLIP
 
#define TEMPLATE_REMATRIX_S32
 
#define FRONT_LEFT   0
 
#define FRONT_RIGHT   1
 
#define FRONT_CENTER   2
 
#define LOW_FREQUENCY   3
 
#define BACK_LEFT   4
 
#define BACK_RIGHT   5
 
#define FRONT_LEFT_OF_CENTER   6
 
#define FRONT_RIGHT_OF_CENTER   7
 
#define BACK_CENTER   8
 
#define SIDE_LEFT   9
 
#define SIDE_RIGHT   10
 
#define TOP_CENTER   11
 
#define TOP_FRONT_LEFT   12
 
#define TOP_FRONT_CENTER   13
 
#define TOP_FRONT_RIGHT   14
 
#define TOP_BACK_LEFT   15
 
#define TOP_BACK_CENTER   16
 
#define TOP_BACK_RIGHT   17
 
#define LOW_FREQUENCY_2   35
 
#define TOP_SIDE_LEFT   36
 
#define TOP_SIDE_RIGHT   37
 
#define BOTTOM_FRONT_CENTER   38
 
#define BOTTOM_FRONT_LEFT   39
 
#define BOTTOM_FRONT_RIGHT   40
 
#define NUM_NAMED_CHANNELS   41
 

Functions

int swr_set_matrix (struct SwrContext *s, const double *matrix, int stride)
 Set a customized remix matrix.
 
static int even (int64_t layout)
 
static int clean_layout (AVChannelLayout *out, const AVChannelLayout *in, void *s)
 
static void clean_downmix (AVChannelLayout *ch_layout, const AVChannelLayout *other)
 Stereo downmix channels are mixed like stereo, unless the other layout has such channels as well.
 
static int sane_layout (const AVChannelLayout *ch_layout, int mixed)
 
static void build_matrix (const AVChannelLayout *in_ch_layout, const AVChannelLayout *out_ch_layout, double center_mix_level, double surround_mix_level, double lfe_mix_level, double maxval, double rematrix_volume, double *matrix_param, ptrdiff_t stride, enum AVMatrixEncoding matrix_encoding)
 
av_cold int swr_build_matrix2 (const AVChannelLayout *in_layout, const AVChannelLayout *out_layout, double center_mix_level, double surround_mix_level, double lfe_mix_level, double maxval, double rematrix_volume, double *matrix_param, ptrdiff_t stride, enum AVMatrixEncoding matrix_encoding, void *log_context)
 Generate a channel mixing matrix.
 
static av_cold int auto_matrix (SwrContext *s)
 
av_cold int swri_rematrix_build (SwrContext *s)
 
av_cold int swri_rematrix_init (SwrContext *s)
 
av_cold void swri_rematrix_free (SwrContext *s)
 
int swri_rematrix (SwrContext *s, AudioData *out, AudioData *in, int len, int mustcopy)
 

Macro Definition Documentation

◆ TEMPLATE_REMATRIX_FLT

#define TEMPLATE_REMATRIX_FLT

Definition at line 26 of file rematrix.c.

◆ TEMPLATE_REMATRIX_DBL

#define TEMPLATE_REMATRIX_DBL

Definition at line 30 of file rematrix.c.

◆ TEMPLATE_REMATRIX_S16

#define TEMPLATE_REMATRIX_S16

Definition at line 34 of file rematrix.c.

◆ TEMPLATE_CLIP

#define TEMPLATE_CLIP

Definition at line 36 of file rematrix.c.

◆ TEMPLATE_REMATRIX_S32

#define TEMPLATE_REMATRIX_S32

Definition at line 41 of file rematrix.c.

◆ FRONT_LEFT

#define FRONT_LEFT   0

Definition at line 45 of file rematrix.c.

Referenced by build_matrix().

◆ FRONT_RIGHT

#define FRONT_RIGHT   1

Definition at line 46 of file rematrix.c.

Referenced by build_matrix().

◆ FRONT_CENTER

#define FRONT_CENTER   2

Definition at line 47 of file rematrix.c.

Referenced by build_matrix().

◆ LOW_FREQUENCY

#define LOW_FREQUENCY   3

Definition at line 48 of file rematrix.c.

Referenced by build_matrix().

◆ BACK_LEFT

#define BACK_LEFT   4

Definition at line 49 of file rematrix.c.

Referenced by build_matrix().

◆ BACK_RIGHT

#define BACK_RIGHT   5

Definition at line 50 of file rematrix.c.

Referenced by build_matrix().

◆ FRONT_LEFT_OF_CENTER

#define FRONT_LEFT_OF_CENTER   6

Definition at line 51 of file rematrix.c.

Referenced by build_matrix().

◆ FRONT_RIGHT_OF_CENTER

#define FRONT_RIGHT_OF_CENTER   7

Definition at line 52 of file rematrix.c.

Referenced by build_matrix().

◆ BACK_CENTER

#define BACK_CENTER   8

Definition at line 53 of file rematrix.c.

Referenced by build_matrix().

◆ SIDE_LEFT

#define SIDE_LEFT   9

Definition at line 54 of file rematrix.c.

Referenced by build_matrix().

◆ SIDE_RIGHT

#define SIDE_RIGHT   10

Definition at line 55 of file rematrix.c.

Referenced by build_matrix().

◆ TOP_CENTER

#define TOP_CENTER   11

Definition at line 56 of file rematrix.c.

◆ TOP_FRONT_LEFT

#define TOP_FRONT_LEFT   12

Definition at line 57 of file rematrix.c.

Referenced by build_matrix().

◆ TOP_FRONT_CENTER

#define TOP_FRONT_CENTER   13

Definition at line 58 of file rematrix.c.

Referenced by build_matrix().

◆ TOP_FRONT_RIGHT

#define TOP_FRONT_RIGHT   14

Definition at line 59 of file rematrix.c.

Referenced by build_matrix().

◆ TOP_BACK_LEFT

#define TOP_BACK_LEFT   15

Definition at line 60 of file rematrix.c.

Referenced by build_matrix().

◆ TOP_BACK_CENTER

#define TOP_BACK_CENTER   16

Definition at line 61 of file rematrix.c.

Referenced by build_matrix().

◆ TOP_BACK_RIGHT

#define TOP_BACK_RIGHT   17

Definition at line 62 of file rematrix.c.

Referenced by build_matrix().

◆ LOW_FREQUENCY_2

#define LOW_FREQUENCY_2   35

Definition at line 63 of file rematrix.c.

Referenced by build_matrix().

◆ TOP_SIDE_LEFT

#define TOP_SIDE_LEFT   36

Definition at line 64 of file rematrix.c.

Referenced by build_matrix().

◆ TOP_SIDE_RIGHT

#define TOP_SIDE_RIGHT   37

Definition at line 65 of file rematrix.c.

Referenced by build_matrix().

◆ BOTTOM_FRONT_CENTER

#define BOTTOM_FRONT_CENTER   38

Definition at line 66 of file rematrix.c.

Referenced by build_matrix().

◆ BOTTOM_FRONT_LEFT

#define BOTTOM_FRONT_LEFT   39

Definition at line 67 of file rematrix.c.

Referenced by build_matrix().

◆ BOTTOM_FRONT_RIGHT

#define BOTTOM_FRONT_RIGHT   40

Definition at line 68 of file rematrix.c.

Referenced by build_matrix().

◆ NUM_NAMED_CHANNELS

#define NUM_NAMED_CHANNELS   41

Definition at line 69 of file rematrix.c.

Referenced by build_matrix().

Function Documentation

◆ even()

static int even ( int64_t layout)
static

◆ clean_layout()

static int clean_layout ( AVChannelLayout * out,
const AVChannelLayout * in,
void * s )
static

Definition at line 99 of file rematrix.c.

Referenced by swr_build_matrix2().

◆ clean_downmix()

static void clean_downmix ( AVChannelLayout * ch_layout,
const AVChannelLayout * other )
static

Stereo downmix channels are mixed like stereo, unless the other layout has such channels as well.

The channels keep their places.

Definition at line 139 of file rematrix.c.

Referenced by swr_build_matrix2().

◆ sane_layout()

static int sane_layout ( const AVChannelLayout * ch_layout,
int mixed )
static

Definition at line 157 of file rematrix.c.

Referenced by swr_build_matrix2().

◆ build_matrix()

static void build_matrix ( const AVChannelLayout * in_ch_layout,
const AVChannelLayout * out_ch_layout,
double center_mix_level,
double surround_mix_level,
double lfe_mix_level,
double maxval,
double rematrix_volume,
double * matrix_param,
ptrdiff_t stride,
enum AVMatrixEncoding matrix_encoding )
static

Definition at line 196 of file rematrix.c.

Referenced by swr_build_matrix2().

◆ auto_matrix()

static av_cold int auto_matrix ( SwrContext * s)
static

Definition at line 693 of file rematrix.c.

Referenced by swri_rematrix_build(), and swri_rematrix_init().

◆ swri_rematrix_build()

av_cold int swri_rematrix_build ( SwrContext * s)

Definition at line 713 of file rematrix.c.

Referenced by swr_init().

◆ swri_rematrix_init()

av_cold int swri_rematrix_init ( SwrContext * s)

Definition at line 753 of file rematrix.c.

Referenced by swr_init().

◆ swri_rematrix_free()

av_cold void swri_rematrix_free ( SwrContext * s)

Definition at line 862 of file rematrix.c.

Referenced by clear_context().

◆ swri_rematrix()

int swri_rematrix ( SwrContext * s,
AudioData * out,
AudioData * in,
int len,
int mustcopy )

Definition at line 867 of file rematrix.c.

Referenced by swr_convert_internal().