Metadata that the AC-3 and Enhanced AC-3 syntax has no field for travels in the Extensible Metadata Delivery Format (EMDF), Annex H of ETSI TS 102 366. An EMDF container sits in space the syntax already leaves free: the auxiliary data at the end of a frame, or a block’s skip field. It holds any number of payloads, each with a type number, in any order, and ends with protection data. A reader skips payloads it does not know.
The container
| Bits | Name | Meaning |
|---|---|---|
| 16 | syncword | 0x5838 |
| 16 | emdf_container_length | the container’s length in bytes; unused bits up to it are zero |
| 2 | emdf_version | 0 for this syntax; 3 means variable_bits(2) more follow and are added |
| 3 | key_id | the authentication key used for the protection bits (values implementation-defined); 7 means variable_bits(3) more are added |
| then, for each payload: | ||
| 5 | emdf_payload_id | the payload type; 0 ends the list; 31 means variable_bits(5) more are added |
| varies | emdf_payload_config | below |
| variable_bits(8) | emdf_payload_size | the payload’s length in bytes, not counting its configuration or size |
| size × 8 | emdf_payload_byte | the payload |
| after the last payload (whose id 0 has no configuration or bytes): | ||
| 2 | protection_length_primary | length of the primary protection bits: 0 reserved, 1 = 8 bits, 2 = 32 bits, 3 = 128 bits |
| 2 | protection_length_secondary | length of the secondary protection bits: 0, 8, 32 or 128 bits |
| 8 to 128 | protection_bits_primary | integrity check of the container; how it is computed is implementation-defined |
| 0 to 128 | protection_bits_secondary | an optional further check, likewise |
variable_bits(n) codes an unsigned number of any size in groups of n bits,
each group followed by a read_more bit:
value = 0
do { value += read(n); read_more = read(1);
if (read_more) { value <<= n; value += 1 << n; } } while (read_more)
So one group codes 0 to 2n − 1, two groups 2n upwards, and so on.
Payload configuration
| Bits | Name | Present when | Meaning |
|---|---|---|---|
| 1 | smploffste | always | 1: a sample offset follows (0 if the payload applies from the frame’s first sample) |
| 11 + 1 | smploffst, reserved | smploffste | the first PCM sample, from the start of the frame, the payload applies to (may lie beyond the frame), and a reserved bit |
| 1 | duratione | always | 1: a duration follows (0 if it applies to the end of the frame) |
| variable_bits(11) | duration | duratione | samples the payload applies to, at most two groups |
| 1 | groupide | always | 1: a group ID follows |
| variable_bits(2) | groupid | groupide | payloads with the same value belong together |
| 1 (+8) | codecdatae, reserved | always | codec-specific data; 0 in this syntax, else 8 reserved bits follow |
| 1 | discard_unknown_payload | always | 1: a transcoder that does not know the payload type drops it |
| 1 | payload_frame_aligned | not discard, and no sample offset | 1: the payload must be applied to this frame’s audio |
| 1 + 1 | create_duplicate, remove_duplicate | frame aligned | for transcoding to shorter or longer frames: repeat the payload in every output frame of the same time, or keep it only once |
| 5 | priority | not discard, and a sample offset or frame aligned | 0 is the highest; higher values may be dropped first |
| 2 | proc_allowed | as priority | keep the payload during transcoding: 0 only with no processing or metadata change; 1 with sample rate conversion only; 2 with rate conversion, mixing in momentary sounds, changed informational metadata or channel configuration; 3 always |
Payload types
| ID | Payload |
|---|---|
| 0 | end of the container |
| 1 | programme loudness data |
| 2 | programme information |
| 3 | Enhanced AC-3 substream structure |
| 4 | dynamic range compression for portable devices |
| 5 | programme language |
| 6 | external data |
| 7 | headphone rendering data |
| 8 and up | not defined in TS 102 366 |
Every payload starts with a 2-bit version (3 meaning a 4-bit extended
version follows and is added), except 3, 5, 6 and 7, and every payload ends with zero
fill bits to a byte boundary.
1: programme loudness data
Measured loudness of the programme, and whether it was corrected before encoding, to guide loudness processing after the decoder. Version 1 in this syntax.
| Bits | Name | Present when | Meaning |
|---|---|---|---|
| 1 + 3 | dialchane, dialchan | dialchan if set | which of L (bit 0, most significant), R, C held speech in the last 0.5 s |
| 4 | loudpractyp | always | measurement practice: 0 not indicated, 1 ATSC A/85, 2 EBU R 128, 3 ARIB TR-B32, 4 FreeTV OP-59, 5–13 reserved, 14 manual, 15 consumer leveller |
| 1 + 1 | loudcorrdialgat, loudcorrtyp | loudpractyp not 0 | loudness corrected with dialogue gating; correction type 0 file-based (infinite look-ahead), 1 real-time with compression |
| 1 + 7 | loudrelgate, loudrelgat | value if set | relative-gated integrated loudness (BS.1770): −58 + value / 2 LUFS, up to +5.5 |
| 1 + 7 | loudspchgate, loudspchgat | value if set | speech-gated integrated loudness, same scale |
| 1 + 8 | loudstrm3se, loudstrm3s | value if set | ungated loudness of the last 3 s (BS.1771): −116 + value / 2 LUFS, up to +11.5 |
| 1 + 8 | truepke, truepk | value if set | true peak since the last one: −116 + value / 2 dBTP |
| 1 + 5 | dmixloudoffste, dmixloudoffst | value if set (only with acmod above 2) | measured stereo downmix loudness minus the expected: −7.5 + value / 2 LU; 31 reserved (0 LU) |
| 1 + … | prgmbndye, prgmbndy_bit…, end_or_start, prgmbndyoffste, prgmbndyoffst (11) | if set | frames to a programme boundary: a power of two, 2 to 512, sent as zero bits ended by a 1; then 1 = the next boundary, 0 = the previous; then an optional sample offset within that frame |
| 0 to 7 | fill | loudrelgate | zero bits to a byte boundary |
| 1 + 3 each | hrloudrelgate/hrloudrelgat, hrloudspchgate/hrloudspchgat, hrloudstrm3se/hrloudstrm3s, hrtruepke/hrtruepk | each after its base value | finer resolution: codes 0–7 add −0.4, −0.3, −0.2, −0.1, +0.1, +0.2, +0.3, +0.4 LU (dB for true peak) |
| 3 | loudcorrdialgattyp | loudcorrdialgat | dialogue gating for correction: 0 not indicated, 1 automated centre or left+right, 2 automated left, centre and/or right, 3 manual selection, 4–7 reserved |
| 1 + 11 | extloudrelgate, extloudrelgat | no loudrelgat | extended range: (value − 1024) / 10 LUFS |
| 1 + 11 | extloudspchgate, extloudspchgat | no loudspchgat | extended range speech-gated, same scale |
| 3 | loudspchdialgattyp | speech-gated loudness present | gating used for that measurement, coded as loudcorrdialgattyp |
| 1 + 11 | extloudstrm3se, extloudstrm3s | no loudstrm3s | extended range short-term: (value − 1024) / 10 LUFS |
| 1 + 11 | exttruepke, exttruepk | no truepk | extended range true peak: (value − 1024) / 10 dBTP |
| 1 + 11 | maxloudstrm3se, maxloudstrm3s | value if set | maximum short-term loudness, same scale |
| 1 + 11 | maxtruepke, maxtruepk | value if set | maximum true peak, same scale |
| 1 + 10 + 3 | lrae, lra, lrapractyp | if set | loudness range (EBU Tech 3342): value / 10 LU; method 0 Tech 3342 v1, 1 v2, 2–7 reserved |
| 1 + 11 | loudmntrye, loudmntry | value if set | momentary loudness since the last one: (value − 1024) / 10 LUFS |
| 1 + 11 | maxloudmntrye, maxloudmntry | value if set | maximum momentary loudness, same scale |
When a relative-gated (or, with dialogue gating, speech-gated) value is present, the
stream’s dialnorm must match it.
2: programme information
Processing before encoding, the bands coded with special techniques, and the DRC profiles behind the stream’s compression words. Version 0 in this syntax.
| Bits | Name | Present when | Meaning |
|---|---|---|---|
| 1 + 16 | activechane, activechan | value if set (never in a dependent substream) | which channel locations hold sound, not silence; bits as the custom channel map |
| 1 + 4 | dmixtype, dmixtyp | type if set | the programme was downmixed before encoding (only acmod 2 or 7): see below |
| 1 + 4 | upmixtype, upmixtyp | if not downmixed; type if set | the programme was upmixed before encoding (only acmod 7): see below |
| 1 | preproinfoe | always | pre-processing information follows (only with surrounds or LFE, never in a dependent substream) |
| 1, 1, 1, 2 | suratten, ph90filt, lfefilt, lfemonlevcod | preproinfoe | surrounds attenuated 3 dB; 90° phase shift on Ls and Rs; LFE low-pass filtered; LFE monitoring level: 0 not indicated, 1 +10 dB, 2 0 dB, 3 reserved |
| 1, 3, 3 | drcprofinfoe, dynrngprof, comprprof | profiles if set | the profile used to make dynrng and compr: 0 none, 1 film standard, 2 film light, 3 music standard, 4 music light, 5 speech, 6–7 reserved |
| 1, 3, 3 | specprocinfoe, specprocstartf, specprocendf | if set (never in AC-3) | band coded with spectral processing: start 4.55, 5.67, 6.80, 7.92, 9.05, 10.17, 12.42, 14.67 kHz; end 7.92, 9.05, 10.17, 12.42, 14.67, 16.92, 19.17, 21.42 kHz |
| 1, 5, 5 | chancplinfoe, chancplstartf, chancplendf | if set | band coded with coupling, codes 0–26: 0, 0.29, 0.58, 0.88, 1.17, 1.73, 2.30, 2.86, 3.42, 4.55, 5.67, 6.80, 7.92, 9.05, 10.17, 11.30, 12.42, 13.55, 14.67, 15.80, 16.92, 18.05, 19.17, 20.30, 21.42, 22.55, 23.67 kHz; 27–31 reserved |
| 1 + 2 | enhncrnge, enhncrng | value if set | range a dialogue enhancement control may offer: ±3, ±6, ±9 or ±12 dB |
| acmod | dmixtyp | Downmix applied |
|---|---|---|
| 2 | 1 | Lo/Ro: L + C −3 dB + Ls −3 dB; R + C −3 dB + Rs −3 dB |
| 2 | Lt/Rt: L + C −3 dB − Ls −3 dB − Rs −3 dB; R + C −3 dB + Ls −3 dB + Rs −3 dB | |
| 3 | Lt = L + C −3 dB − Ls −1.2 dB − Rs −6.2 dB; Rt = R + C −3 dB + Ls −6.2 dB + Rs −1.2 dB; 0 and 4–15 reserved | |
| 7 | 0 | surrounds made from 6.1: Ls + Cs −3 dB, Rs + Cs −3 dB |
| 1 | from 7.1: Ls −3 dB + Lrs −3 dB, Rs −3 dB + Rrs −3 dB | |
| 2 | from 7.1: Ls + Lrs −1.2 dB + Rrs −6.2 dB, and the mirror | |
| 3 | heights into the surrounds: Ls − Lvh −1.2 dB − Rvh −6.2 dB, Rs + Rvh −1.2 dB + Lvh −6.2 dB | |
| 4 | height into the front: L + Lvh, R + Lvh; 5–15 reserved |
upmixtyp in an AC-3 frame or an independent substream (acmod 7): 0 Dolby
Pro Logic, 1 Pro Logic II movie mode, 2 Pro Logic II music mode, 3 Dolby Professional
Upmixer, 4–15 reserved. In dependent substream 0: 1 Dolby Pro Logic IIx (only with
Lrs/Rrs in the channel map), 2 Pro Logic IIz height (only with Vhl/Vhr), others
reserved.
The DRC profiles (Table H.3.14). Boundaries are levels relative to the −31 dB reference; “None” is a constant 0 dB:
| Film standard | Film light | Music standard | Music light | Speech | |
|---|---|---|---|---|---|
| Maximum boost gain | 6 dB | 6 dB | 12 dB | 12 dB | 15 dB |
| Maximum boost gain boundary | −12 dB | −24 dB | −22 dB | −34 dB | −19 dB |
| Null band, lower boundary | 0 dB | −10 dB | 0 dB | −10 dB | 0 dB |
| Null band, upper boundary | 5 dB | 10 dB | 5 dB | 10 dB | 5 dB |
| Cut section gain | −5 dB | −5 dB | −5 dB | none | −5 dB |
| Cut section gain boundary | 15 dB | 20 dB | 15 dB | none | 15 dB |
| Maximum cut gain | −24 dB | −24 dB | −24 dB | −15 dB | −24 dB |
| Maximum cut gain boundary | 35 dB | 40 dB | 35 dB | 40 dB | 35 dB |
| Slow attack time constant | 100 ms | 100 ms | 100 ms | 100 ms | 100 ms |
| Slow release time constant | 3,000 ms | 3,000 ms | 10,000 ms | 3,000 ms | 1,000 ms |
| Fast attack time constant | 10 ms | 10 ms | 10 ms | 10 ms | 10 ms |
| Fast release time constant | 1,000 ms | 1,000 ms | 1,000 ms | 1,000 ms | 200 ms |
| Attack threshold | 15 dB | 15 dB | 15 dB | 15 dB | 10 dB |
| Release threshold | 20 dB | 20 dB | 20 dB | 20 dB | 10 dB |
The printed table leaves the music light column of the cut section rows empty, so that profile has no cut section.
3: Enhanced AC-3 substream structure
Only in independent substream 0. num_ind_sub (3 bits) is one less than the
number of independent substreams; then for each, dep_sub_exists (1) and, if
set, num_dep_sub (3), one less than its number of dependent substreams.
Fill bits end it.
4: dynamic range compression for portable devices
Version 0. portdrce (1) and portdrc (8): a gain word for very
narrow dynamic range on portable devices, read like
compr; then
drcprofinfoe (1) and portdrcprof (3), its profile, coded as
dynrngprof.
5: programme language
An IETF BCP 47 language tag, only in independent substreams. frame_sequence
(1): if 1, the tag is spread over several frames, each with sequence_start
(1), sequence_end (1) and a 16-bit langtag_chunk (the tag
starting in its most significant byte, padded with a zero byte to even length); if 0,
langtag_length (6; 0–40 mean 2–42 bytes, 41–63 reserved) and the whole
langtag follow.
6: external data
User data with no payload type of its own. As the language payload:
frame_sequence, then either sequence_start,
sequence_end and a 16-bit external_data_chunk, or
external_data_length (variable_bits(7), in bytes) and the
external_data itself.
7: headphone rendering data
| Bits | Name | Meaning |
|---|---|---|
| 3 | chan_count | full-bandwidth channels to render binaurally, 1 to 7 |
| 6 each | chan_gain | gain before rendering, 0 to −63 dB in 1 dB steps |
| 1 + 6 | lfechangaine, lfechangain | the LFE’s gain, likewise |
| 1, 1 | sequence_start, sequence_end | the binaural room impulse responses are spread over 32 frames |
| 1 | brir_datae | BRIR data follows |
| 96 each | chan_brir_chunk | a part of each channel’s early BRIR (24-bit coefficients × 2 ears × 64 samples in all) |
| 1536 | late_BRIR_chunk | a part of the late BRIR (24-bit × 2 ears × 1,024 samples in all) |
| 8 | parity_check | with sequence_end: XOR of every chunk byte of the sequence, XORed with 0xA9 |
| 1 + 11 each | propdlye, propdly | with sequence_start: each channel’s propagation delay, 0 to 2,047 samples |
| 1 + 4 + 11 each | rt60date, num_bnds, rt60 | with sequence_start: reverberation time in 1 to 11 octave bands (16, 31.5, 63, 125, 250, 500, 1,000, 2,000, 4,000, 8,000, 16,000 Hz), 0 to 2,047 ms |