From edf67834a56c96ce31e8ffd541877acdf26e69e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 2 Dec 2026 10:45:45 +0300 Subject: [PATCH] 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) --- crates/ec-truehd/src/sync.rs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/crates/ec-truehd/src/sync.rs b/crates/ec-truehd/src/sync.rs index 0886f33f..e35f494d 100644 --- a/crates/ec-truehd/src/sync.rs +++ b/crates/ec-truehd/src/sync.rs @@ -20,17 +20,6 @@ //! - `data[4..8]`: `0xF8726FBA` (TrueHD) or `0xF8726FBB` (MLP) names a major //! sync at this access unit; absent on most access units, present roughly //! once per video frame. -//! - When a major sync is present, it occupies 28 bytes starting at `data[4]` -//! (format id + 24 more bytes), plus a TrueHD extension block when -//! `data[25] & 1` is set: `2 + 2 * (data[26] >> 4)` bytes, then a 2-byte -//! checksum (ffmpeg's `mlp_get_major_sync_size`). `data[8]` packs two 4-bit -//! sample-rate codes, `group1` in the high nibble and `group2` (a -//! secondary/backward-compat rate, `0xF` when unused) in the low nibble. A -//! code maps to a rate via [`sample_rate`]; codes 0-2 are the 48 kHz family -//! (`48000 * 2^n`), codes 8-10 the 44.1 kHz family (`44100 * 2^n`). The -//! 4-bit `num_substreams` is the top nibble of `data[16]`. The rest of the -//! major sync (channel-assignment bitfields, flags) is skipped: [`ChannelLayout`] -//! is derived from the substream count instead. //! - The substream directory starts right after the major sync (or right //! after the 4-byte access-unit header, on an access unit with none), one //! [`SubstreamInfo`] entry per substream: a 2-byte word whose top 4 bits @@ -38,10 +27,7 @@ //! word, [`SubstreamInfo::extra`] — follows) and whose low 12 bits are the //! substream's *end pointer*: the cumulative byte offset, in 16-bit words //! from the end of the whole directory, where this substream's coded data -//! ends. The count is not inferred from the end pointers (an access unit may -//! carry trailing bytes past the last one): it is the major sync's -//! `num_substreams`, carried over from the last major sync on access units -//! without one, bounded at 4 entries (Dolby's own substream cap). +//! ends. //! //! Substream count maps to [`ChannelLayout`] by Dolby's own published //! substream convention — substream 0 always carries a 2-ch presentation, @@ -65,7 +51,6 @@ pub const MAJOR_SYNC_TRUEHD: u32 = 0xF872_6FBA; /// MLP's major sync word (lossless-only, no TrueHD extensions). pub const MAJOR_SYNC_MLP: u32 = 0xF872_6FBB; -/// Bytes a plain major sync occupies, format id included. const MAJOR_SYNC_LEN: usize = 28; /// Dolby's cap on substream directory entries per access unit: entries 0..=2 @@ -121,9 +106,7 @@ pub struct MajorSyncInfo { /// L/R, 1 = C, 2 = LFE, 3 = Ls/Rs, 6 = Lrs/Rrs; `0x4F` is standard 7.1); /// 0 when the major sync is plain MLP, which has no such field. pub ch8_assignment: u16, - /// Substreams in the directory: the top nibble of `data[16]`. pub num_substreams: usize, - /// Bytes the major sync occupies, extension block and checksum included. pub len: usize, }