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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
//! SMPTE RDD 29:2019 Dolby Atmos® bitstream — frame/element framing plus
//! bed/object metadata.
//!
//! This crate implements exactly the wire structures described in the
//! curated spec transcription at `rdd29/docs/rdd29.md` (fetched directly
//! from `https://pub.smpte.org/pub/rdd29/rdd29-2019.pdf`) — cite that file,
//! not this doc comment, as the field-semantics oracle.
//!
//! - [`AtmosFrame`] — one complete frame: the top-level `ATMOSFrame` element
//! (§2.1/§4.2), containing zero or more sub-[`AnyElement`]s.
//! - [`BedDefinition1`] — a channel-based audio bed's channel-to-audio-asset
//! mapping (§2.2/§4.3).
//! - [`ObjectDefinition1`] — one panned audio object's per-sub-block pan/
//! rendering metadata: 3D position, snap, zone gain, spread, decorrelation,
//! plus an optional text description (§2.3/§4.4).
//! - [`AudioDataDlc`] — one track's audio essence pointer + opaque payload
//! (§2.4/§4.5).
//!
//! **What this crate is not**: an audio codec. `AudioDataDlc`'s payload is
//! the Dolby Lossless Coding (DLC) codec's own bit-packed bitstream (linear-
//! predictive + Rice-Golomb entropy-coded residual audio samples) — this
//! crate treats it as opaque bytes, the same "parse the container, not the
//! codec" discipline this workspace's `transmux`/`st337` crates use for
//! media containers and AES3 non-PCM bursts respectively. See
//! `docs/rdd29.md`'s "Scope decisions" for the exact boundary and the two
//! honest gaps in the source disclosure document this crate had to resolve
//! (the `Plex(8)` pseudocode's internal inconsistency, and the completely
//! undocumented `AudioDescription` field semantics).
//!
//! Depends only on `broadcast-common`. `#![no_std]` (+ `alloc`) when the
//! `std` feature is disabled.
//!
//! # Examples
//!
//! Build a frame with a bed and an audio-essence element, and round-trip it:
//!
//! ```
//! use broadcast_common::{Parse, Serialize};
//! use rdd29::{
//! AtmosFrame, AudioDataDlc, BedChannel, BedDefinition1, BitDepth, ChannelId, FrameRate,
//! SampleRate,
//! };
//!
//! let bed = BedDefinition1::new(
//! 1,
//! vec![BedChannel {
//! channel_id: ChannelId::LeftScreen,
//! audio_data_id: 10,
//! }],
//! );
//! let dlc = AudioDataDlc::new(10, &[0xDE, 0xAD, 0xBE, 0xEF]).unwrap();
//!
//! let frame = AtmosFrame::new(
//! SampleRate::Hz48000,
//! BitDepth::Bits24,
//! FrameRate::Fps24,
//! 1,
//! vec![
//! rdd29::AnyElement::BedDefinition1(bed),
//! rdd29::AnyElement::AudioDataDlc(dlc),
//! ],
//! );
//!
//! let bytes = frame.to_bytes();
//! assert_eq!(AtmosFrame::parse(&bytes).unwrap(), frame);
//! ```
// Runnable examples, embedded so they render on docs.rs and stay in sync with
// the actual `examples/*.rs` files (shown, not compiled).
extern crate alloc;
pub use ;
pub use AudioDataDlc;
pub use ;
pub use ;
pub use ;
pub use FrameRate;
pub use ;
pub use PLEX_MAX_VALUE;