A sync frame holds six audio blocks, each coding 256 samples of every channel. The fields below are packed bit by bit, and “ch” means one entry per full-bandwidth channel, in the order given by the channel layout. Later blocks of a frame may reuse settings the first block sent, so block 0 must carry them.
Fields in order
| Width in bits | Name | Present when | Meaning |
|---|---|---|---|
| 1 per ch | blksw | always | 1 switches this channel to two short transforms of 128 samples each |
| 1 per ch | dithflag | always | 1 fills zero-bit mantissas with dither |
| 1 + 8 | dynrnge, dynrng | dynrng only if dynrnge is 1 | dynamic range gain for the block: signed X (bits 7–5) and unsigned Y (bits 4–0); the gain is 2X+1 × (32 + Y) / 64 |
| 1 + 8 | dynrng2e, dynrng2 | acmod is 0 | the same for the second channel |
| 1 | cplstre | always | 1 means the coupling strategy follows |
| 1 | cplinu | cplstre is 1 | 1 means coupling is in use |
| 1 per ch | chincpl | cplinu is 1 | 1 means this channel is coupled |
| 1 | phsflginu | cplinu is 1 and acmod is 2 | phase flags in use |
| 4 | cplbegf | cplinu is 1 | coupling start band; transform coefficient offset 37 + 12 × cplbegf |
| 4 | cplendf | cplinu is 1 | coupling end band: 3 + cplendf, offset 37 + 12 × (3 + cplendf) |
| 1 each | cplbndstrc | cplinu is 1 | for each sub-band after the first: 1 joins it to the band before |
| 1 per ch | cplcoe | coupled channels | 1 means new coupling coordinates follow for the channel |
| 2 | mstrcplco | cplcoe is 1 | master coupling coordinate |
| 4 + 4 each | cplcoexp, cplcomant | cplcoe is 1 | per band: exponent and mantissa of the coupling coordinate |
| 1 each | phsflg | acmod is 2, phsflginu is 1 and either channel has new coordinates | per band: 1 inverts the phase |
| 1 | rematstr | acmod is 2 | 1 means new rematrixing flags follow |
| 1 each | rematflg | rematstr is 1 | per rematrixing band; there are 4 bands, or 3 if coupling starts at band 1 or 2, or 2 if it starts at band 0 |
| 2 | cplexpstr | cplinu is 1 | coupling exponent strategy |
| 2 per ch | chexpstr | always | exponent strategy per channel, see below |
| 1 | lfeexpstr | lfeon is 1 | LFE exponent strategy: 0 reuse, 1 new |
| 6 per ch | chbwcod | new exponents and not coupled | bandwidth: the channel ends at coefficient 73 + 3 × chbwcod |
| 4 + groups | cplabsexp, cplexps | coupling exponents are new | absolute start value and 7-bit groups of deltas |
| 4 + groups + 2 | exps, gainrng | per channel with new exponents | 4-bit first exponent, 7-bit groups of deltas, then 2-bit gain-range code |
| 4 + 2 × 7 | lfeexps | LFE exponents are new | the first exponent, then two 7-bit groups |
| 1 | baie | always | 1 means the bit allocation parameters follow |
| 2, 2, 2, 2, 3 | sdcycod, fdcycod, sgaincod, dbpbcod, floorcod | baie is 1 | see below |
| 1 | snroffste | always | 1 means SNR offsets follow |
| 6 | csnroffst | snroffste is 1 | coarse SNR offset |
| 4 + 3 | cplfsnroffst, cplfgaincod | snroffste and coupling in use | coupling fine offset and fast gain |
| 4 + 3 per ch | fsnroffst, fgaincod | snroffste is 1 | fine offset and fast gain per channel |
| 4 + 3 | lfefsnroffst, lfefgaincod | snroffste is 1 and lfeon is 1 | the same for the LFE |
| 1 | cplleake | cplinu is 1 | coupling leak fields follow |
| 3 + 3 | cplfleak, cplsleak | cplleake is 1 | fast and slow leak initialisation |
| 1 | deltbaie | always | 1 means delta bit allocation follows |
| 2 + 2 per ch | cpldeltbae, deltbae | deltbaie is 1 | delta strategy; cpldeltbae if coupling is in use |
| 3, then 5 + 4 + 3 each | deltnseg, then deltoffst, deltlen, deltba | strategy is 1 | segment count minus one, then each segment’s offset, length and adjustment. Same for coupling (cpldeltnseg and so on) |
| 1 + 9 | skiple, skipl | skipl if skiple is 1 | skip length in bytes |
| skipl × 8 | skipfld | as above | ignored bytes |
| varies | mantissas | always | the quantised coefficients: below. Channels in order, then the LFE; the coupling channel’s mantissas come after the first coupled channel’s |
Exponent strategies
Exponents give each coefficient’s scale. D15, D25 and
D45 group the coefficients so one delta value serves 1, 2 or 4 of them, and
each 7-bit group holds three deltas. Deltas are 0 to 4, mapped to −2 to +2.
| Value | Name | Meaning | Groups |
|---|---|---|---|
| 0 | reuse | reuse the last block’s exponents (block 0 may not use this) | none |
| 1 | D15 | new; three deltas in 7 bits, one delta per coefficient | (end − 1) / 3 |
| 2 | D25 | new; one delta every 2 coefficients | (end − 1 + 3) / 6 |
| 3 | D45 | new; one delta every 4 coefficients | (end − 1 + 9) / 12 |
Group counts round down; “end” is the channel’s last coefficient. The coupling channel uses (coupling end − coupling start) divided by 3, 6 or 12 instead, and the LFE always two groups of 7 bits.
Bit allocation parameters
| Code | sdcycod: slow decay | fdcycod: fast decay | sgaincod: slow gain | dbpbcod: dB per bit |
|---|---|---|---|---|
| 0 | 0x0F | 0x3F | 0x540 | 0x000 |
| 1 | 0x11 | 0x53 | 0x4D8 | 0x700 |
| 2 | 0x13 | 0x67 | 0x478 | 0x900 |
| 3 | 0x15 | 0x7B | 0x410 | 0xB00 |
| Code | floorcod: masking floor | fgaincod: fast gain |
|---|---|---|
| 0 | 0x2F0 | 0x080 |
| 1 | 0x2B0 | 0x100 |
| 2 | 0x270 | 0x180 |
| 3 | 0x230 | 0x200 |
| 4 | 0x1F0 | 0x280 |
| 5 | 0x170 | 0x300 |
| 6 | 0x0F0 | 0x380 |
| 7 | 0xF800 (negative) | 0x400 |
The decoder feeds these into the same bit allocation routine the encoder ran, and from
the exponents gets a bit allocation pointer (bap, 0 to 15) for each
coefficient. The bit allocation tables (critical band offsets, the masking curve and
the conversion from level to bap) are given in full in A/52 and not
reproduced here.
Delta bit allocation strategy
| Value | Meaning |
|---|---|
| 0 | reuse the previous delta information |
| 1 | new delta information follows |
| 2 | no delta; use the default allocation |
| 3 | reserved |
Mantissas and quantisers
Each coefficient’s bap gives its quantiser. Some small quantisers code
several mantissas together. Mantissas are unpacked in the same channel order as the
fields above; coupled channels get theirs from the coupling channel.
| bap | Levels | Bits |
|---|---|---|
| 0 | none | 0; the coefficient is zero or dither |
| 1 | 3 | 5 for three mantissas |
| 2 | 5 | 7 for three mantissas |
| 3 | 7 | 3 |
| 4 | 11 | 7 for two mantissas |
| 5 | 15 | 4 |
| 6 to 13 | asymmetric | 5 to 12 (bap − 1) |
| 14 | asymmetric | 14 |
| 15 | asymmetric | 16 |
A coefficient is a mantissa times 2−exponent, multiplied again by the coupling coordinate for a coupled channel.
Frequency layout
| Channel | Coefficients |
|---|---|
| Full-bandwidth, not coupled | 0 to 73 + 3 × chbwcod − 1 |
| Full-bandwidth, coupled | 0 up to the coupling start |
| Coupling channel | 37 + 12 × cplbegf up to 37 + 12 × (3 + cplendf) |
| LFE | 0 to 6 |