pub struct ChannelMappingTable {
pub stream_count: u8,
pub coupled_count: u8,
pub mapping: Vec<u8>,
}Expand description
The §5.1.1 channel-mapping table: how the N coded streams (the
first M of which are stereo) combine into the stream’s C output
channels.
For mapping family 0 this is synthesized from the RFC-pinned defaults (the on-wire header omits the table entirely); for families ≥ 1 it is read from the header bytes following the mapping-family octet.
Fields§
§stream_count: u8N — total number of coded Opus streams in each Ogg packet
(§5.1.1 item 1). Always ≥ 1.
coupled_count: u8M — number of those streams decoded as stereo (§5.1.1 item 2).
The first M streams are stereo; the remaining N − M are mono.
mapping: Vec<u8>One index per output channel (§5.1.1 item 3). mapping[c] selects
the decoded channel feeding output channel c:
index < 2*M→ stereo streamindex/2, left channel if even else right.2*M ≤ index < 255→ mono streamindex − M.index == 255→ pure silence.
Implementations§
Source§impl ChannelMappingTable
impl ChannelMappingTable
Sourcepub fn decoded_channels(&self) -> u16
pub fn decoded_channels(&self) -> u16
Total decoded channel count M + N (RFC 7845 §5.1.1 item 2).
This is the number of distinct decoder channels the streams
produce before the Self::mapping selects output channels.
Sourcepub fn output_channels(&self) -> u8
pub fn output_channels(&self) -> u8
The output channel count C — the length of Self::mapping.
Trait Implementations§
Source§impl Clone for ChannelMappingTable
impl Clone for ChannelMappingTable
Source§fn clone(&self) -> ChannelMappingTable
fn clone(&self) -> ChannelMappingTable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChannelMappingTable
impl Debug for ChannelMappingTable
impl Eq for ChannelMappingTable
Source§impl PartialEq for ChannelMappingTable
impl PartialEq for ChannelMappingTable
Source§fn eq(&self, other: &ChannelMappingTable) -> bool
fn eq(&self, other: &ChannelMappingTable) -> bool
self and other values to be equal, and is used by ==.