1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//! A pure-Rust implementation of the Opus audio codec ([RFC 6716]).
//!
//! No FFI. `unsafe` is confined to a few documented SIMD kernels, all checked
//! under Miri. The decoder, the range coder and the packet layer build for
//! `no_std` + `alloc` (enable the `libm` feature); the encoder currently
//! requires `std`.
//!
//! | Module | RFC 6716 | Contents |
//! |--------|----------|----------|
//! | [`range`] | §4.1, §5.1 | range decoder + encoder: symbols, binary/ICDF contexts, raw bits, uniform integers, `tell`/`tell_frac` |
//! | [`packet`] | §3 | TOC byte, frame packing codes 0-3, padding, R1-R7 validation |
//! | [`silk`] | §4.2 | SILK decoder and encoder |
//! | [`celt`] | §4.3 | CELT decoder and encoder |
//! | [`ogg`] | RFC 3533 + RFC 7845 | Ogg pages, packet reassembly, `OpusHead`/`OpusTags`, granule/pre-skip timing, stream reader/writer |
//!
//! The decoder passes the official RFC 8251 conformance vectors; the encoder
//! produces standard Opus that libopus and ffmpeg decode.
//!
//! # Bit-exactness
//!
//! Every arithmetic operation in the entropy coder follows the RFC text
//! exactly; the encoder is verified against the decoder symbol-for-symbol
//! (their `rng` states must agree after every operation - see RFC 6716 §5.1).
//! All multi-byte values, state update rules, and rounding behaviours are
//! documented at their definition with the RFC section they implement.
//!
//! [RFC 6716]: https://www.rfc-editor.org/rfc/rfc6716
extern crate alloc;
// Float transcendentals need `std` (inherent `f32`/`f64` methods) or `libm`.
compile_error!;
// On `no_std`, this trait re-supplies the std-only float methods (`x.sin()`,
// ...) via `libm`; on `std` it is not compiled and the inherent methods are used.
// The encoder (and its analysis) is still std-only for now; no_std currently
// targets the decoder. The SIMD kernels are encoder-only too (the decode path
// is SIMD-free), so they stay behind `std`.
pub use ;
pub use ;
pub use MultistreamDecoder;
pub use ;
pub use ;
pub use ;