Fusion 878A
2.0 Functional Description
PCI Video Decoder
2.4 Video Scaling, Cropping, and Temporal Decimation
100600B
Conexant
2-15
The following C-code fragment illustrates changing the vertical scaling value:
#define VSCALE_HI 0x13
#define VSCALE_LO 0x14
typedef unsigned char BYTE;
typedef unsigned int WORD;
BYTE ReadFromFusion878A(BYTE regAddress);
void WriteToFusion878A(BYTE regAddress, BYTE regValue);
void SetFusion878AVScaling(WORD VSCALE)
{
BYTE oldVscaleMSByte, newVscaleMSByte;
/* get existing VscaleMSByte value from */
/* Fusion878A VSCALE_HI register */
oldVscaleMSByte = ReadFromFusion878A(VSCALE_HI);
/* create a new VscaleMSByte, preserving top 3 bits */
newVscaleMSByte = (oldVscaleMSByte & 0xE0)|(VSCALE >>
8);
/* send the new VscaleMSByte to the VSCALE_HI reg */
WriteToFusion878A(VSCALE_HI, newVscaleMSByte);
/* send the new VscaleLSByte to the VSCALE_LO reg */
WriteToFusion878A(VSCALE_LO, (BYTE) VSCALE);
}
If your target machine has sufficient memory to statically store the scaling
values locally, the READ operation can be eliminated.
NOTE:
When scaling below CIF resolution, it may be useful to use a single field
as opposed to using both fields. Using a single field will ensure there are
no inter-field motion artifacts on the scaled output. When performing
single field scaling, the vertical scaling ratio will be twice as large as when
scaling with both fields. For example, CIF scaling from one field does not
require any vertical scaling, but when scaling from both fields, the scaling
ratio is 50%. Also, the non-interlaced bit should be reset when scaling
from a single field (INT=0 in the VSCALE_HI register).
lists scaling ratios for various video formats and the register values
required.
where:
&
= bitwise AND
|
= bitwise OR
>>
= bit shift, MSB to LSB