Two lectures of material
Part I -- A Brief Overview
The CD/ROM format offers a magnificent solution to the problem of storage of large digital files. Interactive CD (CD-i) has also made its appearance for more elaborate CD-based presentations. Recent advances in CD-R (CD recordable) have extended the CD/ROM format into the realm of archival data storage.
There are a number of standards in existence governing the CD-audio and CD/ROM data structures. So far, we have only discussed IEC 908 (audio CD or the "red" book). Summarizing the remaining important standards.
Physical format CD-Audio ICE 908 Red book* CD-ROM ISO/IEC 10149 Yellow book* CD-I Green book* Video CD White book* CD-recordable ISO/IEC 11172/1/2/3 Orange book (1990)* Logical format CD-ROM ISO-9660 High Sierra CD-Recordable ECMA 168 / IS 13940 Frankfurt proposal
PART II -- IEC - 10149 ... The BIG Picture
The encoding of CD/ROM information is governed by IEC 10149. This standard is available in the library for your perusal. (This one is in English even!) This information is also covered more generally in Chapter 6 of Ken Pohlman's book The Compact Disk Handbook, (A-R Editions, 1992).
Hard as this may be to believe, the error-detection and correction strategies employed in CD/ROM (IEC 10149) are even more elaborate than those employed in conventional CD-audio! The reasons for this are relatively simple. An error in a CD-audio disk might result in an audible "click". However an error in a CD/ROM disk might mean the failure of operation of a piece of valuable software. Thus, a second layer of error detection and correction encoding is employed.
The following notes review IEC 10149. The majority of information is taken directly from IEC 10149 and is not specifically referenced. However, other information sources and illustrations are referenced.
A. Sectors, frames and modes
The fundamental data structure on the CD/ROM is organized differently than with the CD-audio disk. Recall that the CD-audio disk has a fundamental frame of 588 channel bits (192 data bits) with the frame architecture given below[1].
Notice however, that this fundamental frame only encodes 192 original data bits. Although a very nice format for audio, this is just too restrictive for CD/ROM.
Therefore, in IEC 10149 a superstructure of 98 frames is used in order to provide more user data space. This superstructure provides 6*2*2 = 24 bytes per frame over 98 frames, for a grand total of 6*2*2*98 = 2352 bytes.
This superstructure is called a sector. Thus, a frame is contains 24 data bytes and a sector contains 2352 data bytes. Of these 2352 data bytes, at least 2048 bytes are typically reserved for user data (2048 in Mode 1 and 2336 in Mode 2) -- and the remainder are for various system functions. (Notice that there are 75 sectors per second, giving a final channel data rate of 4.3218 MB/sec.)
Sectors are organized in the following way:
Byte number (starting at 0) Contents 0 0000 0000 1-10 1111 1111 11 0000 0000 12 Minutes - 74 max (+ hex A) 13 Seconds - 59 max 14 Block number within sec. (75 block/sec) 15 Mode 16-2063 User data 2064 - 2351 Error detection and correction data
The first 12 bytes hold synchronizing information.
Bytes 12, 13 and 14 hold addressing data. For example, an address of A4 20 45 says that this is the 4th minute, 20th second, and that this is the 45th block (out of 75) in the second (thus, just slightly more than half-way through the second).
(Note, the minutes field has a hexidecimal A0 added to it -- see page 19 of IEC 10149)
(Note, this information does repeat information that will be stored in the Q-channel of the frames also.)
Byte 15 defines the data mode. Three modes are permitted.
Mode 0 is used for null data (and really isn't very interesting!). Notice that this data will eventually also be CIRC encoded (using the same CIRC encoder as for digital audio). Thus, this data is considered to be protected only by CIRC coding.
MODE 0 --
Byte number Contents 0 0000 0000 1-10 1111 1111 11 0000 0000 12 Minutes - 74 max 13 Seconds - 59 max 14 Block number within sec. (75 block/sec) 15 Mode 00 16-2063 0000 0000 2064 - 2351 0000 0000
Mode 2 is a reduced error checking data storage form. Mode 2 has 2336 available user bytes -- trading off additional parity checks for more user data. Notice that this data will eventually also be CIRC encoded (using the same CIRC encoder as for digital audio). Thus, this data is considered to be protected only by CIRC coding.
MODE 2 --
Byte number Contents 0 0000 0000 1-10 1111 1111 11 0000 0000 12 Minutes - 74 max 13 Seconds - 59 max 14 Block number within sec. (75 block/sec) 15 Mode 02 16-2351 User data
Mode 1 is the full CD/ROM standard, making use of a second level of error detection and correction. Mode 1 has 2048 available user bytes -- and then has 4 bytes of additional EDC, some "0's" (called an "intermediate" in IEC 10149), and then 172 bytes of P parity and 104 bytes of Q parity. Notice that this data will eventually also be CIRC encoded (using the same CIRC encoder as for digital audio). Thus, this data is considered to be protected by EDC coding, ECC coding (P and Q parity) and CIRC coding.
MODE 1 --
Byte number Contents 0 0000 0000 1-10 1111 1111 11 0000 0000 12 Minutes - 74 max 13 Seconds - 59 max 14 Block number within sec. (75 block/sec) 15 Mode 01 16-2063 User data 2064 - 2067 4 bytes of EDC 2068 - 2075 8 bytes of 0000 0000 2076 - 2247 172 bytes of P-parity 2248 - 2351 104 bytes of Q-parity
B. EDC coding
Bytes 2064 to 2067 are used for EDC coding in Mode 1. (They are 00s in Mode 00, and user data in Mode 02.)
EDC coding is a 32-bit (8*4=32) cyclic redundancy code applied to bytes 0-2063. The least significant bit of the data byte is used first and the EDC codeword must be divisible by the check polynomial given by,
The least significant parity bit (x0) is stored in the most significant bit of byte 2067.
C. The P and Q parity fields.
These sector P and Q parity fields add additional parity to the P and Q parity fields in the frame.
As with the P and Q parity bits in the frames, the 172 "P" and 104 "Q" parity bytes are calculated from the following equations:
Hp . Vp = 0
Hq . Vq = 0
Notice however, that the encoding operation is somewhat more complex on the sectors than on the frames -- due primarily to the larger amount of data. The input data is divided into words composed of two 8 bit bytes each. The encoding algorithm is applied twice, first on the most significant bytes and then again on the least significant bytes.
Definitions for H and V are attached (pg 31 and 32 of IEC 10149)
As with CD audio H is defined on the Galois field GF (28) by the polynomial:
(Where the 's in the definitions for the H vector come from the field elements of the Galois field.)
D. Scrambling
Bytes 12-2351 of each sector (that is, all the bytes after those 0000 0000 and 1111 1111 sync bytes) are scrambled. Notice that the addressing bytes are scrambled also -- as well as the mode 1 parity and EDC bytes.
The reason for this is that in certain cases, the merging bits (recall that these are the three bits added between the 14-bit EFM words to avoid adjacent 0s and to minimize the digital sum value) are often not sufficient to minimize the digital sum value.
Quoting from IEC 10149 Annex B "The scrambler reduces this risk by converting the bits in bytes 12 to 2351 of a sector in a prescribed way. Each bit in the input stream of the scrambler is added modulo 2 to the least significant bit of a maximum length register. The least significant bit of each byte comes first in the input stream. The 15-bit register is of the parallel block synchronized type, and is fed back according to the polynomial
After the sync of the sector, the register is preset with the value 0000 0000 0000 0001 where the 1 is the least significant bit."
E. Making the F1 frame
Each scrambled sector is mapped onto a series of consecutive frames. Each frame is the typical audio frame format -- consisting of 24 8-bit bytes. However, the starting point of the sector is not necessarily the starting point of the frame. Byte 0 of the sector is placed in byte 4n of a frame where n = 0, 1, 2, 3, 4 or 5. Consecutive bytes in the sector are then placed in consecutive bytes of the frames.
Next, the byte order of each even-odd numbered pair of bytes in the frame is reversed. That is, the original byte order of 1, 2, 3, 4, 5 ... is converted to 1, 0, 3, 2, 5, 4, .... The frame after interchanging is called an F1 frame.
Notice that the original position 0 of the sector is now in the F1-frame at a position of
4n + 1 where n = 0, 1, 2, 3, 4 or 5.
F. Making the F2 frame
Each F1 frame is then fed into a conventional CIRC. This is exactly the same CIRC encoder we discussed for audio CD (page 50 of IEC 908 and page 36 of IEC 10149).
(Note: For a more complete explanation of the CIRC encoder -- see my course notes 498_95_7.doc entitled Audio Compact Disk - Writing and Reading the data.)
The input to the encoder is 24 8-bit bytes. The output of the encoder is 32 8-bit bytes. (Notice, EFM modulation has not been done yet!)
G. Subcodes on the F3 frame
A single control byte is added to the 32 byte F2 frame. This byte defines the subcodes. These are the same subcodes as used in audio CD. The subcode byte consists of 8 bits -- each bit defining a P, Q, R, S, T, U, V, W subcode channel. The operation of creating the subcode generates a group of 98 F3 frames related by the subcode information. This group of 98 frames is termed a section. Notice that sections have nothing to do with sectors!
Essentially, each bit from the subcode (P, Q, R, S, T, U, V, W) for 98 F3 frames is collected into a buffer and used as a 98-bit word for control information storage. The first two bits of this 98 bit subcode word are reserved for synchronization.
Thus, the control byte for F3 frame 0 is given by: 00100000000001
and the control byte for F3 frame 1 is given by: 00000000010010
The P subcode channel is virtually identical to the P subcode channel in audio CD. The P channel simply designates the starting and stopping of an information track. Data is denoted by all zeros, the start flag before the data by 2-3 seconds of "1's". The lead out at the end of the disk is a 2 Hz alternating 1 and 0.
The Q subcode channel is similar to the Q subcode channel in audio CD. The contents of the channel are as follows:
Byte number 0-1 Synchronization bits 2-5 Control bits 0100 - digital data copy protected 0110 - digital data - OK to copy other settings are only used for audio 6-9 Mode number 10-81 Mode data 82-97 CRC check code
As with audio CD, mode 1 and mode 2 refer to different types of addressing information. Mode 3 is only used by audio CD. In the user data and lead out areas, mode one contains timing information. The layout is identical to Mode 1 in audio and is given below:
Byte number 0-1 Synchronization bits 2-5 Control bits 0100 - digital data copy protected 0110 - digital data - OK to copy other settings are only used for audio 6-9 Mode number - 0001 10-17 TNO - track number 18-25 Index (00 = pause) 26-33 Minutes in sector 34-41 Seconds in sector 42-49 Frame in second (1/75 increments) 50-57 Zeros 58-65 Absolute minutes 56-73 Absolute second 74-81 Frame in second (1/75 increments) 82-97 CRC codeMode 2 contains catalog and additional timing information. The layout is identical to Mode 1 in audio and is given below:
Byte number 0-1 Synchronization bits 2-5 Control bits 0100 - digital data copy protected 0110 - digital data - OK to copy other settings are only used for audio 6-9 Mode number - 0010 10-61 Catalog number of the disk 62-73 12 bits of 0 74-81 Frame in second 82-97 CRC code
The F3 frame is now 33 bytes long and consists of 32 bytes plus the subcode.
H. EFM modulation
All 33 bytes of the F3 frame are now 8-14 bit (EFM) modulated. The resulting 33 14-bit words are separated by 3 merge bits. This operation is identical to that performed in CD audio. Again, the merge bits are determined to avoid adjacent "1s" and minimize the DSV.
(Note: For additional explanation of EFM modulation and merge bits -- see my course notes 498_95_7.doc entitled Audio Compact Disk - Writing and Reading the data.)
I. Sync header on the F3 frame
Each F3 frame finally has a 24-bit synchronization word attached to the very front end -- (just for completeness the word is (100000000001000000000010) and this is spaced from the other symbols by three merge bits.
Part III - Error signals
Although the error detection and correction algorithms used in CD players are very robust, CD manufacturers still must pay special attention to disk quality to assure that disk errors do not exceed the error detection and correction capabilities of the encoding algorithm.
If we look at the frame level for the CIRC decoder -- there are two principle error correcting stages -- the one that sets the P parity and the one that sets the Q parity. These stages are called C1 for the P parity (frame level) and C2 for the Q parity (frame level).
Four flags are output from a typical CD disk measuring system. These are C1F1, C1F2, C2F1 and C2F2. These flags (and the information they provide) is summarized below[2].
C1F1 C1F2 L L No errors in C1 H L 1 error corrected in C1 L H 2 errors corrected in C1 H H More than 2 errors in C1 (passed to C2) C2F1 C2F2 L L No errors in C2 H L 1 error corrected in C2 L H 2 errors corrected in C2 H H More than 2 errors in C2
BLER -- The Block error rate (BLER) is a rather complex measure of the errors in a CD. The block error rate is determined by counting up all the various types of C1 errors (i.e. one bad symbol, two bad symbols, more than two bad symbols) over a given time interval. Thus, the block error rate is in errors per second. Notice it does not differentiate between correctable and uncorrectable errors. It also does not differentiate between 2 errors in the C1 decoder and 588 errors. The typical maximum BLER is 220 errors per second.
Burst error -- The burst error rate measures the number of consecutive bad frames. Typically the threshold for a burst error is held at 7 frames. The burst error is often given over the entire disk rather than as a rate. Generally, disks with any burst errors are not shipped.
Next: Other CD Formats