The bit stream information follows the five bytes of sync information. The fields are packed bit by bit, and later ones appear only when earlier ones call for them.
Fields
| Width in bits | Name | Present when | Meaning |
|---|---|---|---|
| 5 | bsid | always | stream identification |
| 3 | bsmod | always | service type |
| 3 | acmod | always | channel layout |
| 2 | cmixlev | three front channels: acmod is odd and not 1 | centre mix level |
| 2 | surmixlev | a surround channel: acmod is 4 or more | surround mix level |
| 2 | dsurmod | acmod is 2 | Dolby Surround mode |
| 1 | lfeon | always | 1 means the low-frequency effects channel is present |
| 5 | dialnorm | always | dialogue level: 1 to 31 means −1 to −31 dB; 0 is reserved |
| 1 + 8 | compre, compr | compr only if compre is 1 | heavy compression gain word for one frame: a signed value X (bits 7–4) and an unsigned value Y (bits 3–0); the gain is 2X+1 × (16 + Y) / 32 |
| 1 + 8 | langcode, langcod | langcod only if langcode is 1 | a language code |
| 1 + 5 + 2 | audprodie, mixlevel, roomtyp | the last two only if audprodie is 1 | audio production information |
| as above | dialnorm2, compr2e, compr2, langcod2e, langcod2, audprodi2e, mixlevel2, roomtyp2 | only if acmod is 0 (dual mono) | the same fields for the second channel |
| 1 | copyrightb | always | 1 means copyright is claimed |
| 1 | origbs | always | 1 means the stream is an original, 0 a copy |
| 1 + 14 | timecod1e, timecod1 | timecod1 only if timecod1e is 1; replaced when bsid is 6 | timecode, first part |
| 1 + 14 | timecod2e, timecod2 | as above | timecode, second part |
| 1 + 6 | addbsie, addbsil | addbsil only if addbsie is 1 | additional bit stream information follows; its length in bytes is addbsil + 1 |
| (addbsil + 1) × 8 | addbsi | as above | reserved for future use; ignored by decoders that do not know it |
bsid: stream identification
| bsid | Meaning |
|---|---|
| 0 to 7 | early versions; a decoder handles a stream at or below its own version. 6 is the Annex D alternate syntax |
| 8 | standard A/52 stream, the usual value |
| 9 | standard syntax at half the sample rate and bit rate |
| 10 | standard syntax at a quarter of the sample rate and bit rate |
| 11 to 15 | not used by current encoders; A/52 reserves a range for future syntax. Enhanced AC-3 occupies this range |
| 16 | Enhanced AC-3 |
| 17 to 31 | not valid |
The bsid sits in bits 40–44 of the frame in every version, so a parser can
read it before knowing which header layout it has.
bsmod: service type
| bsmod | Service |
|---|---|
| 0 | main audio: complete main |
| 1 | main audio: music and effects |
| 2 | associated: visually impaired |
| 3 | associated: hearing impaired |
| 4 | associated: dialogue |
| 5 | associated: commentary |
| 6 | associated: emergency |
| 7 | associated: voice-over when acmod is 1; main audio: karaoke otherwise |
acmod: channel layouts
| acmod | Name | Channels | Order in the stream |
|---|---|---|---|
| 0 | 1+1 (dual mono) | 2 | channel 1, channel 2 (independent programmes) |
| 1 | 1/0 | 1 | C |
| 2 | 2/0 | 2 | L, R |
| 3 | 3/0 | 3 | L, C, R |
| 4 | 2/1 | 3 | L, R, S |
| 5 | 3/1 | 4 | L, C, R, S |
| 6 | 2/2 | 4 | L, R, SL, SR |
| 7 | 3/2 | 5 | L, C, R, SL, SR |
The low-frequency effects channel, if lfeon is 1, is added to the count and
comes last.
cmixlev: centre mix level
| cmixlev | Level |
|---|---|
| 0 | 0.707 (−3 dB) |
| 1 | 0.595 (−4.5 dB) |
| 2 | 0.500 (−6 dB) |
| 3 | reserved |
surmixlev: surround mix level
| surmixlev | Level |
|---|---|
| 0 | 0.707 (−3 dB) |
| 1 | 0.500 (−6 dB) |
| 2 | 0, the surround channels are left out |
| 3 | reserved |
dsurmod: Dolby Surround mode
| dsurmod | Meaning |
|---|---|
| 0 | not indicated |
| 1 | not Dolby Surround encoded |
| 2 | Dolby Surround encoded |
| 3 | reserved |
Audio production information
mixlevel: the peak mixing level of the original production, as 80 +
mixlevel dB SPL. roomtyp:
| roomtyp | Mixing room |
|---|---|
| 0 | not indicated |
| 1 | large room, X curve monitor |
| 2 | small room, flat monitor |
| 3 | reserved |
Timecodes
| Field | Bits | Meaning |
|---|---|---|
timecod1 | 5 | hours, 0 to 23 |
| 6 | minutes, 0 to 59 | |
| 3 | seconds, in 8-second steps | |
timecod2 | 3 | seconds, added to the above, 0 to 7 |
| 5 | frames, 0 to 29 | |
| 6 | fractions of a frame, in 64ths |
Annex D alternate syntax (bsid 6)
When bsid is 6, the bits where the timecodes would be mean something else:
| Width in bits | Name | Meaning |
|---|---|---|
| 1 | xbsi1e | 1 means the next five fields follow |
| 2 | dmixmod | preferred downmix: 0 not indicated, 1 Lt/Rt, 2 Lo/Ro, 3 reserved |
| 3 | ltrtcmixlev | Lt/Rt centre mix level |
| 3 | ltrtsurmixlev | Lt/Rt surround mix level |
| 3 | lorocmixlev | Lo/Ro centre mix level |
| 3 | lorosurmixlev | Lo/Ro surround mix level |
| 1 | xbsi2e | 1 means the next five fields follow |
| 2 | dsurexmod | Dolby Surround EX: 0 not indicated, 1 not encoded, 2 encoded, 3 reserved |
| 2 | dheadphonmod | Dolby Headphone: 0 not indicated, 1 not encoded, 2 encoded, 3 reserved |
| 1 | adconvtyp | A/D converter type: 0 standard, 1 HDCD |
| 8 | xbsi2 | reserved |
| 1 | encinfo | reserved for encoder use |
The field widths above are confirmed by FFmpeg’s parser. The code values in this section, and the table of mix-level codes below, come from second-hand knowledge of A/52 Annex D, which could not be read, so treat them as unconfirmed.
The mix-level codes of the alternate syntax:
| Code | ltrtcmixlev, lorocmixlev | ltrtsurmixlev, lorosurmixlev |
|---|---|---|
| 0 | 1.414 (+3 dB) | reserved |
| 1 | 1.189 (+1.5 dB) | reserved |
| 2 | 1.000 (0 dB) | reserved |
| 3 | 0.841 (−1.5 dB) | 0.841 (−1.5 dB) |
| 4 | 0.707 (−3 dB) | 0.707 (−3 dB) |
| 5 | 0.595 (−4.5 dB) | 0.595 (−4.5 dB) |
| 6 | 0.500 (−6 dB) | 0.500 (−6 dB) |
| 7 | 0 (off) | 0 (off) |