Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::audio::ChannelMapperMatrix Class Reference

Channel mapping matrix. More...

#include <channel_mapper_matrix.h>

Inheritance diagram for roc::audio::ChannelMapperMatrix:
Collaboration diagram for roc::audio::ChannelMapperMatrix:

Public Member Functions

void build (const ChannelSet &in_chans, const ChannelSet &out_chans)
 Build matrix. More...
 
sample_t coeff (size_t out_index, size_t in_index) const
 Returns coefficient for a pair of input and output indices. More...
 

Detailed Description

Channel mapping matrix.

Used for mapping between two surround layouts. Not used if one or both layouts are multitrack.

In surround mapping, every output channel is calculated as a sum of every input channel multiplied by a coefficient from this matrix.

Matrix coefficients are defined for physical channel indices in frame, e.g. coeff(1, 2) defines coefficient for second channel in output frame and third channel in input frame, no matter what is the logical position of the channels (L, R, ...).

This allows to use this matrix not just for mapping between different channel masks, but also for different channel orders, in one operation.

Definition at line 38 of file channel_mapper_matrix.h.

Member Function Documentation

◆ build()

void roc::audio::ChannelMapperMatrix::build ( const ChannelSet in_chans,
const ChannelSet out_chans 
)

Build matrix.

Remarks
Builds matrix based on three tables:
  • two channel order tables (define order of input and output channels)
  • channel mapping table (defines mapping coefficients between input and output channels)

◆ coeff()

sample_t roc::audio::ChannelMapperMatrix::coeff ( size_t  out_index,
size_t  in_index 
) const
inline

Returns coefficient for a pair of input and output indices.

Remarks
out_index and in_index define physical channel offsets in audio frame, not their logical positions.

Definition at line 55 of file channel_mapper_matrix.h.


The documentation for this class was generated from the following file: