29#define MATRIX_STRIDE 64
38 int out,
const char *out_name)
42 printf(
"[%s] = { ", out_name);
43 for (
int i = 0;
i < 64;
i++) {
77 fprintf(stderr,
"swr_build_matrix2 failed with error %d\n", ret);
82 for (
int in = 0; in < in_layout->
nb_channels; in++) {
86 fprintf(stderr,
"unused matrix position %d:%d is non-zero\n",
98 snprintf(out_name,
sizeof(out_name),
"UNSD%d",
i);
110 const char *in, *
out;
114 printf(
"usage: rematrix input_layout output_layout\n");
124 fprintf(stderr,
"Invalid input layout %s\n", in);
132 fprintf(stderr,
"Invalid output layout %s\n",
out);
139 fprintf(stderr,
"channel layout exceeds matrix capacity\n");
#define i(width, name, range_min, range_max)
Public libavutil channel layout APIs header.
__device__ int printf(const char *,...)
@ AV_MATRIX_ENCODING_NONE
int av_channel_layout_from_string(AVChannelLayout *channel_layout, const char *str)
Initialize a channel layout from a given string description.
int av_channel_name(char *buf, size_t buf_size, enum AVChannel channel_id)
Get a human readable string in an abbreviated form describing a given channel.
enum AVChannel av_channel_layout_channel_from_index(const AVChannelLayout *channel_layout, unsigned int idx)
Get the channel with the given index in a channel layout.
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
@ AV_CHAN_UNUSED
Channel is empty can be safely skipped.
@ AV_CHAN_NONE
Invalid channel index.
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.
An AVChannelLayout holds information about the channel layout of audio data.
int nb_channels
Number of channels in this layout.
libswresample public header
static int channel_is_unused(const AVChannelLayout *layout, int index)
static int print_matrix(const AVChannelLayout *in_layout, const AVChannelLayout *out_layout)
static void print_matrix_row(const double *matrix, const AVChannelLayout *in_layout, int out, const char *out_name)