Each MP2 frame starts with this 32-bit big-endian header. Layer II uses the same header as the other MPEG audio layers; this page gives its fields as they apply to MP2. An MP2 file is defined by ISO/IEC 11172-3 and, for lower sample rates, ISO/IEC 13818-3.
Fields
| Bits | Width | Field | Meaning |
|---|---|---|---|
| 31–21 | 11 | sync | eleven ones |
| 20–19 | 2 | version | 11 MPEG-1, 10 MPEG-2, 00 MPEG-2.5, 01 reserved |
| 18–17 | 2 | layer | 10 for Layer II |
| 16 | 1 | protection | 0 a 16-bit CRC follows the header; 1 none |
| 15–12 | 4 | bitrate | an index into the bit rate table |
| 11–10 | 2 | sample rate | an index into the sample rate table |
| 9 | 1 | padding | 1 adds one byte to the frame |
| 8 | 1 | private | free for applications |
| 7–6 | 2 | mode | 00 stereo, 01 joint stereo (intensity stereo), 10 dual channel, 11 single channel |
| 5–4 | 2 | mode extension | only in joint stereo: the bound |
| 3 | 1 | copyright | 1 means copyrighted |
| 2 | 1 | original | 1 original, 0 copy |
| 1–0 | 2 | emphasis | 00 none, 01 50/15 µs, 10 reserved, 11 CCITT J.17 |
Bit rates
In kilobits a second. Index 0 is free format; index 15 is not allowed.
| Index | MPEG-1 Layer II | MPEG-2 and 2.5 Layer II |
|---|---|---|
| 0 | free | free |
| 1 | 32 | 8 |
| 2 | 48 | 16 |
| 3 | 56 | 24 |
| 4 | 64 | 32 |
| 5 | 80 | 40 |
| 6 | 96 | 48 |
| 7 | 112 | 56 |
| 8 | 128 | 64 |
| 9 | 160 | 80 |
| 10 | 192 | 96 |
| 11 | 224 | 112 |
| 12 | 256 | 128 |
| 13 | 320 | 144 |
| 14 | 384 | 160 |
| 15 | not allowed | not allowed |
In MPEG-1 Layer II, not every rate may be used with every mode. Rates 32, 48, 56 and 80 are for single channel only. Rates 64, 96, 112, 128, 160 and 192 may be used with every mode. Rates 224, 256, 320 and 384 are for stereo, joint stereo and dual channel only.
Sample rates
| Index | MPEG-1 | MPEG-2 | MPEG-2.5 |
|---|---|---|---|
| 0 | 44,100 Hz | 22,050 Hz | 11,025 Hz |
| 1 | 48,000 Hz | 24,000 Hz | 12,000 Hz |
| 2 | 32,000 Hz | 16,000 Hz | 8,000 Hz |
| 3 | reserved | ||
The joint stereo bound
In joint stereo the mode extension gives the subband from which the two channels share their samples, and from which each channel only carries its own scale factors. Above the bound, the shared samples are scaled separately for each channel, which is intensity stereo.
| Mode extension | Bound |
|---|---|
00 | subband 4 |
01 | subband 8 |
10 | subband 12 |
11 | subband 16 |
In other modes the bound is the same as the number of subbands in use (see allocation tables).
Frame length
A frame holds 1,152 samples per channel at every sample rate. Its length in bytes, with the bit rate in bits a second and rounding down, is 144 × bit rate / sample rate + padding. A free-format frame has no length in its header; a reader measures it by finding the next frame.
CRC
A CRC is present when the protection bit is 0, right after the header. It uses
0x8005, starts at 0xFFFF, and covers bytes 2 and 3 of the
header, then the bit allocation and the scalefactor selection information (scfsi).
An example
The header FF FD 90 64:
| Field | Bits | Value |
|---|---|---|
| sync | 11111111 111 | eleven ones |
| version | 11 | MPEG-1 |
| layer | 10 | Layer II |
| protection | 1 | no CRC |
| bitrate | 1001 | 160 kbps |
| sample rate | 00 | 44,100 Hz |
| padding | 0 | not padded |
| private | 0 | |
| mode | 01 | joint stereo |
| mode extension | 10 | bound at subband 12 |
| copyright, original | 0, 1 | not copyrighted, original |
| emphasis | 00 | none |
The frame is 144 × 160,000 / 44,100 = 522 bytes.