UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Moderator
Moderator
1,638 Views
Registered: ‎11-09-2015

Video Beginner Series 10: YCbCr Chroma subsampling/resampling

Introduction

 

This Video Beginner Series 10 gives an introduction of YCbCr Chroma subsampling and resampling.

 

1.png

 

 

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Summary

 

1. Chroma Subsampling

2. Tutorial - YCbCr Chroma Subsampling in Vivado

3. What next?

 

 


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
3 Replies
Moderator
Moderator
1,631 Views
Registered: ‎11-09-2015

Video Beginner Series 10 - Chroma Subsampling

Chroma Subsampling

 

What is Chroma subsampling

 

Chroma subsampling is a practice of encoding an image reducing the number of Chroma samples in the image (while all the luminance samples are kept). Because the human visual system is more sensitive to variation in brightness than color, the subsampling results in almost no visual difference for a human eye.

 

Common YCbCr color format using Chroma subsampling are YCbCR422 and YCbCr420. Note that YCbCr without Chroma subsampling can be called YCbCr444.

 

Chroma resampling is the practice of re-creating the missing Chroma information.

 

 

YCbCr422

 

In YCbCr422, the Chroma information are sampled at half the sample rate of the luminance information. This means that for each two horizontal Y samples, there is only one Cb and one Cr samples.

On the AXI4-Stream interface, one Chroma information is sent for every pixel, alternating the Cb and Cr component.

 

  • Line 0, pixel 0

 2.PNG

 

  • Line 0, pixel 1

 3.PNG

 

YCbCr420

 

In YCbCr420, as in YCbCR422, the Chroma information are sampled at half the sample rate of the luminance information. But the Chroma information is also sampled vertically.

 

On the AXI4-Stream interface, one Chroma information is sent for every pixel, alternating the Cb and Cr component, only on even lines.

 

  • Line 0, pixel 0

4.PNG 

 

  • Line 0, pixel 1

5.PNG 

 

  • Line 1, pixel 0

6.PNG 

 

  • Line 1, pixel 1

7.PNG

 

 


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
Moderator
Moderator
1,621 Views
Registered: ‎11-09-2015

Video Beginner Series 10 - Tutorial - YCbCr Chroma Subsampling in Vivado

Tutorial - YCbCr Chroma Subsampling in Vivado

 

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.

 

Build the Vivado project

 

  1. Download the tutorial files and unzip the folder

  2. Open Vivado 2018.1

  3. In the tcl console, cd into the unzipped directory (cd <path>/XVES_0010)

  4. In the tcl console, source the script tcl (source ./create_proj.tcl)

 

Add a Chroma Resampler IP

 

  1. Open the BD design.

  2. Delete the wire between the AXI4_Stream_out output and the TPG

  3. Right-click on the BD and click Add IP…. Search for chroma resampler and press ENTER

 8.png

 

  1. Double click on the Chroma Resampler IP to open its configuration GUI. Change the following parameters:
  • Pixels Per Scanline: 640
  • Scanlines per Frame: 400
  • Resampling From: YCbCr444
  • Resampling To: YCbCr422

 9.png

 

 

  1. Connect the video_in input to the TPG m_axis_video output and the video_out to the BD AXI4_Stream_out output

  2. Connect aclk and aresetn to the ports aclk_50MHz and aresetn_0
    10.png

  3. Validate the BD by clicking on  11.png

  4. Generate the BD output products by right clicking on the BD in the sources window and clicking Generate Output Products…
    12.png

 

Analyze the YCbCr444 to YCbCr422 subsampling in simulation

 

  1. Launch the behavioral simulation and run it for 1ms.

  2. At simulation time 1.43us we can see that the TPG starts outputting video and at simulation time 1.57us the Chroma Resampler starts outputting the YCbCr422 subsampled video

 13.png

 

  1. On the output from the Chroma Resampler, compared with the output from the TPG, we can see the alternation of the Cb and Cr Chroma samples (bits [15:8]) while the Y samples (bits [7:0]) are the same as on the TPG output

  2. Close the simulation

 

Analyze the YCbCr444 to YCbCr420 subsampling in simulation

  1. Open the block design

  2. Double click on the Chroma Resampler IP to open its configuration GUI. Change the output format to YCbCr420

 14.png

  1. Validate and save the Block Design

  2. Generate the output products for the block design

  3. Launch the behavioral simulation and run it for 1ms.

  4. At simulation time 1.43us we can see that the TPG starts outputting video and at simulation time 1.65us the Chroma Resampler starts outputting the YCbCr420 subsampled video

  5. The data outputted by the Chroma Resampler look similar to the previous simulation, with output in YCbCr422.

  6. However, if we go to the second line (starting at simulation time 14.59us, after 1st tlast) we can see that the MSB bits ([15:8]) of the tdata output have now a value of 0 for every pixel of the line meaning that there is no Chroma information sent in the line which is expected with YcbCr420 output.

  7. Close the simulation



Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
Moderator
Moderator
1,619 Views
Registered: ‎11-09-2015

Video Beginner Series 10 - What Next?

What Next?

 

 

  • You liked this Video Series?
    • You can give Kudos using the Kudos button  kudos.PNG
    • Make sure you are following the Xilinx Video Series topic to be informed when an new topic is published (Go to the Xilinx Video Series topic > Options > Subscribe)

subscribe.PNG


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**