Optical disc and disc image notes
These pages explain how CDs and DVDs store data, from the plastic up to the bytes in an image file. They then show how the common image formats (ISO, BIN/CUE, MDS/MDF, IMG/CCD/SUB) record, or fail to record, each part of a disc.
They are written to be read in order. Each page defines its terms the first time it uses them. The glossary collects those definitions in one place.
Reading order #
Part 1: The disc #
- Physical layout: CDs and DVDs. The plastic, the spiral, pits and lands, the regions of the disc by radius, and how recordable and dual-layer discs differ.
- On-disk encoding. How bytes become pits: EFM, frames, sectors, sector modes (audio, Mode 1, Mode 2 / XA Form 1 and 2), scrambling, the lead-in, program area and lead-out, and the DVD equivalents.
- Subchannels. The eight PāW side channels that run alongside every CD sector: the Q channel's position and TOC data, CD-TEXT, CD+G, and the different ways image files lay out the 96 subchannel bytes.
- Logical Block Addressing (LBA). MSF times, LBAs, negative addresses, DVD physical sector numbers, and how to convert between them and file offsets.
- Tracks. Track types, control flags, indexes, pregaps and postgaps, and the rules for moving between audio and data.
- Sessions. Single-session and multisession discs, lead-in and lead-out sizes, the multisession TOC pointers, recording modes (DAO/TAO/SAO), and DVD borders.
- EDC/ECC. The three layers of error handling on a CD (CIRC, then EDC and the Reed-Solomon P/Q parity), DVD's RS product code, and exact algorithms for computing the sector-level codes.
Part 2: Image file formats #
- ISO (
.iso). A plain run of 2048-byte user-data sectors, plus the ISO 9660 and UDF filesystems usually found inside. - BIN/CUE (
.bin+.cue). CDRWIN's text cue sheet and raw sector file(s). - MDS/MDF (
.mds+.mdf). Alcohol 120%'s binary descriptor and its sector data file. - IMG/CCD/SUB (
.img+.ccd+.sub). CloneCD's raw image, text TOC, and separate subchannel file.
Which format keeps what #
A quick comparison. Each format page explains its row in detail.
| Feature | ISO | BIN/CUE | MDS/MDF | IMG/CCD/SUB |
|---|---|---|---|---|
| Multiple tracks | no | yes | yes | yes |
| Audio tracks | no | yes | yes | yes |
| Raw 2352-byte sectors (sync, header, EDC/ECC) | no (usually) | optional (per track) | optional (per track) | always |
| Subchannel data | no | only for CDG tracks |
optional (interleaved, inside the MDF) | yes (separate .sub, linear) |
| Multiple sessions | no | via REM SESSION extension |
yes | yes |
| Full TOC (lead-in Q entries) | no | no (rebuilt by the reader) | yes | yes |
| Pregap (index 0) sectors stored | n/a | depends on PREGAP vs INDEX 00 |
track 1 never; others: see page | track 1 never; others yes |
| CD-TEXT | no | partly (TITLE, PERFORMER, ... or CDTEXTFILE) |
unknown | yes ([CDText]) |
| MCN / ISRC | no | yes (CATALOG, ISRC) |
only inside stored subchannel | yes (CATALOG, ISRC) and in .sub |
| DVD support | yes | no (CD only in practice) | yes (with PFI/DMI and BCA) | no |
| DVD physical structures (PFI, DMI, BCA) | no | no | yes | no |
| Copy-protection measurements (DPM) | no | no | yes | no |
Conventions used throughout #
- Hex numbers are written either
0x930or930h. Both mean 2352. - Byte offsets inside a structure are hex and start at 0, unless stated otherwise.
- MSF is written
mm:ss:ff(minutes, seconds, frames), 75 frames per second. - LBA 0 is the sector at MSF
00:02:00on a CD, and the first sector of the data area on a DVD. See LBA. - "Raw" sector means all 2352 bytes of a CD sector. "Cooked" sector means only the user-data part (usually 2048 bytes).
- Facts taken from reverse-engineered sources, rather than published standards, say so. Where sources disagree, the page shows both views.
Primary references #
These are cited throughout. Each page also lists its own sources.
- ECMA-130, Data interchange on read-only 120 mm optical data disks (CD-ROM). The freely available equivalent of the Yellow Book; it also restates much of the Red Book. https://ecma-international.org/publications-and-standards/standards/ecma-130/
- ECMA-267, 120 mm DVD ā Read-Only Disk. https://ecma-international.org/publications-and-standards/standards/ecma-267/
- ECMA-119, Volume and File Structure of CDROM for Information Interchange (ISO 9660). https://ecma-international.org/publications-and-standards/standards/ecma-119/
- ECMA-168, Volume and File Structure for Read-Only and Write-Once Compact Disk Media (ISO 13490). https://ecma-international.org/publications-and-standards/standards/ecma-168/
- ECMA-167 / OSTA UDF (the UDF filesystem). https://ecma-international.org/publications-and-standards/standards/ecma-167/, http://www.osta.org/specs/
- T10 MMC (SCSI Multi-Media Commands; READ TOC, READ CD, READ DISC STRUCTURE). Drafts: https://www.t10.org/drafts.htm
- libmirage (part of CDEmu), image parsers for MDS, CCD, CUE, ISO and more. Cloned in
lib/cdemu/libmirage/. https://cdemu.sourceforge.io/ - Aaru Data Preservation Suite, readers and writers for Alcohol 120%, CloneCD, CDRWin and more. Cloned in
lib/Aaru/. https://github.com/aaru-dps/Aaru - psx-spx / no$psx documentation by Martin Korth, which includes notes on the disc image formats. https://problemkaputt.de/psxspx-cdrom-disk-images-ccd-img-sub-clonecd.htm