From 72cc7d183c02556d0782237cbca0f5c2d29a937c 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 13:35:15 +0300 Subject: [PATCH] U12: ec-dts narrow exports to the used surface; tables_data private; drop unused DMIXTABLE --- crates/ec-dts/src/lib.rs | 14 +++++--------- crates/ec-dts/src/tables_data.rs | 29 +---------------------------- 2 files changed, 6 insertions(+), 37 deletions(-) diff --git a/crates/ec-dts/src/lib.rs b/crates/ec-dts/src/lib.rs index 043e0635..8a94b606 100644 --- a/crates/ec-dts/src/lib.rs +++ b/crates/ec-dts/src/lib.rs @@ -28,10 +28,10 @@ //! [`Error::Corrupt`] and a construct this build does not implement is //! [`Error::Unsupported`] naming what and why. No input panics. //! -//! The constant tables in [`tables_data`] are generated by +//! The constant tables in `tables_data.rs` are generated by //! `tools/gen_dts_tables.py` from the numeric tables printed in ETSI TS 102 114 -//! V1.6.1 and checked against them by `tests/spec_tables.rs`; the few tables -//! the standard does not print usably are in `tables_residual.rs`. +//! V1.6.1; the few tables the standard does not print usably are in +//! `tables_residual.rs`. #![forbid(unsafe_code)] #![warn(missing_docs)] @@ -46,14 +46,10 @@ mod header; mod huff; mod math; #[allow(missing_docs, clippy::excessive_precision)] -pub mod tables_data; +mod tables_data; mod tables_residual; pub use crate::core::Extensions; pub use decoder::{DtsDecoder, FrameInfo, Options}; pub use ec_core::Error; -pub use header::{ - find_sync, frame_size, parse_frame_header, to_canonical, FrameHeader, StreamFormat, - BIT_RATES, CHANNELS, PCM_RESOLUTION, SAMPLE_RATES, SYNC_CORE, SYNC_CORE_14_BE, - SYNC_CORE_14_LE, SYNC_CORE_LE, SYNC_EXSS, -}; +pub use header::{find_sync, frame_size, parse_frame_header, FrameHeader, StreamFormat}; diff --git a/crates/ec-dts/src/tables_data.rs b/crates/ec-dts/src/tables_data.rs index be713780..13560be9 100644 --- a/crates/ec-dts/src/tables_data.rs +++ b/crates/ec-dts/src/tables_data.rs @@ -2,9 +2,7 @@ //! //! GENERATED by tools/gen_dts_tables.py from the numeric tables of //! ETSI TS 102 114 V1.6.1 (2019-08); the clause of each table is named on -//! it. The raw printed numbers are committed in -//! tests/spec_ts102114_tables.txt and tests/spec_tables.rs checks every -//! table here against them. Do not edit by hand. +//! it. Do not edit by hand. //! //! The tables the standard does not print numerically (ADPCM and //! high-frequency VQ codebooks, which it says are too large to include) or @@ -265,31 +263,6 @@ pub static LFE_FIR_128: [f32; 256] = [ 1.724460535e-02, 4.796448052e-01, 4.850307405e-01, 1.805862412e-02, ]; -/// Downmix scale factors, ETSI TS 102 114 D.11 (DmixTable, preceded by a 0 entry). -pub static DMIXTABLE: [u16; 242] = [ - 0, 33, 35, 37, 39, 41, 44, 46, 49, 52, 55, 58, - 62, 65, 69, 73, 78, 82, 87, 92, 98, 104, 110, 116, - 123, 130, 138, 146, 155, 164, 174, 184, 195, 207, 219, 232, - 246, 260, 276, 292, 309, 328, 347, 368, 389, 413, 437, 463, - 490, 519, 550, 583, 617, 654, 693, 734, 777, 823, 872, 924, - 978, 1036, 1066, 1098, 1130, 1163, 1197, 1232, 1268, 1305, 1343, 1382, - 1422, 1464, 1506, 1550, 1596, 1642, 1690, 1740, 1790, 1843, 1896, 1952, - 2009, 2068, 2128, 2190, 2254, 2320, 2388, 2457, 2529, 2603, 2679, 2757, - 2838, 2920, 3006, 3093, 3184, 3277, 3372, 3471, 3572, 3677, 3784, 3894, - 4008, 4125, 4246, 4370, 4497, 4629, 4764, 4903, 5046, 5193, 5345, 5501, - 5662, 5827, 5912, 5997, 6084, 6172, 6262, 6353, 6445, 6538, 6633, 6729, - 6827, 6925, 7026, 7128, 7231, 7336, 7442, 7550, 7659, 7771, 7883, 7997, - 8113, 8231, 8350, 8471, 8594, 8719, 8845, 8973, 9103, 9235, 9369, 9505, - 9643, 9783, 9924, 10068, 10214, 10362, 10512, 10665, 10819, 10976, 11135, 11297, - 11460, 11627, 11795, 11966, 12139, 12315, 12494, 12675, 12859, 13045, 13234, 13426, - 13621, 13818, 14018, 14222, 14428, 14637, 14849, 15064, 15283, 15504, 15729, 15957, - 16188, 16423, 16661, 16902, 17147, 17396, 17648, 17904, 18164, 18427, 18694, 18965, - 19240, 19519, 19802, 20089, 20380, 20675, 20975, 21279, 21587, 21900, 22218, 22540, - 22867, 23170, 23534, 23875, 24221, 24573, 24929, 25290, 25657, 26029, 26406, 26789, - 27177, 27571, 27970, 28376, 28787, 29205, 29628, 30057, 30493, 30935, 31383, 31838, - 32300, 32768, -]; - /// Huffman code (symbol, length) pairs in canonical code order, from ETSI TS 102 114 /// D.5: quantizer index books (10 books x group), bit allocation (5 x 12), /// scale factors (5 x 129), transition mode (4 x 4).