5.8.6.14.4 Input/Output Pixel Alignment
Depending on application requirements, output pixel alignment according to input pixels can be tuned for the horizontal and vertical scaler. This tuning modifies the position of the output image within the range of the filter length. Two different types of configuration fields are used, Filter Taps Shift and Filter Init Phase Offset. Each of them produces a filter spatial response shift as described below.
Filter taps shift (Tshift) determines which set of input pixels is used at filter input to process a given output pixel. The following equation shows how the output pixel is calculated through the filter:
With :
Pin—input pixel component value (any R, G or B in RGB)
N—the filter number of taps (N=SCALER_FILT_NUM_PHASES)
Tshift—Filter taps shift
h(k,p)—Filter taps value depending on tap number k, and phase index p
Pout—output pixel component value (R, G or B in RGB mode)
The output image is shifted by the value Tshift/FACT, with FACT=HFACT for horizontal scaling and FACT=VFACT for vertical scaling. The following figures illustrate a use case of upsampling by 4 (VFACT=0.25x220):
Filter taps shift (Tshift) is controlled by ISC_HXS_CFG.FILTCFG for the horizontal scaler, and ISC_VXS_CFG.FILTCFG for the vertical scaler.
During the resampling process, a filter tap phase is selected for each output pixel, representing the fractional part of the output pixel spatial position, according to the input pixel width. An input pixel width is subsampled in values of 16 phases, each phase p corresponding to a subset of filter taps. Phase 0 corresponds to 0 fractional shift. Incrementing the phase index by 1 corresponds to a spatial shift of 1/16 pixel width.
The following figures illustrate a use case of upsampling by 4 (four output pixels for one input pixel), with a fixed Tshift value.
A phase offset adds a fractional shift to all pixels of the frame. This is illustrated in the figures below for the use case when upsizing by 4.
The initial phase offset is controlled by ISC_HXS_CFG.OFFSET for the horizontal scaler, and ISC_VXS_CFG.OFFSET for the vertical scaler.