MP4
In an ISO base media file an AC-4 track has the sample entry ac-4 (an audio sample entry, with the 16-bit sample size and the base sampling
rate) and, inside it, an AC4SpecificBox of type dac4, and optionally one or more lac4 boxes. Each
sample is one raw AC-4 frame, with no sync word, frame size or CRC. A sample is a sync sample when
b_iframe_global is set in its table of contents. The media timescale and the sample durations follow the frame rate (for 25 frames a second, a timescale of
48,000 and a duration of 1,920 for frame_rate_index 2).
dac4: ac4_dsi
The box holds the ac4_dsi structure, a summary of the stream for systems that cannot read the table of contents: it is used to choose a presentation and to fill a manifest. It is bit packed and read most significant bit first.
| Field | Bits | Meaning |
|---|---|---|
| ac4_dsi_version | 3 | 0: the form of TS 103 190-1. 1: the form of TS 103 190-2. Above 1 a reader stops |
| bitstream_version | 7 | as in the table of contents |
| fs_index | 1 | 0: 44.1 kHz, 1: 48 kHz |
| frame_rate_index | 4 | as in the table of contents |
| n_presentations | 9 | the number of presentations in the box |
| b_program_id, short_program_id, b_uuid, program_uuid | 1, 16, 1, 128 | version 1 and bitstream version above 1: programme identifiers |
| ac4_bitrate_dsi() | 2, 32, 32 | version 1: bit_rate_mode (0 not specified, 1 constant, 2 average, 3 variable), bit_rate in bit/s (0 unknown), bit_rate_precision (0xFFFFFFFF unknown); then byte alignment |
| presentations | – | version 0: n_presentations of ac4_presentation_v0_dsi(). Version 1: for each, presentation_version (8 bits), pres_bytes (8 bits, plus 16 when 255), then that many bytes: an ac4_presentation_v0_dsi() or ac4_presentation_v1_dsi(), with any skip_area after it |
An ac4_presentation_v0_dsi() has b_single_substream, presentation_config and presentation_version (5 bits each, version 0 only), md_compat, the presentation id, the frame rate multiply information, the EMDF version and key, one ac4_substream_dsi() for each substream (channel_mode, sampling rate multiplier, bit rate indicator, add_ch_base, content type and language) and the additional EMDF substreams. An ac4_presentation_v1_dsi() has presentation_config_v1 (31 for a single substream group), md_compat, the presentation id, the frame rate multiply and fraction information, the EMDF version and key, whether the presentation is channel coded and its channel mode with the back and top channel information and an 18-flag channel group mask, the core decoding mode, a presentation filter, one ac4_substream_group_dsi() for each group (whether the substreams are present, the HSF extension flag, channel coded or object coded with the A-JOC counts and the kinds of object, the sampling rate multiplier, the bit rate indicator and the content type), the pre-virtualised flag, the additional EMDF substreams, optional bit rate information, an alternative presentation’s name and targets, and at the end the dialogue enhancement and immersive indicators and an extended presentation id (9 bits).
The codecs string is ac-4. and the bitstream version, presentation version and md_compat as two-digit numbers, for example
ac-4.02.01.03.
lac4
The lac4 box is a full box with a count (16 bits), a language tag (a null-terminated UTF-8 string) and, for each label, a presentation
id (16 bits) and a null-terminated label text, so that a player can show presentation names in a user interface.
Matroska
A track with the codec identifier A_AC4 holds one raw AC-4 frame in each block. Its CodecPrivate is the ac4_dsi above. The explorer
summarises the track and its CodecPrivate.
WAVE
The WAVE format tag 0xAC40 is registered for Dolby AC-4. The explorer names the tag; it does not read the frames in the data chunk.
The media type
audio/ac4 names a stream of sync frames, the content of a .ac4 file. A parameter can say which versions it holds, for example
audio/ac4; version=00.00.03 for bitstream version 0, presentation version 0 and md_compat 3.