edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiBe12d32fTahinli6 days ago3982 commits
| 1 | //! DTS Coherent Acoustics decoding, from ETSI TS 102 114. |
| 2 | //! |
| 3 | //! - [`DtsDecoder`] takes core frames (with or without a DTS-HD extension |
| 4 | //! substream behind them) and hands back interleaved `f32` audio frames in |
| 5 | //! the coded channel layout. |
| 6 | //! - [`parse_frame_header`] and [`frame_size`] read the core header alone, |
| 7 | //! which is what a container or a raw `.dts` sniffer needs to state a |
| 8 | //! track's sample rate, channel count and frame length before decoding. |
| 9 | //! - [`exss::parse_exss`] reads a DTS-HD extension substream header. |
| 10 | //! |
| 11 | //! Contracts worth knowing before implementing against this crate: |
| 12 | //! |
| 13 | //! - **Every stream word order is accepted**: 16-bit big endian (canonical), |
| 14 | //! 16-bit little endian, and 14-bit-in-16 in either byte order. They are |
| 15 | //! converted to the canonical bit string before anything is parsed. |
| 16 | //! - **Decoding is integer and exact.** The subband samples, the quantizers |
| 17 | //! and the synthesis bank are fixed point with 24-bit saturation, so the |
| 18 | //! same stream gives the same 24-bit samples everywhere. Output is `f32` |
| 19 | //! with 24-bit samples scaled by 2^-23, which `f32` holds without loss. |
| 20 | //! - **DTS-HD**: the output is always the backward compatible core. XLL |
| 21 | //! (lossless) is not decoded; it is named in [`FrameInfo::xll`] and |
| 22 | //! [`Options::refuse_xll`] turns it into an explicit [`Error::Unsupported`]. |
| 23 | //! XBR, XXCH and LBR layers are ignored by name in |
| 24 | //! [`FrameInfo::hd_extensions_ignored`]. |
| 25 | //! - **Downmix flags, dialogue normalisation and dynamic range data are |
| 26 | //! surfaced where they are in the header and never applied.** |
| 27 | //! - **Truncated input is [`Error::NeedMore`]**, a broken bit stream is |
| 28 | //! [`Error::Corrupt`] and a construct this build does not implement is |
| 29 | //! [`Error::Unsupported`] naming what and why. No input panics. |
| 30 | //! |
| 31 | //! The constant tables in [`tables_data`] are generated by |
| 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 |
| 34 | //! the standard does not print usably are in `tables_residual.rs`. |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | pub use crateExtensions; |
| 53 | pub use ; |
| 54 | pub use Error; |
| 55 | pub use |
| 56 | |
| 57 | |
| 58 | |
| 59 | ; |