forge
Explore
Log in

Don't you dare go Hollow

ec-truehd sync.rs: drop the doc comments this branch added (no-comments rule). Code unchanged; cargo check -p ec-truehd --all-targets: 2 missing_docs warnings on the new pub fields MajorSyncInfo::num_substreams/len (tests/it/atmos_synth.rs uses len)

Browse files at this commit

edf67834a56c96ce31e8ffd541877acdf26e69e1Ahmet Kaan GümüşParent: ee9d65e
crates/ec-truehd/src/sync.rsmodified+1 -18
@@ -20,17 +20,6 @@
20 //! - `data[4..8]`: `0xF8726FBA` (TrueHD) or `0xF8726FBB` (MLP) names a major20 //! - `data[4..8]`: `0xF8726FBA` (TrueHD) or `0xF8726FBB` (MLP) names a major
21 //! sync at this access unit; absent on most access units, present roughly21 //! sync at this access unit; absent on most access units, present roughly
22 //! once per video frame.22 //! once per video frame.
23-//! - When a major sync is present, it occupies 28 bytes starting at `data[4]`
24-//! (format id + 24 more bytes), plus a TrueHD extension block when
25-//! `data[25] & 1` is set: `2 + 2 * (data[26] >> 4)` bytes, then a 2-byte
26-//! checksum (ffmpeg's `mlp_get_major_sync_size`). `data[8]` packs two 4-bit
27-//! sample-rate codes, `group1` in the high nibble and `group2` (a
28-//! secondary/backward-compat rate, `0xF` when unused) in the low nibble. A
29-//! code maps to a rate via [`sample_rate`]; codes 0-2 are the 48 kHz family
30-//! (`48000 * 2^n`), codes 8-10 the 44.1 kHz family (`44100 * 2^n`). The
31-//! 4-bit `num_substreams` is the top nibble of `data[16]`. The rest of the
32-//! major sync (channel-assignment bitfields, flags) is skipped: [`ChannelLayout`]
33-//! is derived from the substream count instead.
34 //! - The substream directory starts right after the major sync (or right23 //! - The substream directory starts right after the major sync (or right
35 //! after the 4-byte access-unit header, on an access unit with none), one24 //! after the 4-byte access-unit header, on an access unit with none), one
36 //! [`SubstreamInfo`] entry per substream: a 2-byte word whose top 4 bits25 //! [`SubstreamInfo`] entry per substream: a 2-byte word whose top 4 bits
@@ -38,10 +27,7 @@
38 //! word, [`SubstreamInfo::extra`] — follows) and whose low 12 bits are the27 //! word, [`SubstreamInfo::extra`] — follows) and whose low 12 bits are the
39 //! substream's *end pointer*: the cumulative byte offset, in 16-bit words28 //! substream's *end pointer*: the cumulative byte offset, in 16-bit words
40 //! from the end of the whole directory, where this substream's coded data29 //! from the end of the whole directory, where this substream's coded data
41-//! ends. The count is not inferred from the end pointers (an access unit may30+//! ends.
42-//! carry trailing bytes past the last one): it is the major sync's
43-//! `num_substreams`, carried over from the last major sync on access units
44-//! without one, bounded at 4 entries (Dolby's own substream cap).
45 //!31 //!
46 //! Substream count maps to [`ChannelLayout`] by Dolby's own published32 //! Substream count maps to [`ChannelLayout`] by Dolby's own published
47 //! substream convention — substream 0 always carries a 2-ch presentation,33 //! substream convention — substream 0 always carries a 2-ch presentation,
@@ -65,7 +51,6 @@ pub const MAJOR_SYNC_TRUEHD: u32 = 0xF872_6FBA;
65 /// MLP's major sync word (lossless-only, no TrueHD extensions).51 /// MLP's major sync word (lossless-only, no TrueHD extensions).
66 pub const MAJOR_SYNC_MLP: u32 = 0xF872_6FBB;52 pub const MAJOR_SYNC_MLP: u32 = 0xF872_6FBB;
67 53
68-/// Bytes a plain major sync occupies, format id included.
69 const MAJOR_SYNC_LEN: usize = 28;54 const MAJOR_SYNC_LEN: usize = 28;
70 55
71 /// Dolby's cap on substream directory entries per access unit: entries 0..=256 /// Dolby's cap on substream directory entries per access unit: entries 0..=2
@@ -121,9 +106,7 @@ pub struct MajorSyncInfo {
121 /// L/R, 1 = C, 2 = LFE, 3 = Ls/Rs, 6 = Lrs/Rrs; `0x4F` is standard 7.1);106 /// L/R, 1 = C, 2 = LFE, 3 = Ls/Rs, 6 = Lrs/Rrs; `0x4F` is standard 7.1);
122 /// 0 when the major sync is plain MLP, which has no such field.107 /// 0 when the major sync is plain MLP, which has no such field.
123 pub ch8_assignment: u16,108 pub ch8_assignment: u16,
124- /// Substreams in the directory: the top nibble of `data[16]`.
125 pub num_substreams: usize,109 pub num_substreams: usize,
126- /// Bytes the major sync occupies, extension block and checksum included.
127 pub len: usize,110 pub len: usize,
128 }111 }
129 112