43.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:

P o u t ( m ) = k = 0 N 1 P i n ( n + N 1 k T s h i f t ) × h ( k , p )

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):

Figure 43-29. Filter Taps Shift
Figure 43-30. Filter Taps Shift Results for Different Horizontal Tshift Values (Upsampling by 4)
Figure 43-31. Filter Taps Shift Results for Different Vertical Tshift Values (Upsampling by 4)

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.

Figure 43-32. Filter Phase Index (Tshift = 3)

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.

Figure 43-33. Horizontal Initial Phase Offset On Upsizing by 4
Figure 43-34. Vertical Initial Phase Offset on 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.