Chapter II  CD-I Disc Format


II.1  General


1.1  Scope


This chapter gives a specification of the physical format of a CD-I  disc. 
Those parts not  specified in  this chapter are  specified in  the   CD-DA 
specification  ('Red   Book')  or   in  other   chapters  of   the    CD-I 
specification.  The CD-I physical format specification is defined in  such 
a fashion that it conforms with the CD-DA specifications.

1.2  Conventions


This section defines the  conventions for the data  symbols used in   this 
chapter. A data symbol  is an entity made  up of n  bits representing    a 
value between  0  and 2n-1.  The  meaning of  indices  (i,j,k...)  is   to 
indicate the sequential order that the data symbols have to be   processed 
in.

Examples of data symbols are:

            bi - means a binary digit with index i and a value of 0   or  
            1.
            Bi - means an 8-bit data byte with index i and values of   0  
            to 255.
            Wi - means a 16-bit data word with index i and values of   0  
            to 65535.

Bits in a symbol  are numbered from 0  upwards. Bit nr.  0 is the   least  
significant bit. The value of a symbol is equal to

           m - 1
           _(bi * 2i) ; m = nr. of bits in the symbol.
           i = 0

To specify the relation of symbols an equation style of notation is   used 
here. The values of the left side and the right side have to be equal.




II.2  CD-I Disc Specification


2.1  Track Organization


The recorded area of the disc is divided  into three parts: the    lead-in 
area, the program area and the lead-out area.

The program area is divided into a maximum of 99 information tracks,  each 
having a minimum  length of  4 seconds, not  including the  pause   length 
preceding the track.  Each information track can be  a data track or    an 
audio track.

A data track is a track with information  encoded as 8-bit wide    symbols 
(bytes) organized in sectors of 2352 bytes.

An audio track is a CD-DA track with  information encoded as 16-bit   wide 
2's-Complement numbers.   The audio  tracks are  specified in  the   CD-DA 
specification.

The first track in the program area must be a CD-I track (see II.4).   All 
other tracks may be  used for either CD-I  tracks or CD-DA  tracks.    The 
total number of tracks on a CD-I disc cannot be less than 1 or more   than 
99.

In some CD-I applications, it may be necessary to use more than one   CD-I 
track.  This  may be  done providing  that all  of  the CD-I  tracks   are 
grouped together at the beginning of the program area. This is mandatory.

If a CD-I track is preceded by another  CD-I track the sector    structure 
and addressing in the sector header is not interrupted between these   two 
tracks.

A CD-I track is not allowed to follow a CD-DA track.

The starting point of a CD-DA track is given, in the lead-in area, by  the 
'Table of Contents', or TOC in the subcode channel Q (see II.2.5).

It is recommended that all CD-I information be placed in one track.   This 
track must be the first track of a CD-I disc.






2.2  Lead-in Area



It is recommended that the lead-in area be encoded as a data track   (with 
track number 00)  containing Mode  2, Form 1  or Form  2 sectors.    2.3   
Program Area


2.3.1 First CD-I track


The first CD-I track (track number 01) on a CD-I disc starts at time   0", 
0', 0 ATIME.


2.3.2  Track Layout in the Program Area

2.3.2.1  Example of only CD-I Tracks


 Lead-in _ Program Area       _ Lead-out
 ________________________________________
               _ M_ DL_ M_ CD-I data_     E
       ________________________________________
            [0", 0', 0]


      Where  DL             =    Disc  Label (from [0",2',16] to   [0", 
                        2' + Sd1, 15 + fd1])
               M =Message sectors
       E   =   Empty sectors
         Sdl, fdl = Size disc label in seconds, frames.

      In this example  the program  area contains only  one CD-I    track 
      covering the  whole  Program Area.   The  track starts  with    166 
      message sectors followed by (75 * Sd1 + fd1) sectors for the   Disc 
      Label.  After  the disc  label comes  a minimum  of  2250   message 
      sectors followed by the rest of the CD-I track which contains  CD-I 
      data (audio, video, program related data and empty sectors).
2.3.2.2  Example of CD-I and CD-DA Tracks


        Lead-in_                                         _Lead out
        __________________________________________________________
              _M_DL_M_CD-I data_CD-I data_M_CD-DA_CD-DA _Audio
                _ _  _ _         _         _ _     _      _ silence
        __________________________________________________________
              _    Track 1     _ Track 2   _Track_ Track_
              _                _           _  3  _   4  _


      In this example the program area contains two CD-I tracks and   two 
      CD-DA tracks. The first track is as in II 2.3.2.1.
      The second and last CD-I track ends with a minimum of 2250  message 
      sectors before the start of the first CD-DA track.


2.4  Lead-out Area


If the last track in the program area of the disc is an audio track,  then 
the lead-out area has to be encoded as an audio track.

If the last track in the program area  of the disc is a CD-I track,   then 
the lead-out area has to be encoded as a Mode 2 Form 2 (see II.4.8)   data 
track containing empty sectors (see II.4.9.1).


If the  lead-out area  is encoded  as a  data  track, the  data in    this 
lead-out track is sector-structured  according to the rules  for a    data 
track in Mode 2 Form 2 (see II.4.8).2.5  Subcode P and Q channels


The subcode channels have, in general, the same technical   specifications 
on a CD-I disc as is given in the CD-DA specification with the   following 
exceptions:

(1)   The first CD-I track on the disc is track number one.

(2)         PMIN of POINT  $AO has to be  set to a  value, which is   one 
      higher than the number  of CD-I tracks on  the disc (2-digit   BCD) 
      and which should be less than or equal to 99.  CD-I tracks are  not 
      indicated in the TOC.

(3)   PSEC of POINT $AO has to be set to 10 (2 digit BCD coded).
      The PSEC of POINT $AO is used for  the identification of the   type 
      of disc.

      PSEC of POINT $AO = %00000000 :means a CD-DA or CD-ROM   disc
       %00010000 : means a CD-I disc

                             All other numbers are reserved.

      PFRAME of POINT $A0 = %00000000

(4)    In the lead-in track, channel P =  0. The first CD-I track   begins 
with a start flag of 2 seconds. See  the 'Lead-in Track' section of    the 
CD-DA specification (p.40).

(5)         The value of PMIN, PSEC and PFRAME  gives the starting  point 
      of the audio track number pointed to by POINT.  These values   give 
      the start position of the track in an  absolute time scale   (AMIN, 
      ASEC and AFRAME) with  an accuracy of +/-  one second.  The   start 
      position of an  audio track  is the first  position with  the   new 
      track number and X does not equal 00.  See the 'POINT' section   of 
      the CD-DA specification (p.43).

(6)         The control field of a lead-in Q channel frame is  identified 
      as the CONTROL field used in the track  that POINT refers to.   See 
      pp.41 and 43 of the CD-DA speci-fication.

(7)         PMIN of  POINT $A1  has the value  of the  last audio   track 
      number on the disc  if the CD-I disc  has CD-DA tracks,   otherwise 
      PMIN of POINT $A1 has a value which is one higher than the   number 
      of CD-I tracks on the disc.

      PSEC and PFRAME of POINT $A1 are zero.   The control field of   the 
      PFRAME with POINT = $A1 contains "00X0" if the CD-I disc has  CD-DA 
      tracks, otherwise the  control field  contains "01X0" (X  = 0   for 
      copy prohibited.  X = 1 for copy permitted).

(8)         POINT = $A2,  indicates the starting point  of the   lead-out 
      track in PMIN, PSEC and PFRAME. In the CONTROL
      field it is  indicated whether the lead-out area  is treated as   a 
      data track or as an audio track.

      Figures II.1 to II.4 give examples of the  encoding of the TOC   as 
      well as for the general structure of CD-I discs.

Figure II.1


                         Information Area
     Inner________________________________________________Outer
      side_      _                                _      _side
    of the_      _                                _      _of the
      disc_ Lead-_         Program Area           _ Lead-_disc
  __      _  in  __________________________________ out  _
  _  Track_ Area _                                _ Area _
  _no. TNO___00________01_______02_____03_____04____$AA___
  _       _      _           _      _      _      _      _
  _Index  _      __00____01_____01_____01_____01_____01___
Q _       _      _     _     _      _      _      _      _
  _       _      _     _     _      _      _      _      _
C _       _      _ 2   _     _      _      _      _      _
H _       _      _sec  _     _      _      _      _      _
A _Time   _      _     _     _      _      _      _      _
N _       ________________________________________________
N _Audio/ __Data______Data_____Data___Data___Data___Data__
E _Data   _      _           _      _      _      _      _
L _       _      _           _      _      _      _*     _
  _       _      _           _      _      _      _      _
  _ATime  _  --  _           _      _      _      _      _
  __      ________________________________________________
     Mode ___02_______ 02 ______02_____02_____02_____02___
     Byte _      _           _      _      _      _      _
          _      _           _      _      _      _      _
          _      _           _      _      _      _      _
          _      _           _      _      _      _      _
          _      _           _      _      _      _      _
  $AO Min ________________________________________________
          _      _           _      _      _      _      _
          _      _           _      _      _      _      _
          _      _           _      _      _      _      _
          _      _           _      _      _      _**    _
          _      _           _      _      _      _      _
   Header _      _           _      _      _      _      _
   Address________________________________________________

*   This point is given with an accuracy of 1 second in the          TOC.


**  This point is given without any tolerance in the TOC. Figure II.2

_______________________________________________________________
_  Frame Number _ Point _ PMIN, PSEC, PFRAME _ Control Field  _
_______________________________________________________________
_       n       _  $A0  _     05, 10, 00     _    01 x 0      _
_     n + 1     _  $A0  _     05, 10, 00     _    01 x 0      _
_     n + 2     _  $A0  _     05, 10, 00     _    01 x 0      _
_     n + 3     _  $A1  _     05, 00, 00     _    01 x 0      _
_     n + 4     _  $A1  _     05, 00, 00     _    01 x 0      _
_     n + 5     _  $A1  _     05, 00, 00     _    01 x 0      _
_     n + 6     _  $A2  _     52, 48, 41     _    01 x 0      _
_     n + 7     _  $A2  _     52, 48, 41     _    01 x 0      _
_     n + 8     _  $A2  _     52, 48, 41     _    01 x 0      _
_     n + 9     _  $A0  _     05, 10, 00     _    01 x 0      _
_     n + 10    _  $A0  _     05, 10, 00     _    01 x 0      _
_______________________________________________________________

Figures II.1 and II.2 are examples of the encoding of the TOC for a   CD-I 
disc with four CD-I tracks and no CD-DA tracks.  The lead-in area and  the 
lead-out area are treated as data tracks.

                          Figure II.3


                         Information Area
         ___________________________________________________
   Inner _      _                                  _       _Outer
    side _      _                                  _       _side
   of the_ Lead-_         Program Area             _Lead-  _of
    disc _  in  ____________________________________ out   _the
  __     _ Area _                                  _Area   _disc
  _Track _      _                                  _       _
  _no.TNO___00_________01___________02_________03_____$AA___
  _      _      _      _             _      _      _       _
  _Index _      ___00_____01_____00_____01_____01______01___
Q _      _      _      _      _      _      _      _       _
  _      _      _      _      _      _      _      _       _
C _      _      _  2   _      _  _ 2 _      _      _       _
H _      _      _ sec  _      _  sec _      _      _       _
A _Time  _      _      _      _      _      _      _       _
N _      ___________________________________________________
N _Audio/__Data_______Data_________Audio_____Audio _ Audio _
E _Data  _      _             _             _      _*      _
L _      _      _             _             _*     _       _
  _      _      _             _*            _      _       _
  _ATime _  --  _             _             _      _       _
  __     ___________________________________________________
     Mode__-02________02_______             _      _       _
     Byte_      _             _             _      _       _
         _      _             _             _      _       _
         _      _             _             _      _       _
         _      _             _             _      _       _
         _      _             _             _      _       _
  $AO Min________             _             _      _       _
         _      _             _             _      _       _
         _      _             _             _      _       _
         _      _             _             _      _       _
         _      _             _             _      _       _
         _      _             _             _      _       _
         _      _             _             _      _       _
   Header___________________________________________________
   Address

*  These points are given with an accuracy of one second in the     TOC.

Figure II.4

_______________________________________________________________
_Frame number  _ Point _  PMIN, PSEC, PFRAME  _ Control Field _
_______________________________________________________________
_      n       _   02  _      10,15,12        _     00x0      _
_    n +  1    _   02  _      10,15,12        _     00x0      _
_    n +  2    _   02  _      10,15,12        _     00x0      _
_    n +  3    _   03  _      16,28,63        _     00x0      _
_    n +  4    _   03  _      16,28,63        _     00x0      _
_    n +  5    _   03  _      16,28,63        _     00x0      _
_    n +  6    _  $A0  _      02,10,00        _     01x0      _
_    n +  7    _  $A0  _      02,10,00        _     01x0      _
_    n +  8    _  $A0  _      02,10,00        _     01x0      _
_    n +  9    _  $A1  _      03,00,00        _     00x0      _
_    n + 10    _  $A1  _      03,00,00        _     00x0      _
_    n + 11    _  $A1  _      03,00,00        _     00x0      _
_    n + 12    _  $A2  _      52,48,41        _     00x0      _
_    n + 13    _  $A2  _      52,48,41        _     00x0      _
_    n + 14    _  $A2  _      52,48,41        _     00x0      _
_    n + 15    _   02  _      10,15,12        _     00x0      _
_    n + 16    _   02  _      10,15,12        _     00x0      _
_______________________________________________________________


Figures II.3 and II.4 are examples of the encoding of the TOC for a   CD-I 
disc with one  CD-I track  (01) and two  audio tracks  (02, 03)  in    the 
Program area.   The  lead-in area  is treated as  a data  track and    the 
lead-out area is treated as an audio track.II.3  CD-I Track Specification 


3.1  CD-I Track Layout


In a CD-I track the data is divided into CD-I sectors of 2352   sequential 
bytes each.  There are five different types of CD-I sectors depending   on 
the type of information they contain i.e. Audio,  Video, Data, Empty   and 
Message Sectors (see II.4.9).  Each sector can be uniquely addressed by  a 
BCD-coded absolute time  value in  the header field  of the  sector   (see 
II.4.4).

CD-I sectors with time values of (00", 00', 00) up to (00", 02', 15)  must 
be message  sectors  (see  II.4.9.2).    Message  sectors contain    after 
scrambling, (see II.4.2), the actual CD-DA coded digital audio data.

The sector with a time value of (00",  02', 16) must be a data-sector   in 
Form 1 (see II.4.7).

The sectors from and including time value (00", 02', 16) onward to   (00", 
02'+ Sd1, 15 + fd1) are data sectors  in Form 1 and are all part  of   the 
Disc Label (see III.2) which has a length of (75 * Sd1 + fd1) sectors.

From the end of  the disc label there  must be at  least 2250   contiguous 
message sectors  (see  II.4.9.2).  Thereafter,  CD-I  sectors with    CD-I 
information may start again.

If a CD-I disc contains CD-DA tracks then the first CD-DA track has to  be 
directly preceded by a minimum of 2250 contiguous message sectors.





II.4  CD-I Sector Specification


4.1  Sector Layout


4.1.1  General

In a CD-I track the data is divided into addressable CD-I sectors of  2352 
sequential bytes.

A CD-I sector contains the following data fields:

       - Sync field       12 bytes

       - Header field      4 bytes

       - Subheader field   8 bytes

       - Data field     2328 bytes

All data in a CD-I sector, except the synchronization field is   scrambled 
(see II.4.2).


4.1.2 Byte Ordering


The bytes in a CD-I sector are indexed  from 0 to 2351.  The index    also 
indicates the sequential order in which the bytes have to be processed  by 
the encoder.  The layout of a CD-I sector  is given in Figures II.5    and 
II.6.

The bit/word ordering on disc is as defined in the CD-DA specification.

The relationship between CD-I data bytes (B) and  CD-DA 16-bit words   (W) 
is:

       W2i   = 256 * B4i+1 + B4i even word

       W2i+1 = 256 * B4i+3 + B4i+2 odd word

The data rate is  such that the index  i is incremented  nominally   44100 
times per second.


   The first byte, Bo, of a CD-I sector is after scrambling the 8 least 
significant bits of the even indexed 16-bit word (see Figure II.5).Figure 
II.5a


     ____________________________________________
     _                    _                     _
     _ 16-bit even word   _    16-bit odd word  _
     _         W2i        _        W2i+1        _
     _                    _                     _  _   CD-DA Spec
     _lsb    bits3    msb _ lsb   bits3     msb _  _
     _ 87654321  87654321 _ 87654321  87654321  _  _
     _____________________________________________________
     _         _          _         _           _  _   Byte-wise
     _   B4i   _   B4i+1  _  B4i+2  _   B4i+3   _  _   ordering
     _         _          _         _           _  _   CD-I Spec
     ____________________________________________



Figure II 5b

          _____________________________________________
          _ The relationship between 16 bit samples   _
          _ and data bytes on a CD disc               _
          _____________________________________________
          _ ____16 bit word______ _____16 bit word_____
          _      even word      _       odd word      _
          _                     _                     _
          _ lsb     bits3   msb _ lsb    bits    msb _
          _ 87654321 _ 87654321 _ 87654321 _ 87654321 _
          ______________________________________________
          _ 00000000 _ 11111111 _ 11111111 _ 11111111 __
          ______________________________________________ S
          _ 11111111 _ 11111111 _ 11111111 _ 11111111 __ Y
          ______________________________________________ N
          _ 11111111 _ 11111111 _ 11111111 _ 00000000 __ C
          ______________________________________________
          _  MINUTES _  SECONDS _ SECTORS  _   MODE   __ HEADER
          ______________________________________________
          _  BYTE 16 _  BYTE 17 _ BYTE 18  _  BYTE 19 _
          _____________________________________________
          _    .     _     .    _     .    _    .     _
          _    .     _     .    _     .    _    .     _
          _    .     _     .    _     .    _    .     _
          _____________________________________________
          _  BYTE n  _ BYTE n+1 _ BYTE n+2 _ BYTE n+3 _
          _____________________________________________
          _    .     _     .    _     .    _    .     _
          _    .     _     .    _     .    _    .     _
          _    .     _     .    _     .    _    .     _
          _____________________________________________
          _BYTE 2348 _BYTE 2349 _BYTE 2350 _BYTE 2351 _
          _____________________________________________

      Figure II.6

            ________________________________________
            _ Byte Number  _       Layout          _
            ________________________________________
            _      0       _                       _
            _      1       _     Sync 12 bytes     _
            _      .       _                       _
            _      .       _                       _
            _      .       _                       _
            _     11       _                       _
            ________________________________________
            _     12       _                       _
            _     13       _    Header 4 bytes     _
            _     14       _                       _
            _     15       _                       _
            ________________________________________
            _     16       _                       _
            _     17       _                       _
            _      .       _    Data 2336 bytes    _
            _      .       _                       _
            _      .       _                       _
            _      .       _                       _
            _   2350       _                       _
            _   2351       _                       _
            ________________________________________







4.2  Scrambling


All data in a CD-I sector except the data in the synchronization field  is 
scrambled.  The scrambler is of a parallel sector synchronized type.   The 
scramble register is a  15-bit shift register fed  back according to   the 
polynomial X15  + X  + 1.   The contents  of  this scramble  register   is 
EXOR-ed with  the  serial  information  bit  by bit,  taking  the    least 
significant bit of the data bytes first.  The scramble register is  preset 
with the value %0000 0000 0000 001 after  the synchronization field of   a 
data sector.  The scramble register is given in Figure II.7.


Figure II.7

       Preset
       Value   0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
              _______________________________
bit clock _____ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __________
            ___ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _        _
            _ _______________________________        _
            _                             _          _
            _                             _          _
            _                           _____        _
            _____________________________ + __________
                                        _____        _
                                                     _
                                                     _
                                                     _
                                                   _____
                              Input Data ___________ + ________
                              (lsb first)          _____ Output
                                                         Data


                       _____
                       _ + _ = EXOR Gate
                       _____


4.3  Synchronization Field


The organization of  the synchronization  field (12 bytes)  is given    in 
Figure II.8 below.  All bytes in the synchronization field have the  value 
255 except the first and last bytes, which have the value 0.


Figure II.8


         ____________________________________________
         _  Layout of the Sync Field        _
         ____________________________________________
         _     Byte Number     _     Byte Value     _
         ____________________________________________
         _          0          _          0         _
         _          1          _         255        _
         _          2          _         255        _
         _          3          _         255        _
         _          4          _         255        _
         _          5          _         255        _
         _          6          _         255        _
         _          7          _         255        _
         _          8          _         255        _
         _          9          _         255        _
         _         10          _         255        _
         _         11          _          0         _
         ____________________________________________





4.4  Header Field


The organization of the header field (4 bytes)  is given in Figure    II.9 
below.  The header contains  the CD-I sector address  (3 bytes) and    the 
mode byte.

The relative time difference of the sector address in the header field  to 
the subcode channel Q ATIME should be less than one second.

 Figure II.9


             ____________________________________
             _Layout of the Header Field   _
             ____________________________________
             _   Byte Number   _   Byte Value   _
             ____________________________________
             _        12       _     Minutes    _
             _        13       _     Seconds    _
             _        14       _     Sectors    _
             _        15       _     Mode       _
             ____________________________________


Minutes = a copy of the data contents of AMIN (subcode channel Q)
Seconds = a copy of the data contents of ASEC (subcode channel Q)
Sectors = a copy of the data contents of AFRAME

                                                    (subcode channel   Q) 
Mode = 2   must be  used for CD-I  tracks.                           4.5   
Subheader Field


4.5.1  General Layout


The subheader  field  consists  of  8  bytes.   The  subheader  data    is 
double-written for data integrity (see Figure II.10).

The meaning and value of the subheader data is defined in the   applicable 
chapters.



Figure II.10

________________________________________________________________
_                  Layout of Subheader Field                   _
________________________________________________________________
_  Byte Number     _     Byte Value       _ Applicable Chapter _
________________________________________________________________
_       16         _   File number        _       III          _
_       17         _   Channel number     _       VII          _
_       18         _   Submode            _        II          _
_       19         _   Coding information _    IV, V, and VI   _
_       20         _   File number        _                    _
_       21         _   Channel number     _                    _
_       22         _   Submode            _                    _
_       23         _   Coding information _                    _
________________________________________________________________


Since the  bit  allocations of  these  subheaders are  given  in   various 
chapters, for clarity  and conciseness,  Appendix II.1 reiterates    these 
results.4.5.2  Subheader Definitions



4.5.2.1  File Number


The file number is used to identify all  sectors that belong to one    and 
the same file.  The details of the file  number are given in III.4.4   and 
Appendix II.1.


4.5.2.2  Channel Number


A real-time record may  contain several different pieces  of   information 
that need  be  chosen in  combination  or separately  at  playback.     To 
facilitate the  real-time selection  of such  information each  piece   of 
information may be given  a unique channel number.   The details of    the 
channel number are given in VII.2.2.3.2 (SS_Play) and Appendix II.1.2.


4.5.2.3  Submode


The submode byte defines  global attributes of a  sector as required   for 
the initial  selection  and  allocation  of  a  sector  in  the    system, 
termination of a file or record, initialization of an additional layer  of 
error correction,  and synchronisation.   For details  see II.4.5.3    and 
Appendix II.1.3.


4.5.2.4  Coding Information


This byte defines the  details of the type  of data located  in the   user 
area of the sector.  As this depends on whether the data is audio,   video 
or program related data  its details are given  in IV.3.2.4, V.6.3.1   and 
VI.4.2 and is repeated in Appendix II.1.4.

4.5.3  Submode


The submode byte is bit-encoded as follows:


Figure II.11

              __________________________________________
              _  Bit Number  _        Bit Name         _
              __________________________________________
              _      7       _   End of File (EOF)     _
              _      6       _   Real-time Sector (RT) _
              _      5       _   Form (F)              _
              _      4       _   Trigger (T)           _
              _      3       _   Data (D)              _
              _      2       _   Audio (A)             _
              _      1       _   Video (V)             _
              _      0       _   End of Record (EOR)   _
              __________________________________________

End of file (EOF)           : The last sector of a file is indicated   by 
                          bit 7 equal to 1.  All other sectors  have  bit 
                          7 equal to zero.

Real-time Sector (RT)       : If bit 6 has the value 1 then the   data    
                          has to be  processed without  interrupting  the 
                          real-time behavior  of the  CD-I system.    For 
                          example, audio sectors have  to be  transferred 
                          to the ADPCM decoder in real time in  order  to 
                          avoid the overflow or underflow of data.

Form (F)                    : This bit has a value of 0 for all  sectors  
                          recorded in Form 1  and a value of  1 for   all 
                          sectors recorded in Form 2 (see IV, V and VI).

Trigger (T)          : This bit is used to  synchronize the   application 
with various coding  information, like visuals to audio,  in real   time. 
The bit when set to one   generates an interrupt (see VII.4).

Data (D)             : This  bit has a value  of 1 for  program   related 
data sectors.  Otherwise it is zero.  When this  bit is set to one,    the 
Form bit must be zero.

Audio (A)             :This bit  has a  value of  1  for audio    sectors. 
                            Otherwise it is zero.  When this bit is   set 
                            to one the Form bit is also set to one.

Video (V)             :This  bit  has  value  of 1  for  video    sectors. 
                            Otherwise it is zero.

End of Record  (EOR)  :  This bit must  have the  value 1  for the   last 
sector of a logical record.  Otherwise it is  zero.  The use of the    EOR 
bit is only mandatory for real-time records.

Only one of bit 1, bit 2 or bit 3 may have the value 1 at the same   time. 
One of bit 1, bit 2 and bit 3 must be set to the value 1 for all   sectors 
except empty message sectors.  If bits 1, 2 and 3 of the submode byte  are 
zero then the sectors are either empty or message sectors.

It should be noted that the combination of  the Video bit (bit 1) set   to 
one, the Form bit (bit 5) set to  zero and the Real-time sector bit   (bit 
6) set to one is reserved for full screen, full motion quality video.

Note:       If a trigger bit and an EOR bit are set in the same   sector, 
      and the sector was not selected via the channel mask, the EOR   bit 
      will be reset by the CD driver so that it is not acted upon by  the 
      driver or the application.4.6  General Data Classes

Sectors on a CD-I disc may contain two generic classes of data:

  .        data with  a strong  requirement for  data integrity    where 
     concealment is not possible (e.g. text, computer data)
  .    data where errors can be concealed by some  interpolation   scheme 
     (e.g. audio,video).

The text and computer data, for example, have a strong requirement for  an 
extra layer  of  error  correction  beyond  the CIRC    (cross-interleaved 
Reed-Solomon code) used on  all Compact Discs.  For  this class of   data, 
error detection and  correction should  be implemented according  to   the 
CD-I EDC/ECC (see II.4.7).  The sector structure used  for this class   of 
data is called Form 1 and is specified in detail in II.4.7.

The latter  class of  data has  a strong  requirement  for maximum    data 
throughput per time unit.   The sector structure used  for this class   of 
data is called Form 2 and is specified in detail in II.4.8.

It should be noted that both Form 1 and Form 2 may be used for   real-time 
data.  However, for Form 1 real time sectors,  priority is given to    the 
real time aspect (and not to data integrity). Therefore only players  with 
built-in hardware  support that  enables them  to correct  errors    fully 
transparently in  real-time  without  requiring  CPU  intervention    will 
correct these sectors. Consequently, a CD-I base case system without  real 
time ECC handling will not correct Form 1 real time sectors.

Allowed combinations of different sector types and classes  are given   in 
the table below.
         _______________________________________________
_             _    Form 1     _   Form 2      _
_             _________________________________
         _             _RT = 0 _RT = 1 _RT = 0 _RT = 1 _
_______________________________________________
_ Audio       _  No   _  No   _  Yes  _  Yes  _
_ Video       _  Yes  _  No   _  Yes  _  Yes  _
_ Data        _  Yes  _  Yes4 _  No   _  No   _
_ Empty       _  Yes  _  Yes  _  Yes  _  Yes  _
_ Message     _  No   _  No   _  Yes  _  No   _
_______________________________________________
4.7  Form 1 Sector


4.7.1  General Layout


A Form 1 sector consists of 2352 bytes.   Each byte in the sector can   be 
identified by Bi where i = 0 to 2351.

The layout of a Form 1 sector is as follows:


Figure II.12


________________________________________________________________
_       Byte       _                  Meaning                  _
________________________________________________________________
_  Bo    to B15    _ the synchronization and header            _
_                  _ fields.                                   _
_                  _                                           _
_  B16   to B23    _ the subheader field.                      _
_                  _                                           _
_  B24   to B2071  _ 2048 bytes of data whose content          _
_                  _ depends on the sector type.               _
_                  _                                           _
_  B2072 to B2075  _ EDC field of 4 bytes.                     _
_                  _                                           _
_  B2076 to B2351  _ ECC field.                                _
________________________________________________________________




4.7.2  Error Detection Code Field


The EDC used is a 32-bit CRC on the data field defined as B16 to B2071.

The EDC codeword must be divisible by the check polynomial.

The least  significant bit  of a  data byte  is  used first  in the    CRC 
mechanism.  The least significant bit (X0) of the  EDC parity is   located 
at bit 7 of byte 2075.
The check polynomial is:

P(X) = (X16 + X15 + X2 + 1) * (X16 + X2 + X + 1)

The first  factor of  the check  polynomial is  the  traditional   CRC-16. 
Depending on the desired level of reliability one  can check one or   more 
factors of P(X).


4.7.3  Error Correction Code Field


The ECC is a kind of product code over GF (28), bytes being symbols.    In 
this section the  bytes are  numbered as parts  of 16-  bit words.     The 
consecutive words in a sector are numbered 0 to 1169, where the  numbering 
starts right after the synchronization pattern.  Hence, the whole   sector 
exclusive of the synchroni-zation pattern is protected by the ECC.

The translation rule from bytes into words is:
    
    SN = B2N+12 + 256*B2N+13

    with N = 0 to 1169 and

    B12 to B15 must be set to 0

A sector consists of 2 codewords as follows:

  -  1 codeword containing the most significant bytes of each     word.

  - 1 codeword containing the least significant bytes of each word.

This can be envisioned as if one has 2 planes for ECC, 1 plane  containing 
the MSB and the second plane containing the LSB.  On each plane the   same 
product code is defined.  In each plane one still labels each byte by  the 
word number defined above.
The field GF (28) is generated by the primitive polynomial:

P(X) = X8 + X4 + X3 + X2 + 1

The primitive element a of GF (28) is :

  a = (0 0 0 0 0 0 1 0)

        msb         lsbThe column codewords  are denoted as P-words    and 
the row codewords are denoted as Q-words.  The  P-words are (26,24)   Reed 
Solomon codewords over GF  (28).  In each plane  the P-words contain   the 
following bytes:


Figure II.13

                        __               __
                        _ S(43 *  0 + NP) _
                        _ S(43 *  1 + NP) _
                        _ S(43 *  2 + NP) _
                        _ S(43 *  3 + NP) _
                        _ S(     "      ) _
                        _ S(     "      ) _
                        _ S(     "      ) _
         P-word:  Vp =  _ S(43 * MP + Np) _ NP = 0,1,2,......42
                        _ S(     "      ) _ MP = 0,1,2,......25
                        _ S(     "      ) _
                        _ S(     "      ) _
                        _ S(43 * 22 + NP) _
                        _ S(43 * 23 + NP) _
                        _ S(43 * 24 + NP) _ - P-parity
                        _ S(43 * 25 + NP) _ - P-parity
                        ___              __


The parity check matrix Hp is given in Figure II.14 below.


Figure II.14

                        __                __
                        _ 1   1   ..  1  1 _
                     HP = _                  _
                           _ a25 a24 ..  a1 1 _
                        __                __


where a is the primitive element of GF  (28) defined above. The   quantity 
VP satisfies:

      HP * VP = 0

The Q-words are (45,43)  Reed Solomon codewords over  GF (28).  In    each 
plane the Q-words contain the following bytes:

Figure II.15

                    __                    __
                    _ S(44 *  0 + 43 * NQ) _
                    _ S(44 *  1 + 43 * NQ) _
                    _ S(44 *  2 + 43 * NQ) _
                    _ S(      "          ) _
                    _ S(      "          ) _
                    _ S(      "          ) _ NQ = 0,1,2,...,25
     Q-word:  VQ =  _ S(44 * MQ + 43 * NQ) _ MQ = 0,1,2,...,42
                    _ S(      "          ) _
                    _ S(      "          ) _ (44 * MQ + 43 * NQ)
                    _ S(      "          ) _ must be calculated
                    _ S(44 * 41 + 43 * NQ) _ modulo 1118
                    _ S(44 * 42 + 43 * NQ) _
                    _ S(43 * 26 +      NQ) _ - Q-parity
                    _ S(44 * 26 +      NQ) _ - Q-parity
                    __                   ___


The parity check matrix HQ is:


Figure II.16


                    __                    __
                    _  1   1   ...  1   1  _
              HQ =  _                      _
                      _  a44 a43 ...  a1  1  _
                    __                    __


where a is the primitive element of GF (28) defined above.

The quantity VQ satisfies:

         HQ * VQ = 0   .











The interleave map for  P-words and Q-words showing  P-words as    columns 
given in Figure II.17 below.


Figure II.17


                    ______Np ______

             0    1    2                   41   42  _
________________________________________________________________
     0  _   0000 0001 0002 .... .... .... 0041 0042 _   _
   _ 1  _   0043 0044 0045 .... .... .... 0084 0085 _ header
Mp _ 2  _   0086 0087 0088 .... ....      0127 0128 _   +
   _ 3  _   0129 0130 0131 ....                0171 _ user data
   _ 4  _   0172 0173 ....       Q             0214 _   _
   _    _    _                                  .   _   _
   _    _    P                                  .   _   _
        _    _                                  .   _   _
    22  _   0946 0947 0948 .... .... .... 0987 0988 _   _
    23  _   0989 0990 0991 .... .... .... 1030 1031 _   _
________________________________________________________________
        _                                           _   _
    24  _   1032 1033 1034 .... .... 1072 1073 1074 _ PARITY-P
    25  _   1075 1076 1077 .... .... 1115 1116 1117 _   _
________________________________________________________________
    26  _   1118 1119 1120 .... 1143 _              _   _
    27  _   1144 1145 1146 .... 1169 _              _ PARITY-Q
        _                            _              _   _
________________________________________________________________
        _    0    1    2    .    25

The display  of the  symbols of  the code  in  rectangular form    showing 
Q-words as rows is given in Figure II.18.


Figure II.18


                ______ MQ ______
        _  0    1    2    .     .   40   41   42   _  Q0   Q1  _
   _____________________________________________________________
      0 _ 0000 0044 0088 .... .... 0642 0686 0730  _ 1118 1144 _
   _  1 _ 0043 0087 0131 .... .... 0685 0729 0773  _ 1119 1145 _
NQ _  2 _ 0086 0130 0147 .... .... 0728 0772 0816  _ 1120 1146 _
   _  3 _ 0129 0137 0217 .... .... 0771 0815 0859  _ 1121 1147 _
   _  4 _ 0172 0216 0260 .... .... 0814 0858 0902  _ 1122 1148 _
   _    _  .                                       _       .   _
   _    _  .                                       _       .   _
   _    _  .                                       _       .   _
     22 _ 0946 0990 1034 .... .... 0470 0514 0558  _ 1140 1166 _
     23 _ 0989 1033 1077 .... .... 0513 0557 0601  _ 1141 1167 _
     24 _ 1032 1076 0002 .... .... 0556 0600 0644  _ 1142 1168 _
     25 _ 1075 0001 0045 .... .... 0599 0643 0687  _ 1143 1169 _
________________________________________________________________




4.8  Form 2 Sector


4.8.1  General Layout


A Form 2 sector consists of 2352 bytes.   Each byte in the sector can   be 
identified by Bi where i = 0 to 2351.

The layout of a Form 2 sector is given in Figure II.19.

Figure II.19

________________________________________________________________
_    Byte         _                   Meaning                  _
________________________________________________________________
_ Bo    to B15    _  the synchronization and header fields     _
_                 _                                            _
_ B16   to B23    _  the subheader field.                      _
_                 _                                            _
_ B24   to B2347  _  2324 bytes of data whose  content         _
_                 _  depends on the sector type.               _
_                 _                                            _
_ B2348 to B2351  _  4 bytes reserved for quality control      _
_                 _  during the CD-I disc production process.  _
________________________________________________________________


4.8.2  Reserved Field


The reserved field (B2348  to B2351) contains 4  bytes that are   reserved 
for quality control during the CD-I disc production process.  These  bytes 
are ignored by  the CD-I  system.  It is  recommended that  the same   EDC 
algorithm should be used  here as is used  for Form 1  sectors.  If   this 
algorithm is not used, then the reserved bytes are set to 0.












4.9  Empty and Message Sectors


4.9.1  Empty Sector

An empty sector may be Form 1 or  Form 2 and does not contain any     CD-I 
data.  They may be  used in the lead-in  and/or lead-out areas.   In   the 
program area empty sectors can be used to fill up file space  particularly 
for real-time files.

The subheader of an Empty sector has the following restrictions:

(1) Channel number must be zero.

(2)   The Video, Audio and Data bits in the submode byte must be zero.

(3) The Coding Information byte must be zero.

It is recommended that empty sectors are Form  2 and that the data   bytes 
are zero.


4.9.2  Message Sector

The data field of  a message sector is  in Form 2  and consists of    2324 
bytes which do  not contain  any actual data  for the  CD-I system.    The 
message sector is designed to provide a caution  for the user of a   CD-DA 
player that has  no TOC  decoder.  The caution  should warn  the user   to 
lower the volume and advance to the CD-DA tracks.

The message data must be encoded as CD-DA audio data in the mode 2 Form  2 
message sector.  As such, it is encoded after scrambling as actual   CD-DA 
audio data so that  it may be audible  on normal CD-DA  players.  It    is 
recommended that the warning be in English as well as any other   language 
that may be appropriate.   Figure II.20 gives an  example of the   message 
which might be contained in message sectors.  All  bits of the   subheader 
bytes of a message sector except the Form bit are set to zero.

Figure II.20

           ___________________________________________________
           _     Message Example                   _
           ___________________________________________________
            _    "Please lower the volume temporarily and     _
           _            advance to the next track."          _
           ___________________________________________________
II.5  CD-I Encoder Model


5.1  CD-I Disc Encoder Model




Figure II.21



                             _____________
         ____________   A    _           _
Audio ____  Audio   __________           _
Input    _ Encoder  _        _           _
         ____________        _           _
                             _           _
         ____________   V    _           _
Video ____  Video   __________   CD-I    _   ___________
Input    _ Encoder  _        _           _   _         _
         ____________        _ Physical  _ W _  CD-DA  _    CD-I
            C _              _           _____         ____ Disc
         ____________   D    _  Sector   _   _ Encoder _
Data  ____   Data   __________           _   _         _
Input    _  Encoder _        _ Formatter _   ___________
         ____________        _           _
                             _           _
         ____________        _           _
         _  Empty   _   E    _           _
         _  Sector  __________           _
         _Generator _        _           _
         ____________        _           _
         ____________        _           _
         _ Message  _   M    _           _
         _  Sector  __________           _
         _Generator _        _           _
         ____________        _____________


A = Audio sector
V = Video sector
D = Data sector
E = Empty sector
C = Video control data
M = Message sector

W = CD-I sector5.2  CD-I Physical Sector Formatter



Figure II.22



                                  ____________
                  ___________  S  _          _
   __________     _  Sync   _______  Sector  _     _____________
   _        _     _Generator_     _          _  B  _           _
A___        _     ___________     _  Format  _______ Scrambler _
   _ Sector _     ___________  H  _          _     _           _
   _        _     _ Header  _______  Multi   _     _____________
V___        _     _Generator_     _          _           _
   _ Inter- _     ___________     _  Plexer  _           _ W
   _        __ SD _________________          _           _
D___        _          _          ____________           _
   _ leaver _          _               _               Output
   _        _          _               _ EC
E___        _     ___________     _____________
   _        _     _  Form   _ F   _  EDC/ECC  _
M___        _     _  Value  _______   Data    _
   __________     _Detector _     _ Generator _
                  ___________     _____________

A = Audio sector data
V = Video sector data
D = Data sector data
E = Empty sector data
M = Message sector data
S = Synchronisation data
H = Header data
SD= Sector data
EC= Error detection and correction data
F = Form value
B = Serial bit stream of CD-I sector data
W = 16-bit word stream of CD-I sector data to CD-DA encoder







II.6  CD-I Decoder Model

6.1  CD-I Decoder Model



Figure II.23


                           _____________
         ______________    _           _
         _            _    _           _________CD-DA Data
         _            _    _           _
         _   CD-DA    _    _   CD-I    _
Disc _____            ______  Sector   _________CD-I Sector Data
         _  Decoder   _    _ Processor _
         _            _    _           _
         _            _    _           _________Mode 1 Data
         ______________    _           _
                           _____________



6.2  CD-I Sector Processor



Figure II.24



       _____________________________________________ CD-DA Data
       _     Unit 1                  Unit 2
       _    __________________      ___________
        _    _- Sync Detector _      _         ______ File Number
       _    _                _      _         _
       _    _                _      _         _      Channel
Data ________- Descrambler   ________Subheader______ Number
Input       _                _  _   _         _
            _                _  _   _         ______ Submode
            _- Mode Detector _  _   _         _
            __________________  _   _         ______ Coding
                           _M   _   ___________      Information
                           _    _     _  _  _
                   EF      _    _     _  _  _
CIRC       ____________________________ RT  F
Error Flag               _ _    _     _  _  _
                         _ _    _     _  _  _
                Unit 4   _ _    _     Unit 3
             _____________ _ T  _   _____________
Subcode      _   CD-I   _____________ EDC/ECC   _____ Data Error
         _____  track   __ _    _____  Mode 2   _     Flag
Q-channel    _ Detector __ __M_______Form 1 or 2_____ CD-I Data
             _____________ _    _   _____________
                         _ _    _     Unit 5
                         _ _    _   ___________
                         _ _    _____         _
                         _ __________ Mode 1  _____ Mode 1 Data
                         ____________         _____ Data Error
                                    ___________     Flag

M  = Mode (1 or 2)
RT = Real-time Flag of Submode Byte
F  = Form (1 or 2)
EF = Set if data is unreliable
T  = Set if data track is a CD-I track
For CIRC see CD-DA specification pp 27 to 37.
For Subcode Q channel see CD-DA specification page 41.



Unit 1

The Unit 1 processing is only valid for a data track.

  - The synchronization detector  is used for all  timing needed in   the 
sector processor.

  - The descrambler  processes the  input data stream  into sector   data 
bytes (B12 to    B2351).

  - The mode detector gives the mode value for the data sector from   the 
headerfield.

Unit 2

In Unit 2 the  error flag from CIRC  is used to  select the file   number, 
channel number, submode and coding information bytes from  the   subheader 
field (B16 to B23) that are reliable.  The  Real-time flag and the    Form 
value in the submode byte are passed to Unit 3.

Unit 3

For Form 1 sectors  the EDC and ECC  data field is  used to correct    any 
erroneous data in the  data field.  In the  case of a  Form 2 sector    no 
processing is required.  For concealment purposes, a data error flag  must 
be generated.  If this error flag is set  to one, an additional table   of 
error flags  per  byte or  word  (depending on  the  implementation)    is 
available.  The format of these tables is given in VII.2.2.3.2


Unit 4:

Unit 4 has to detect if the disc is a CD-I disc or not.  This can be  done 
by using the information in the TOC (Subcode Q-channel).

The Unit 2 and Unit 3 processing are only valid for CD-I data tracks.

Unit 5:

For Mode 1 sectors,  the EDC and ECC  data field is  used to correct   any 
error in the data field.

A data  error flag  is set  if error  correction  was not  possible   (see 
VII.2.2.3.4).

6.3  Byte Order : After the Sector Processor

The byte and bit ordering after the sector processor is as given in I.3.

