06-27-2018 12:41 AM - edited 06-27-2018 01:03 AM
Introduction
This Video Beginner Series 9 is an introduction to YUV/YCbCr color spaces and how to convert video data from/to YUV/YCbCr on Xilinx devices.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Summary
2. Converting YUV/YCbCr from/to RGB on Xilinx devices
3. Tutorial - Converting video data from YUV to RGB color space
06-27-2018 12:44 AM
YUV and YCbCr color space
A color space is a way to represent colors. In a computer you will often talk about RGB (for Red Green Blue). This is easy to visualize for human brain as it is like when you play with paint. If you mix some Red pain with some blue pain, you will get a Violet color (it is called additive colors).
This is the same for a pixel in the RGB color space. If its blue and red components have a high value while its green component is low, the pixel will be violet.
First televisions were in Black and White (B&W). When the first color television arrived it needed to be compatible with B&W TV infrastructure while being able to get color information. The B&W system used only the luminance information (represented Y). The color information (called chrominance and represented by U and V) was added on top of it.
YCbCr is a scaled and offset version of the YUV color space. Y also represent the luminance and Cb and Cr represent the choma components containing the color information.
There are different standard defining YCbCr as per example ITU-R BT601, ITU-R BT709 or ITU-R BT.2020
06-27-2018 12:47 AM
Converting YUV/YCbCr from/to RGB on Xilinx devices
Xilinx IP catalog contains 3 IPs (dedicated) to convert YUV/YCbCr data from/to the RGB.
The recommendation is to use the Video Processing Subsystem (VPSS) IP. The documentation for the VPSS can be found in PG231. One thing to note is that the VPSS IP requires the use of a processor (Zynq or MicroBlaze) to be programmed through an AXI4-Lite.
For design without processor, a solution is to use the logiCORE RGB to YCrCb Color‐Space Converter IP (documented in PG013) or the logiCORE YCrCb to RGB Color‐Space Converter IP (documented in PG014).
On an AXI4-Stream Interface connecting a Xilinx Video IP (as defined by UG934), the Y component is mapped on the LSB, followed by the Cb component and then the Cr component
06-27-2018 12:57 AM - edited 06-27-2018 12:58 AM
Tutorial - Converting video data from YUV to RGB color space
Note 1: This tutorial is intended to be used only with Vivado 2018.1 and only in simulation
Note 2: A valid license for the Test Pattern Generator is required to build the design.
//Set TPG output color space
master_agent.AXI4LITE_WRITE_BURST(TPG_COLOR_FORMAT_REG,0,TPG_RGB_OUT,resp);
Change line 185 to:
master_agent.AXI4LITE_WRITE_BURST(TPG_COLOR_FORMAT_REG,0,TPG_YUV_OUT,resp);
Note: The reason why we select RGB is because GIMP thinks our input is RGB. The Decompose will with RGB settings (if input is RGB) will only split the image into 3 different images (1 for each component).
06-27-2018 01:00 AM - edited 06-27-2018 01:04 AM
What Next?