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