A V.1  CCIR Level Assignment


The CCIR recommendation 601.1 defines certain reference binary levels  for 
a uniformly  quantised pcm  image having  8 bits  per  sample.   Luminance 
samples are represented by a positive binary number and colour  difference 
samples by an offset  binary number. The total  nominal excursion of   the 
luminance signal  corresponds  to 220  quantization  levels, with    black 
corresponding to level 16, and nominal white to level 235 (Figure A.V.1).

There is  an unequal  quantization margin  above and  below  the   nominal 
signal because there is  a greater variation in  the nominal white   level 
than in the nominal black level, and the effect of clipping the  overshoot 
will be more perceptible in the white region.

As the luminance signal occupies 220 levels and as black is at level   16, 
the digital luminance signal Yd is given by:

  Yd = 219 * Y + 16

where Y is  the analogue  luminance signal expressed  as a  fraction    of 
unity, and  Yd is  the corresponding level number  after quantization   to 
the nearest integer value (see Figure A.V.1).

The colour-difference signals each occupy 225 levels in the central   part 
of the quantization scale,  with zero signal corresponding  to level   128 
(see Figure A.V.2).  The  digital colour-difference signals Ud  & Vd   are 
therefore given by

  Vd = 224 * (0.713 * (R - Y)) + 128
  Ud = 224 * (0.564 * (B - Y)) + 128

where Vd Ud are quantized to the nearest integer value.

R - Y, B  - Y  are the colour-difference  analogue values  of any   colour 
expressed as a fraction of unity.









Figure A.V.1


            ___________________________________________
            _LEVEL                  BINARY        HEX _
            ___________________________________________
            _ 255 ----------------(11111111)       FF _
            _                                         _
            _ 235 -----White------(11101011)       EB _
            _                                         _
            _  16 -----Black------(00010000)       10 _
            _                                         _
            _   0 ----------------(00000000)        0 _
            ___________________________________________




Figure A.V.2


            ___________________________________________
            _LEVEL                  BINARY        HEX _
            ___________________________________________
            _ 255 ----------------(11111111)       FF _
            _                                         _
            _ 240 ----Maximum ----(11110000)       FO _
            _                                         _
            _ 128 ------Zero------(10000000)       80 _
            _                                         _
            _  16 ----Minimum-----(00010000)       10 _
            _                                         _
            _   0 ----------------(00000000)        0 _
            ___________________________________________










A V.2  Guidelines for 525/625 Image Interchange


2.1   Introduction

It is mandatory that all CD-I discs 'work' on all CD-I decoders. By   this 
is meant that:

-  all essential information is presented to the user.

-   the user has access to all functions of the application on the disc.

This capability  is the  responsibility of  the application,  with    some 
assistance from the decoder hardware and system software.

The implications of this for images are:

-   All images are 'correctly' displayed on all decoders, whether 525  or 
  625 line format, that is they must not be 'scrambled'.

-   The vital information in the safety area of all images must be  fully 
  visible on all decoders.

-   It  must be  possible to  position the  cursor  and pointing   device 
  correctly on all decoders.

-   Additionally,  Motion video  must work  correctly on  all   decoders, 
  whatever their field rate.

This appendix gives guidelines on how the application  can achieve   these 
goals.

2.2 Image Interchange

2.2.1 Display Compatibility Mode

The main  function  provided  by  the  decoder  to  assist  with     image 
interchange is the ability  to change the dimensions  of the   full-screen 
display according to the setting of a flag  called 'Compatibility   Mode'. 
This function is specified  in V.4.8.  The Compatibility  Mode is set   by 
the UCM function DC_SetCmp.

The dimensions of  the full-screen  display in the  two cases,  and    the 
offsets in pixels of the top left corner of the display for Mode = 1  from 
that for Mode =  0 are given in  tabular form in  V.4.8.  Figure   A.V.2.1 
below show the same information in diagrammatic form.

Note that the pixel  clock frequency, and thus  the pixel aspect    ratio, 
remains the same when the Compatibility Mode is changed.

Figure A V 2.1
    ___________________________    _________________________
    _ __------ 360 --------__ _    _ __------ 360 ------__ _
    _ _                     _ _    _ _                   _ _
    ___------- 384 ---------___    ___------- 384 -------___
    _ _                     _ _    _ _                   _ _
    _ _     Height = 240    _ _    _ _    Height = 240   _ _
    _ _                     _ _    _ _                   _ _
    _ _                     _ _    _ _                   _ _
    ___ X offset (-12)      _ _    ___ X offset (12)     _ _
    _ _                     _ _    _ _                   _ _
    ___________________________    _________________________
           525 line monitor                  525 line TV
                                              _
                   __________________________ _
                   _ ______________________ _ _   Y offset = 20
                   _ __------ 360 -------__ _
                   _ _                    _ _
                   ___------- 384 --------___
                   _ _                    _ _
                   _ _                    _ __-- = 280
                   _ _                    _ _
                   ___    X offset (12)   ___--- = 240
                   _ _                    _ _
                   _ ______________________ _
                   __________________________
                           625 line system

_______  Compatibility Mode = 0
_______  Compatibility Mode = 1


The X offsets (i.e. -12, 12, and 12 respectively) and Y offsets shown  are 
those recommended in order to ensure the visibility of the entire   safety 
area.


2.2.2  Fitting the Image to the Display

The image may have  different width from that  of the display,   different 
height, or both.  Of these, the most important is the width.  The  display 
width must be the same as that of the image, to support the simplest  case 
where an image does not have a Display  Line Start Pointer on each   line. 
A difference of height simply means that less lines are displayed.

Accordingly, the application should set the Compatibility Mode such   that 
the display width  matches that  of the image.   If the  image height   is 
greater than the display, it should also arrange to move the image up,  in 
order to centralize the safety area, by starting to display at a point  20 
lines lower in the image.

The application can find  out which display format  is supported by    the 
decoder by interrogating  the Device  Status Descriptor for  the   Display 
Monitor (see Appendix VII.2).

Details of  what  the application  must  do for  specific  cases  are   as 
follows:

525 line images  (360 x 240)

525 Monitor
Set Compatibility Mode to 0

525 TV
Set Compatibility Mode to 1

625 Display
Set Compatibility Mode to 1


625 line and Compatible Images  (384 x 280)

525 Monitor
Set Compatibility Mode to 1.

When the FCT is linked to the LCT, it must be linked to a line number   20 
lines greater than the starting line for a 625 display.




This line of the LCT must contain a  Display Line Start Pointer   pointing 
to the start of its associated line of the image.

525 TV
Set Compatibility Mode to 0

When the FCT is linked to the LCT, it must be linked to a line number   20 
lines greater than the starting line for a 625 display. This line of   the 
LCT must contain a Display Line Start Pointer  pointing to the start    of 
its associated line of the image.

625 Display
Set Compatibility Mode to 0.

525 line TV images  (384 x 240)

As well as the  main specified image formats  above, 525 line  TV   format 
images may be encoded and displayed, as follows:

525 Monitor
Set Compatibility Mode to 1

525 TV
Set Compatibility Mode to 0

625 Display
Set Compatibility Mode to 0.

Insert 'dummy' LCT sections of 20 lines each at top and bottom of the  LCT 
for the image.  These should have display line start pointers pointing  to 
(nominally) blank image strips of 20 lines each.

Images wider than Full-screen

The above is  concerned with  full-screen images.  For  images of    width 
greater than full-screen, which by definition have a  Display Line   Start 
Pointer associated with each line, the display width  must be set to   the 
width of the portion  of the image that  the application wishes  to   have 
displayed.

2.2.3  The LCT and Visual Effects

When a 625 line image, of a height  of 280 lines, is displayed on a    525 
line display, with a height of 240 lines,  not only are 40 lines of    the 
image not  displayed, but  also 40  lines of  the  original LCT  are   not 
executed.




For this, the application has the option of which 40 LCT lines to  ignore. 
It is recommended that the application links the  FCT to line 20 of    the 
LCT.  This will cause the top or the  bottom 20 lines of the LCT to     be 
ignored.  In any case,  the Display Line Start  Pointer should   reference 
line 20 of the image, so that the center 240 lines of the original   image 
are still displayed.

The primary difference between  the options of which  lines to ignore   is 
how the application will  write into the LCT.   All writes must  be   done 
relative to the new  beginning line.  Any instructions  in the LCT   which 
are before the linked line are not executed.  In any but the   recommended 
case, the  application must  remember that  there is  an  offset   between 
drawmap lines and LCT lines.

The non-execution of lines at the bottom of the LCT is not a problem,   as 
DCP instructions on a given line affect only  that line and later   lines, 
and not  previous lines  in the  image or  lines  on later  fields    (see 
V.4.5.1).  However, the non-execution of the lines before the linked  line 
must be taken into consideration by the application.

As an example, a rectangular matte starting on line 15 requires two  'load 
matte register' instructions on line 15, and no  further instructions   on 
later lines.  When displayed  on a 525 line  decoder, these   instructions 
must be inserted on line 20 by the application.

On the other hand, as another example, a  circular matte, which   requires 
'load matte  register' instructions  on each  line, requires  no   special 
attention by the application for image interchange.

Of course, any DCP  instructions which are intended  to affect the   whole 
image should  be placed  in the  FCT, and  are  then independent  of   the 
display height.

2.2.4  Cursor Alignment

The default  cursor origin  is always  at the  top  left corner  of    the 
full-screen image.  This is true whether the Compatibility  Mode is 0   or 
1.  There is therefore  no offset of the  cursor from the  image,   except 
that which is caused by the 20 line vertical offset at link time that  the 
application must apply to 625 line images on 525 displays.

The application can compensate for this by offsetting  the cursor   origin 
vertically by 20 lines, using the UCM function GC_Org.

2.2.5  Pointer Alignment

All pointing devices deliver coordinates whose default origin  is at   the 
top left corner of the full screen display for Compatibility Mode = 0.
In order for the  application to know at  which point in  the image    the 
pointing device is  pointing, it  must know the  offset of  the top   left 
corner of the image from this point.

This offset is composed of two components.

-   the offset of  the top left corner  of the full-screen  display  from 
  this point.  This is returned by a call  to DC_SetCmp: it is zero   for 
  Compatibility Mode = 0.

-   The  20 line  vertical offset  of the  image  from the    full-screen 
  display applied by the application when displaying a 625 line image  on 
  a 525 line decoder.

By combining these two  offsets, the application can  know the offset   to 
apply to  the  pointer.   The  origin  of  the  pointer  can  be    offset 
accordingly by a call to the UCM function PT_Org.


2.2.6  More than One Standard on a Disc

The discussion of image interchange above assumes that  images have   been 
prepared for one particular standard, and describes how  to display   them 
on all decoders.

An alternative is for  the application to have  images of more  than   one 
standard on disc, and to choose them according  to the decoder it    finds 
itself on.

An extension of this is the fully adaptive  application, which   positions 
and sizes  what  it displays  to  suit the  dimensions  of  the    display 
available.

Applications of this kind may make use of  the full 250 line safety   area 
of 625 line displays.


2.3  Field Timing

An intrinsic  difference  between 525  line/60  Hz and  625  line/50    Hz 
displays is  that they  have different  field periods  (16.7  and 20    ms 
respectively).  This gives rise to two potential 525/625 line  interchange 
problems, i.e.

-   what happens to motion video for one  standard when it is   displayed 
  on the  other?   Examples of  motion  video are  a  rapid  sequence  of 
  partial updates, or full-screen runlength animation.

-   if  part of  the screen  is updated  every  field, say  to move    an 
  'object', the speed of motion will be greater on 525 line systems.

There is nothing the decoder can do to  help with these problems. It    is 
entirely the responsibility of  the author to ensure  that he writes   his 
application to be independent  of the field period.  Some techniques   for 
doing this are as follows.

2.3.1  Motion video

The image update  rate can  never be precisely  locked to  even a   single 
field rate, as the  disc rotation and the  display clock are  not   locked 
together.  The retrieval of images from the disc  and their displays   are 
of necessity asynchronous.

The display of each  successive image may be  initiated by completion   of 
loading the  image  from disc,  if  the images  are  spaced  at    regular 
intervals on  the  disc.  If  not,  e.g. for  runlength  images,   another 
scheme, such as regularly spaced trigger bits on the disc, must be used.

For any moving video a double or triple buffering scheme is necessary   to 
prevent half-formed images being  displayed.  For partial screen    moving 
video, the width of each image is generally less than that of the  screen, 
so a partial update or similar copy operation  must be performed   between 
the disc buffer and the display memory.

If this copy operation takes less than one field period (i.e. 16.7 ms,  as 
we must take the worst case), a single  display memory may be used,   with 
the use of the  'signal on display line'  DCP instruction to   synchronize 
the copy to the field scan and thus prevent flicker.  If not, two or  more 
display memories are required, displayed alternately by changing   display 
pointers in the active DCP.



In both  cases,  each successive  image  is synchronized  to  the    first 
available field, whether at 50 or 60 Hz.   For say 12.5 images/ sec,    on 
625 systems each  image is  displayed for 4  fields: on  525 systems   the 
average is 4.8 fields,  in a pattern 5,5,5,5,4.   The visual results   are 
generally acceptable.

For full-screen runlength  animation, no  copying is necessary,  but   the 
successive images are of  different length in memory,  and may take   very 
different times to load from disc.  A multiple buffer scheme may be   used 
to even out arrival and display rates.


2.3.2  Object motion

Never lock anything to field rate.  Always synchronize update and  display 
operations to an independent  reference, such as the  system clock,    and 
update the  display on  the next  field, as  indicated  by a  'signal   on 
display line' DCP instruction, to avoid flicker.


