To de-interlace, the resizer is first told that the input frame is 724 pixels
wide, not the real width of 720 pixels. That's because to implement exactly
1:1 scaling, the DM6446 processor's horizontal input size must be adjusted to
720 + a delta, which is calculated by equations in the resizer.
Then the resizer is told the pitch is twice as wide as it really is so that
it accepts the first two horizontal scan lines as if they were one. This allows
the resizer to perform horizontal 1:1 scaling on even rows (on
the top left in Figure 4) and discard the odd rows (on
the top right). The input and output vertical size is set to 244 and 480,
respectively, so the resizer performs 1:2 up-scaling vertically to interpolate
the discarded odd rows.
The resizer is then told that the width of the output frame is 720 pixels and
the output pitch is 1440 [720 + (360 2)] bytes, resulting in an output frame
(Fig. 4, again).
To include the conversion from 4:2:2 to 4:2:0, so that a progressive encoder
can use the data, the resizer is called three times for each input frame in
the 4:2:2 interleaved format to generate de-interlaced 4:2:0 frames. Three sets
of configuration parameters must be maintained, one each for the U, Y and V
values. Hence, the three calls to the resizer.
The starting point is the input frame (in NTSC SD resolution) in UYVY 4:2:2
format. The output frame is defined as in 4CIF resolution (704 by 480) instead
of NTSC SD resolution (720 by 480). The right 16 columns in the input frame
must be discarded due to the 32-byte output alignment limitation of the resizer.
Alternately, eight columns from the right and eight columns from the left could
have been cropped.
The first call extracts the Y components in the input frame and de-interlaces
them. De-interlacing operation should only be applied to Y components by instructing
the resizer to treat the input frame as an image in 4:2:0 planar format (Fig.
5). The resizer is also instructed to perform 2:1 scaling horizontally to
extract every other Y component in the input frame, and 1:2 scaling vertically
to interpolate the discarded Y components in the odd rows
The second call to the resizer modifies the U components, which need to be
further vertically down-sampled by a ratio of 2:1. The de-interlacing operation
isn't necessary because the down-sampling involves discarding all of the odd
rows, which automatically generates progressive U buffers. To perform vertical
downscaling, the vertical input size is set to 484 and the output size set to
240.
The operation on V components is similar to that on U components. Operationally,
this requires setting some of the resizer filter coefficients differently, but
this level of detail is beyond the scope of this article.
A resizing engine can be used to implement the preprocessing of video that
calls for de-interlacing and YUV format conversions prior to encoding by video-compression
codecs. Due to several factors, including the video codec's tendency to remove
high-frequency components, video quality after compression is taken into account.
This technique isn't suitable for all applications, however, and care must be
taken to ensure that the output quality is acceptable for the application.