SPRUJ28E November 2021 – September 2024 AM68 , AM68A , TDA4AL-Q1 , TDA4VE-Q1 , TDA4VL-Q1
Only VID pipeline includes a resizer unit (scaler). The VIDL pipeline does not include a scaler.
The programmable scaler filter works with all supported video formats, including formats with alpha channel. The alpha channel is scaled with the same parameters as the RGB color components. For the YUV formats, Y and Cb/Cr are processed independently. A RGB 64-bit source (16 bits per component) is truncated to 8-bit/compontent, if the scaler is enabled. Otherwise, it will be truncated to ARGB48 format in the scaler bypass mode. A 10-bit/12-bit YUV source is also truncated to 8-bit, since the scaler is enabled to either upsample the chroma component and/or resize the YUV frame data directly (for memory-to-memory operation with YUV format as the memory destination type).
The filter is based on a finite impulse response (FIR) filter with 16 phases. The filter is a 5-tap for horizontal filtering, and can be configured for 3 or 5 taps for vertical filtering. The filtering can be used for various processing:
The following limitations must be considered:
The user must set the correct size and position of the original video before resize in order for the up-sampled/down-sampled video to be displayed inside the screen boundaries.
Figure 12-339 shows an example of video up-sampling, with corresponding video window attributes.
The video window attributes can be configured in the following register bit-fields:
For vertical up-sampling and down-sampling in a 3-tap configuration, the equations are:
For vertical and horizontal up-sampling and down-sampling in a 5-tap configuration, the equations are:
The pixel (n + 1) is the previous pixel with respect to pixel (n). The line (n + 1) is the previous line with respect to line (n).
The coefficients Ci() depend on the phase between input and output pixels.
The coefficients are different for Y and Cr/Cb filtering because the calculations are independent due to the chrominance resampling for YUV422 and YUV420.
First, the vertical filter is applied to the encoded input pixel data, and then the horizontal filter is applied on the resulting pixel values to generate the output pixel values. The vertical input of the filter consists of:
Table 12-340 lists some of the scaler supported configurations.
Pixel Format | Maximum Input Width (Pixels) for 5-tap | Maximum Input Width (Pixels) for 3-tap |
---|---|---|
32 bits per pixel (ARGB32-8888, ARGB-2101010, etc.) | 2048 pixels wide (1) | 4096 pixels wide |
YUV420, YUV422 | 4096 pixels wide | 4096 pixels wide |
At the beginning of frame scaling processing, the first line may be duplicated multiple times depending on the initial vertical phase programmed for the poly-phase filter.
At the end of frame scaling processing the last line is duplicated, if the scaling logic requires loading more lines and the last line has been reached.
Similarly, the first pixel may be duplicated multiple times depending on the initial horizontal phase programmed for the poly-phase filter. The last pixel is duplicated, if the scaling logic requires loading more pixels and the last pixel has been reached.
The programmable coefficients of the polyphase filters are signed 10-bit values (except for the central coefficient, which is unsigned). The vertical video scaler has an 10-bit input and a 12-bit output. The horizontal scaling stage takes the resulting 12-bit input and produces 12-bit output.
Figure 12-340 and Figure 12-341 show the scaler macro-architecture for components A, R, G, and B. Figure 12-342 and Figure 12-343 show the scaler macro-architecture for components Y, Cr, and Cb.
The scaling and CSC clipping is set by the same bit, DSS0_VID_ATTRIBUTES[11] FULLRANGE.
Table 12-341 list the register fields in the function of the coefficients for the VID horizontal scaler in the DSS0_VID_FIR_COEF_H0_0 to DSS0_VID_FIR_COEF_H0_8, and DSS0_VID_FIR_COEF_H12_0 to DSS0_VID_FIR_COEF_H12_15 registers.
Phases | Ch(2) | Ch(1) | Ch(0) | Ch(-1) | Ch(-2) |
---|---|---|---|---|---|
Signed coefficient [29-20] FIRHC2 bitfield | Signed coefficient [19-10] FIRHC1 bitfield | Unsigned central coefficient [9-0] FIRHC0 bitfield | Signed coefifcient [19-10] FIRHC1 bitfield | Signed coefficient [29-20] FIRHC2 bitfield | |
0 | DSS0_VID_FIR_COEF_H12_0 | DSS0_VID_FIR_COEF_H12_0 | DSS0_VID_FIR_COEF_H0_0 | DSS0_VID_FIR_COEF_H12_0 | DSS0_VID_FIR_COEF_H12_0 |
1 | DSS0_VID_FIR_COEF_H12_1 | DSS0_VID_FIR_COEF_H12_1 | DSS0_VID_FIR_COEF_H0_1 | DSS0_VID_FIR_COEF_H12_15 | DSS0_VID_FIR_COEF_H12_15 |
2 | DSS0_VID_FIR_COEF_H12_2 | DSS0_VID_FIR_COEF_H12_2 | DSS0_VID_FIR_COEF_H0_2 | DSS0_VID_FIR_COEF_H12_14 | DSS0_VID_FIR_COEF_H12_14 |
3 | DSS0_VID_FIR_COEF_H12_3 | DSS0_VID_FIR_COEF_H12_3 | DSS0_VID_FIR_COEF_H0_3 | DSS0_VID_FIR_COEF_H12_13 | DSS0_VID_FIR_COEF_H12_13 |
4 | DSS0_VID_FIR_COEF_H12_4 | DSS0_VID_FIR_COEF_H12_4 | DSS0_VID_FIR_COEF_H0_4 | DSS0_VID_FIR_COEF_H12_12 | DSS0_VID_FIR_COEF_H12_12 |
5 | DSS0_VID_FIR_COEF_H12_5 | DSS0_VID_FIR_COEF_H12_5 | DSS0_VID_FIR_COEF_H0_5 | DSS0_VID_FIR_COEF_H12_11 | DSS0_VID_FIR_COEF_H12_11 |
6 | DSS0_VID_FIR_COEF_H12_6 | DSS0_VID_FIR_COEF_H12_6 | DSS0_VID_FIR_COEF_H0_6 | DSS0_VID_FIR_COEF_H12_10 | DSS0_VID_FIR_COEF_H12_10 |
7 | DSS0_VID_FIR_COEF_H12_7 | DSS0_VID_FIR_COEF_H12_7 | DSS0_VID_FIR_COEF_H0_7 | DSS0_VID_FIR_COEF_H12_9 | DSS0_VID_FIR_COEF_H12_9 |
8 | DSS0_VID_FIR_COEF_H12_8 | DSS0_VID_FIR_COEF_H12_8 | DSS0_VID_FIR_COEF_H0_8 | DSS0_VID_FIR_COEF_H12_8 | DSS0_VID_FIR_COEF_H12_8 |
9 | DSS0_VID_FIR_COEF_H12_9 | DSS0_VID_FIR_COEF_H12_9 | DSS0_VID_FIR_COEF_H0_7 | DSS0_VID_FIR_COEF_H12_7 | DSS0_VID_FIR_COEF_H12_7 |
10 | DSS0_VID_FIR_COEF_H12_10 | DSS0_VID_FIR_COEF_H12_10 | DSS0_VID_FIR_COEF_H0_6 | DSS0_VID_FIR_COEF_H12_6 | DSS0_VID_FIR_COEF_H12_6 |
11 | DSS0_VID_FIR_COEF_H12_11 | DSS0_VID_FIR_COEF_H12_11 | DSS0_VID_FIR_COEF_H0_5 | DSS0_VID_FIR_COEF_H12_5 | DSS0_VID_FIR_COEF_H12_5 |
12 | DSS0_VID_FIR_COEF_H12_12 | DSS0_VID_FIR_COEF_H12_12 | DSS0_VID_FIR_COEF_H0_4 | DSS0_VID_FIR_COEF_H12_4 | DSS0_VID_FIR_COEF_H12_4 |
13 | DSS0_VID_FIR_COEF_H12_13 | DSS0_VID_FIR_COEF_H12_13 | DSS0_VID_FIR_COEF_H0_3 | DSS0_VID_FIR_COEF_H12_3 | DSS0_VID_FIR_COEF_H12_3 |
14 | DSS0_VID_FIR_COEF_H12_14 | DSS0_VID_FIR_COEF_H12_14 | DSS0_VID_FIR_COEF_H0_2 | DSS0_VID_FIR_COEF_H12_2 | DSS0_VID_FIR_COEF_H12_2 |
15 | DSS0_VID_FIR_COEF_H12_15 | DSS0_VID_FIR_COEF_H12_15 | DSS0_VID_FIR_COEF_H0_1 | DSS0_VID_FIR_COEF_H12_1 | DSS0_VID_FIR_COEF_H12_1 |
In Table 12-341, the cells without color are duplicated from the grey cells.
Similar table approach applies to the vertical scaler (registers DSS0_VID_FIR_COEF_V0_0 to DSS0_VID_FIR_COEF_V0_8, and DSS0_VID_FIR_COEF_V12_0 to DSS0_VID_FIR_COEF_V12_15 are used).
Similar table approach applies to the coefficients for Cb/Cr filtering in case of YUV format (registers DSS0_VID_FIR_COEF_H0_C_0 to DSS0_VID_FIR_COEF_H0_C_8, and DSS0_VID_FIR_COEF_H12_C_0 to DSS0_VID_FIR_COEF_H12_C_15, and DSS0_VID_FIR_COEF_V0_C_0 to DSS0_VID_FIR_COEF_V0_C_8 and DSS0_VID_FIR_COEF_V12_C_0 to DSS0_VID_FIR_COEF_V12_C_15 are used) .
The VID scaler unit vertical and/or horizontal sampling is selected by configuring the DSS0_VID_ATTRIBUTES[8-7] RESIZEENABLE bit field.
Prior to enabling the video up/down-sampling block a valid configuration has to be set by the user. After configuring the required VID registers change the DSS0_VP_CONTROL[5] GOBIT register bit of the video port the video pipeline is associated with. The software has to wait before setting the GO bit that the hardware has reset the bit. The software reset is not recommended since the application cannot guarantee to be able to reset it before the HW.
The following fields define the configuration of the video up-sampling/down-sampling block in the VID pipeline for ARGB and YUV formats:
Table 12-342 lists the scaler vertical and horizonatal accumulator values and phases.
Accumulator Value (MSB bits) | Phases f |
---|---|
0 | 0 |
256 or -3840 | 1 |
512 or -3584 | 2 |
768 or -3328 | 3 |
1024 or -3072 | 4 |
1280 or -2816 | 5 |
1536 or -2560 | 6 |
1792 or -2304 | 7 |
2048 or -2048 | 8 |
2304 or -1792 | 9 |
2560 or -1536 | 10 |
2816 or -1280 | 11 |
3072 or -1024 | 12 |
3328 or -768 | 13 |
3584 or -512 | 14 |
3840 or -256 | 15 |
The YUV filtering is based on the equations of the ARGB filtering. In addition to the registers used for ARGB filtering configuration, a second set of registers for filtering is used. The first set of registers is used for Y configuration (instead of ARGB configuration) and the second set of registers is used for CbCr filtering configuration. The two sets of registers can be the same when the YUV format is not converted to RGB after filtering. When the RGB conversion is required after filtering, then the chrominance needs to be re-sampled with a different filtering configuration because: