pub struct Ac3SyncInfo {
pub fscod: u8,
pub bit_rate_code: u8,
pub bsid: u8,
pub bsmod: u8,
pub acmod: u8,
pub lfeon: bool,
}Expand description
Parsed AC-3 sync-header fields needed to populate the MP4 dac3
AudioSpecificConfig box per ETSI TS 102 366 §F.4 (AC3SpecificBox).
All fields come straight off the BSI (Bit Stream Information) header: syncinfo (5 bytes) + bsi { bsid bsmod acmod cmixlev/surmixlev dsurmod lfeon … }.
bit_rate_code and fscod come from the syncinfo block (frmsizecod
upper 5 bits = bit_rate_code; fscod = 2 bits at top of syncinfo
after the 4-byte sync prefix).
Fields§
§fscod: u8fscod (2 bits): sample rate code. 0=48k, 1=44.1k, 2=32k, 3=reserved.
bit_rate_code: u8bit_rate_code (5 bits, ETSI TS 102 366 Table F.6 / Table 4.6): indexes the nominal bit-rate table 0..=18 → 32..=640 kbps.
bsid: u8bsid (5 bits): bit-stream identification. AC-3 = 8; bsid==16 marks E-AC-3 (different parser path).
bsmod: u8bsmod (3 bits): bit-stream mode (CM, music, dialogue, etc.).
acmod: u8acmod (3 bits): audio coding mode / channel layout. See ETSI Table F.4: 0 = 1+1 dual mono, 1 = 1/0 mono, 2 = 2/0 stereo, 3 = 3/0, 4 = 2/1, 5 = 3/1, 6 = 2/2, 7 = 3/2 (5.1 if lfeon=1).
lfeon: boollfeon (1 bit): low-frequency-effects channel present.
Trait Implementations§
Source§impl Clone for Ac3SyncInfo
impl Clone for Ac3SyncInfo
Source§fn clone(&self) -> Ac3SyncInfo
fn clone(&self) -> Ac3SyncInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Ac3SyncInfo
Source§impl Debug for Ac3SyncInfo
impl Debug for Ac3SyncInfo
impl Eq for Ac3SyncInfo
Source§impl PartialEq for Ac3SyncInfo
impl PartialEq for Ac3SyncInfo
Source§fn eq(&self, other: &Ac3SyncInfo) -> bool
fn eq(&self, other: &Ac3SyncInfo) -> bool
self and other values to be equal, and is used by ==.