-----------------------------------------------------------------
January 2nd 1998 CD Version 0.6
-----------------------------------------------------------------

INTEGRATORS:

NextLevel Systems
Contact:
        Bob Eifrig  (beifrig@nlvl.com)
        Xuemin Chen (xchen@nlvl.com)
        NextLevel Systems
        6262 Lusk Blvd
        San Diego, California, 92121, USA

-----------------------------------------------------------------
REASON FOR UPDATE:

Added interlaced coding tools to V0.5 -> V0.6.


-----------------------------------------------------------------
FILES CHANGED:

???

-----------------------------------------------------------------
COMMENTS:



-----------------------------------------------------------------
OPTIONAL DETAILS:

1) Changes to the parameter file
--------------------------------

   The parameter file format has been modified to include the necessary
   data for interlaced video coding.  The new version of the parameter file
   is 808.  Note that all older parameter files will have to be updated to
   work with this software.  The changes are:

   a) "Interlaced coding flag" (follows "packet video length").
      There is one flag per VOL which is 0 for progressive, 1 for interlaced.

   b) "Source frame rate" (follows "disable advanced prediction")
      This is a floating point frame rate in Hz for the video source file.
      (examples are 29.97, 30, 25, ...).  The coded frame rate is obtained
      by dividing this number by the "temporal sampling rate" parameter.

   c) The meaning of the "maximum search range" parameter has been altered.  It
      is now the motion estimation search range in full pels PER CODED FRAME
      AWAY FROM REFERENCE.  This means, if the code VOP pattern is IBBPBBP ...
      (in display order) and if the maximum search range is set to 10 (for
      example), the search radii are:

      First B VOP forward       10
      First B VOP backward      20
      Second B VOP forward      20
      Second B VOP backward     10
      First P VOP forward       30

   d) The "top field first" flag follows "source frame rate".  There is one
      Boolean (1 or 0) for each VOL.  The flag is 1 iff first (top) row of
      pixels belongs to the temporally first field of video.  This flag is
      ignored except in interlaced coding mode.

   e) The "alternate scan" flag follows the "top field first" flag.  There is
      one Boolean (1 or 0) for each VOL.  If the value is 1, then the alternate
      vertical scan is used for all DCT block (both inter and intra) when
      in interlaced coding mode.

   f) The "direct mode search radius" follows "alternate scan"; there is one
      number for each VOL.  It specifies the maximum value of each component
      of the direct mode delta motion vector (in half pixel units).  An exhaustive
      search is executed for each B macroblock to find the direct mode candidate
      prediction

   g) Motion vector file usage and motion vector file name follow the direct mode
      search radius.  There is one usage number and filename for each VOL.  The
      value of usage are:

        0   Ignore the motion vector filename (a white space delimited string must
            still be provided).
        1   Read motion vectors from the file
        2   Write motion vectors to the file

      The format of the motion vector file will be described in the next section.

2) Motion vector file format
----------------------------

The encoder can read, write or ignore the motion vector file.  The purpose of
the motion vector file is to compute the full-pel motion vectors (with respect
to the original reference picture) once, then reuse this information on
subsequent encodings of the same sequence.  Use of motion vector file with
CCIR 601 size video with a typical configuration of 2 consecutive B-VOPs and
a search radius of 31 full pels per frame away from the anchor picture will
reduce the execution time by more than a factor of 15!

The only parameters which cannot be changed between calculation and use of
the motion vector information are (1) the distance between I-VOPs, (2) the
distance between anchor VOPs.  The motion estimation radius per frame away
from reference cannot be decreased between the calculation of the MV file and
its use.  The length of the sequence to be encode (frames) can be reduced,
although it must end on an anchor VOP of the MV file.

The format of the MV data is an ASCII text file with one line of data per
macroblock.  The pictures are delimited by a separate line which begins with
"Pic".  The format of the data is different for P-VOPs and B-VOPs (I-VOPs do
not appear in the MV file).  All motion vector components are in half-pel
units in frame coordinates.

For P-VOPs, there are 21 integers per macroblock line:
	 1)	Horizontal macroblock coordinate
	 2)	Vertical macroblock coordinate
	 3)	Inter flag (0 for Intra, 1 for Predicted)
	 4)	16x16 MV horiz coordinate
	 5)	16x16 MV vert coordinate
	 6)	Field MV horiz coordinate for current=top, reference=top
	 7)	Field MV vert coordinate for current=top, reference=top
	 8)	Field MV horiz coordinate for current=top, reference=bottom
	 9)	Field MV vert coordinate for current=top, reference=bottom
	10)	Field MV horiz coordinate for current=bottom, reference=top
	11)	Field MV vert coordinate for current=bottom, reference=top
	12)	Field MV horiz coordinate for current=bottom, reference=bottom
	13)	Field MV vert coordinate for current=bottom, reference=bottom
	14)	Upper left 8x8 block MV horiz coordinate
	15)	Upper left 8x8 block MV vert coordinate
	16)	Upper right 8x8 block MV horiz coordinate
	17)	Upper right 8x8 block MV vert coordinate
	18)	Lower left 8x8 block MV horiz coordinate
	19)	Lower left 8x8 block MV vert coordinate
	20)	Lower right 8x8 block MV horiz coordinate
	21)	Lower right 8x8 block MV vert coordinate

For B-VOPs, there are 20 integers per macroblock line:
	 1)	16x16 forward MV horiz coordinate
	 2)	16x16 forward MV vert coordinate
	 3)	Forward fld MV horiz coord for current=top, reference=top
	 4)	Forward fld MV vert coord for current=top, reference=top
	 5)	Forward fld MV horiz coord for current=top, reference=bottom
	 6)	Forward fld MV vert coord for current=top, reference=bottom
	 7)	Forward fld MV horiz coord for current=bottom, reference=top
	 8)	Forward fld MV vert coord for current=bottom, reference=top
	 9)	Forward fld MV horiz coord for current=bottom, reference=bottom
	10)	Forward fld MV vert coord for current=bottom, reference=bottom
	11)	16x16 backward MV horiz coordinate
	12)	16x16 backward MV vert coordinate
	13)	Backward fld MV horiz coord for current=top, reference=top
	14)	Backward fld MV vert coord for current=top, reference=top
	15)	Backward fld MV horiz coord for current=top, reference=bottom
	16)	Backward fld MV vert coord for current=top, reference=bottom
	17)	Backward fld MV horiz coord for current=bottom, reference=top
	18)	Backward fld MV vert coord for current=bottom, reference=top
	19)	Backward fld MV horiz coord for current=bottom, reference=bottom
	20)	Backward fld MV vert coord for current=bottom, reference=bottom


3) Testing
----------

All testing of V0.6 occurred under Microsoft Window NT 4.0 using Visual C++ 4.2.
The 6 standard test sequences used for core experiment P-14 were used as the
input.  Bitstream exchange between the Microsoft and MoMuSys VMs produced the
following results.

                                                Enc=MS      Enc=MO
     Sequence       Frame size/rate    Frames   Dec=MO      Dec=MO

     Basketball     720x576/25/2:1      250     0.000010   0.000010 
     Bus            720x480/30/2:1      150     0.000005   0.000005
     Cheerleaders   720x480/30/2:1      150     0.000008   0.000010
     Fun Fair       720x480/25/2:1      250     0.000007   0.000009
     Football       720x480/30/2:1      200     0.000018   0.000016
     Stefan         720x480/30/2:1      300     0.000015   0.000013

     The last two columns show the comparison result of the 4:2:0 video files
     when (1) Microsoft encoded and MoMuSys decoded and (2) MoMuSys encoded
     and Microsoft decode.  The number given is the fraction of the the total
     number of bytes (components of a pixel) which were not equal.  All error
     are +/- 1 pixel unit only.

The following funtions have been tested (1) OBMC, (2) MPEG and H.263 quantization,
(3) GOVs, (4) Advanced prediction, (5) rate control (MoMuSys only), (6) different
VOP patterns.  All testing has been done with only one VOL.

4) Limitations
--------------

For MPEG-4 version 1, interlaced coding has no specified interaction with the following
tools:

        (a)  Shape Coding
        (b)  Error Resilience
        (c)  Scalability (spatial or temporal)
        (d)  Multi-VO composition between interlaced and progressive video

The major remaining integration problem is to unify the two implementation of direct mode
(the original Microsoft direct mode is used for progressive video and a separate implementation
is used for interlaced video).  For a progressive macroblock only one implementation should
exist (we ran out of time!).

Only the interlaced video functions have been tested.  All other integrators should re-test the
functions they are familiar with.  The authors appologize in advance for any thing that may
have been broken.....
 
