12 #ifndef ROC_AUDIO_CHANNEL_MAPPER_MATRIX_H_
13 #define ROC_AUDIO_CHANNEL_MAPPER_MATRIX_H_
56 return index_matrix_[out_index][in_index];
68 memset(chan_2_index, 0,
sizeof(chan_2_index));
69 memset(index_2_chan, 0,
sizeof(index_2_chan));
79 memset(chan_matrix, 0,
sizeof(chan_matrix));
83 void build_index_mapping_(IndexMap& index_map,
const ChannelSet& ch_set);
85 bool build_channel_mapping_(ChannelMap& result_map,
86 const ChannelSet& in_chans,
87 const ChannelSet& out_chans);
89 bool can_downmix_(
const ChannelSet& in_chans,
const ChannelSet& out_chans);
91 const ChannelMapTable* next_downmix_table_(
const ChannelSet& in_chans,
92 const ChannelSet& out_chans);
93 const ChannelMapTable* next_upmix_table_(
const ChannelSet& in_chans,
94 const ChannelSet& out_chans);
96 void fill_mapping_from_table_(ChannelMap& result_map,
97 const ChannelMapTable& map_table,
99 const ChannelSet& in_chans,
100 const ChannelSet& out_chans);
102 void fill_fallback_mapping_(ChannelMap& result_map,
103 const ChannelSet& in_chans,
104 const ChannelSet& out_chans);
106 void combine_mappings_(ChannelMap& result_map,
const ChannelMap& next_map);
107 void normalize_mapping_(ChannelMap& chan_map);
109 void populate_index_matrix_(
const IndexMap& in_index_map,
110 const IndexMap& out_index_map,
111 const ChannelMap& chan_map);
113 void print_table_matrix_(
const ChannelMap& chan_map);
114 void print_index_matrix_(
const IndexMap& in_index_map,
const IndexMap& out_index_map);
Channel layout, order, and positions.
sample_t coeff(size_t out_index, size_t in_index) const
Returns coefficient for a pair of input and output indices.
void build(const ChannelSet &in_chans, const ChannelSet &out_chans)
Build matrix.
Channel set. Multi-word bitmask with bits corresponding to enabled channels. Meaning of each channel ...
Base class for non-copyable objects.
ChannelPosition
Surround channel position.
@ ChanPos_Max
Maximum value of enum.
float sample_t
Raw audio sample.