Table of Contents |
Internal operation: Code structure
Without describing the overlay classes in detail, a number of design issues should be discussed.
Firstly, consideration of the various chroma formats was important. The number of chroma samples relative to the number of luma samples varies across different formats. Two scaling factors are set to the ratio of luma to chroma samples horizontally and vertically. These allow format independent components, such as the colour legend, to be displayed correctly, irrespective of format.
Motion vectors for each frame vary in size due to the frame displacement between the current and reference frames. In other words, motion vectors include a temporal frame difference as well as a spatial frame difference. To normalise the display of motion vectors from frame to frame, a scaling factor is set to the separation between the current and reference frames. Motion vectors are then scaled by this factor.
Colour legends and frame information are displayed on the left-hand edge of the picture. It may be necessary to add padding to the picture during compression in order for the frame dimensions to equal an integer number of macroblocks (refer to the algorithm documentation). This is required due to the 4 level wavelet decomposition used. It is therefore difficult to gaurantee the location of the right-hand edge of the picture in the picture data arrays.