Video and Vision Processing Suite Intel® FPGA IP User Guide

ID 683329
Date 12/12/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents
1. About the Video and Vision Processing Suite 2. Getting Started with the Video and Vision Processing IPs 3. Video and Vision Processing IPs Functional Description 4. Video and Vision Processing IP Interfaces 5. Video and Vision Processing IP Registers 6. Video and Vision Processing IPs Software Programming Model 7. Protocol Converter Intel® FPGA IP 8. 3D LUT Intel® FPGA IP 9. AXI-Stream Broadcaster Intel® FPGA IP 10. Chroma Key Intel® FPGA IP 11. Chroma Resampler Intel® FPGA IP 12. Clipper Intel® FPGA IP 13. Clocked Video Input Intel® FPGA IP 14. Clocked Video to Full-Raster Converter Intel® FPGA IP 15. Clocked Video Output Intel® FPGA IP 16. Color Space Converter Intel® FPGA IP 17. Deinterlacer Intel® FPGA IP 18. FIR Filter Intel® FPGA IP 19. Frame Cleaner Intel® FPGA IP 20. Full-Raster to Clocked Video Converter Intel® FPGA IP 21. Full-Raster to Streaming Converter Intel® FPGA IP 22. Genlock Controller Intel® FPGA IP 23. Generic Crosspoint Intel® FPGA IP 24. Genlock Signal Router Intel® FPGA IP 25. Guard Bands Intel® FPGA IP 26. Interlacer Intel® FPGA IP 27. Mixer Intel® FPGA IP 28. Pixels in Parallel Converter Intel® FPGA IP 29. Scaler Intel® FPGA IP 30. Stream Cleaner Intel® FPGA IP 31. Switch Intel® FPGA IP 32. Tone Mapping Operator Intel® FPGA IP 33. Test Pattern Generator Intel® FPGA IP 34. Video Frame Buffer Intel® FPGA IP 35. Video Streaming FIFO Intel® FPGA IP 36. Video Timing Generator Intel® FPGA IP 37. Warp Intel® FPGA IP 38. Design Security 39. Document Revision History for Video and Vision Processing Suite User Guide

11.3. Chroma Resampler IP Functional Description

Chroma resampler algorithms

The chroma resampler implements four basic resampling operations:

  • Horizontal upsampling: 4:2:2 -> 4:4:4
  • Horizontal downsampling: 4:4:4 -> 4:2:2
  • Vertical upsampling: 4:2:0 -> 4:2:2
  • Vertical downsampling: 4:2:2 -> 4:2:0

For conversions between 4:4:4 and 4:2:0 the relevant horizontal and vertical sampling operations chain automatically to achieve the correct end result. The chroma resampler supports three different algorithms for each resampling operation; nearest neighbor, bilinear and filtered. The three algorithms vary in the level of visual quality provided, the chroma siting, and the resources for implementation.

Nearest Neighbor

Nearest neighbor is the lowest quality resampling algorithm, with the lowest device resource usage. For horizontal downsampling (4:4:4 -> 4:2:2) it drops every other Cb and Cr sample within the video line. For horizontal upsampling (4:2:2 -> 4:4:4) it repeats each Cb and Cr sample. The nearest neighbor algorithm uses left siting (co-siting) for the 4:2:2 chroma samples – both the Cb and Cr samples from the even indexed Y samples are retained during downsampling.

Figure 20. Nearest Neighbor

The nearest neighbor algorithm works in the same way for vertical resampling. For vertical downsampling (4:2:2 -> 4:2:0) the IP discards the chroma data from every other video line. For upsampling (4:2:0 -> 4:2:2) the IP repeats the chroma data for two lines of luma data. The nearest neighbor algorithm uses top siting (cositing) for both the Cb and Cr planes. The IP preserves chroma data from lines 0, 2, 4, etc in downsampling. The IP discards the data from lines 1, 3, 5, etc.

Figure 21. Nearest Neighbor
Bilinear

The bilinear algorithm offers a midpoint between visual image quality and device resource cost. The figure and equations show how the IP calculates the bilinear resampled chroma for horizontal upsampling (4:2:4 -> 4:4:4) and downsampling (4:4:4 -> 4:2:2). The bilinear algorithm uses center chroma siting for both the Cb and Cr samples in 4:2:2 format.

Figure 22. Bilinear

The bilinear algorithm works in the same way for vertical upsampling (4:2:0 -> 4:2:2) and downsampling (4:2:2 -> 4:2:0), using center siting for the chroma samples just as with the horizontal resampling.

Filtered

The filtered algorithm is the most computationally expensive and device resource intense algorithm, but it offers increased visual quality. You can parameterize the filtered algorithm to use either left or center horizontal siting of the chroma data, and top or center vertical siting of the chroma data.

For downsampling conversions (4:2:2 -> 4:2:0 and 4:4:4 -> 4:2:2) the filtered algorithm applies an 8-tap Lanczos2 resampling filter to generate the downsampled data. The IP applies different phase shifts to the Lanczos2 function when generating the coefficients. It depends on the siting and whether the pixel index is even or odd. For top and left chroma siting, the IP applies phase shifts of 0 and 0.5 pixels to the Lanczos2 coefficients for the even and odd indexed chroma samples respectively. For center chroma siting the phases shifts are -0.25 and +0.25 pixels.

For upsampling conversions (4:2:0 -> 4:2:2 and 4:2:2 -> 4:4:4) the filtered algorithm applies a 4-tap Lanczos2 resampling filter to generate the upsampled data. For top/left chroma siting, phase shifts of 0 and 0.5 pixels are applied to the Lanczos2 coefficients for the even and odd indexed chroma samples respectively. For center chroma siting the phases shifts are -0.25 and +0.25 pixels.

You can also turn on luma adaption for upsampling conversions. This feature further increases device resource usage but may reduce color bleed around edges when compared to the default filtered algorithm. The feature is the only chroma resampler to implement some logic in DSP blocks. When you turn on luma adaption, the IP compares differences between successive luma samples to an edge threshold to detect significant edges. In areas where the IP detects edges, you can shift the phase of the Lanczos-2 filter by up to 0.25 pixels to the left or right. This shift weights the resulting chroma samples more intensely towards the more appropriate side of the edge.

Color planes per pixel

Most Video and Vision Processing IPs allow you to select the number of color planes per pixel, but the chroma resampler does not have that parameter and sets the value automatically. The number of color planes per pixel is a function of the chroma resampling conversions that you select, which determine the chroma sampling formats that are supported at the input and output interfaces. 4:4:4 and 4:2:0 chroma samplings both require three color panes per pixel. 4:2:2 only requires 2 color planes. 4:2:2 can be transmitted through a link with 3 color planes, with the planes in the most significant bits of each pixel unused.

If you select any of the following chroma sampling conversions, the input interface uses three color planes per pixel, otherwise it uses two color planes:

  • 4:2:0 passthrough
  • 4:2:0 to 4:4:4
  • 4:2:0 to 4:2:2
  • 4:4:4 passthrough
  • 4:4:4 to 4:2:2
  • 4:4:4 to 4:2:0

If you select any of the following chroma sampling conversions, the output interface uses three color planes per pixel, otherwise it uses two color planes:

  • 4:2:0 passthrough
  • 4:2:0 to 4:4:4
  • 4:4:4 passthrough
  • 4:4:4 to 4:2:0
  • 4:2:2 to 4:4:4
  • 4:2:2 to 4:2:0