- •Contents
- •1. Video and Image Processing Suite Overview
- •Release Information
- •Device Family Support
- •Latency
- •In-System Performance and Resource Guidance
- •Stall Behavior and Error Recovery
- •2. Interfaces
- •Video Formats
- •Avalon-ST Video Protocol
- •Video Data Packets
- •Static Parameters of Video Data Packets
- •Control Data Packets
- •Ancillary Data Packets
- •User-Defined and Altera-Reserved Packets
- •Packet Propagation
- •Transmission of Avalon-ST Video Over Avalon-ST Interfaces
- •Packet Transfer Examples
- •Avalon-MM Slave Interfaces
- •Specification of the Type of Avalon-MM Slave Interfaces
- •Avalon-MM Master Interfaces
- •Specification of the Type of Avalon-MM Master Interfaces
- •Buffering of Non-Image Data Packets in Memory
- •3. Getting Started
- •IP Catalog and Parameter Editor
- •Specifying IP Core Parameters and Options
- •Installing and Licensing IP Cores
- •OpenCore Plus IP Evaluation
- •4. Clocked Video Interface IP Cores
- •Control Port
- •Clocked Video Input Format Detection
- •Interrupts
- •Clocked Video Output Video Modes
- •Interrupts
- •Generator Lock
- •Underflow and Overflow
- •Timing Constraints
- •Handling Ancillary Packets
- •Modules for Clocked Video Input II IP Core
- •Clocked Video Interface Parameter Settings
- •Clocked Video Interface Signals
- •Clocked Video Interface Control Registers
- •5. 2D FIR Filter IP Core
- •Calculation Precision
- •Coefficient Precision
- •Result to Output Data Type Conversion
- •2D FIR IP Core Parameter Settings
- •2D FIR Filter Signals
- •2D FIR Filter Control Registers
- •6. Video Mixing IP Cores
- •Alpha Blending
- •Video Mixing Parameter Settings
- •Video Mixing Signals
- •Video Mixing Control Registers
- •7. Chroma Resampler IP Core
- •Horizontal Resampling (4:2:2)
- •Vertical Resampling (4:2:0)
- •Chroma Resampler Parameter Settings
- •Chroma Resampler Signals
- •8. Video Clipping IP Cores
- •Video Clipping Parameter Settings
- •Video Clipping Signals
- •Video Clipping Control Registers
- •9. Color Plane Sequencer IP Core
- •Combining Color Patterns
- •Rearranging Color Patterns
- •Splitting and Duplicating
- •Subsampled Data
- •Color Plane Sequencer Parameter Settings
- •Color Plane Sequencer Signals
- •10. Color Space Conversion IP Cores
- •Input and Output Data Types
- •Color Space Conversion
- •Result of Output Data Type Conversion
- •Color Space Conversion Parameter Settings
- •Color Space Conversion Signals
- •Color Space Conversion Control Registers
- •11. Control Synchronizer IP Core
- •Using the Control Synchronizer IP Core
- •Control Synchronizer Parameter Settings
- •Control Synchronizer Signals
- •Control Synchronizer Control Registers
- •12. Deinterlacing IP Cores
- •Deinterlacing Methods
- •Bob with Scanline Duplication
- •Bob with Scanline Interpolation
- •Weave
- •Motion-Adaptive
- •Sobel-Based HQ Mode
- •Pass-Through Mode for Progressive Frames
- •Frame Buffering
- •Frame Rate Conversion
- •Bandwidth Requirement Calculations for 10-bit YCbCr Video
- •Behavior When Unexpected Fields are Received
- •Handling of Avalon-ST Video Control Packets
- •Deinterlacing Parameter Settings
- •Deinterlacing Signals
- •Deinterlacing Control Registers
- •Design Guidelines for Broadcast Deinterlacer IP Core
- •13. Frame Reader IP Core
- •Single-Cycle Color Patterns
- •Frame Reader Output Pattern and Memory Organization
- •Frame Reader Parameter Settings
- •Frame Reader Signals
- •Frame Reader Control Registers
- •14. Frame Buffer IP Cores
- •Double Buffering
- •Triple Buffering
- •Locked Frame Rate Conversion
- •Handling of Avalon-ST Video Control Packets
- •Color Format
- •Frame Buffer Parameter Settings
- •Frame Buffer Signals
- •Frame Buffer Control Registers
- •15. Gamma Corrector IP Core
- •Gamma Corrector Parameter Settings
- •Gamma Corrector Signals
- •Gamma Corrector Control Registers
- •16. Interlacer IP Core
- •Interlacer Parameter Settings
- •Interlacer Signals
- •Interlacer Control Registers
- •17. Scaler II IP Core
- •Nearest Neighbor Algorithm
- •Bilinear Algorithm
- •Bilinear Algorithmic Description
- •Polyphase and Bicubic Algorithm
- •Double-Buffering
- •Polyphase Algorithmic Description
- •Choosing and Loading Coefficients
- •Edge-Adaptive Scaling Algorithm
- •Scaler II Parameter Settings
- •Scaler II Signals
- •Scaler II Control Registers
- •18. Video Switching IP Cores
- •Mixer Layer Switching
- •Video Switching Parameter Settings
- •Video Switching Signals
- •Video Switching Control Registers
- •19. Test Pattern Generator IP Cores
- •Test Pattern
- •Generation of Avalon-ST Video Control Packets and Run-Time Control
- •Test Pattern Generator Parameter Settings
- •Test Pattern Generator Signals
- •Test Pattern Generator Control Registers
- •20. Trace System IP Core
- •Trace System Parameter Settings
- •Trace System Signals
- •Operating the Trace System from System Console
- •Loading the Project and Connecting to the Hardware
- •Trace Within System Console
- •TCL Shell Commands
- •21. Avalon-ST Video Monitor IP Core
- •Packet Visualization
- •Monitor Settings
- •Avalon-ST Video Monitor Parameter Settings
- •Avalon-ST Video Monitor Signals
- •Avalon-ST Video Monitor Control Registers
- •Avalon-ST Video Class Library
- •Running the Tests
- •Video File Reader Test
- •Example Test Environment
- •Video Field Life Cycle
- •Constrained Random Test
- •Complete Class Reference
- •c_av_st_video_control
- •c_av_st_video_data
- •c_av_st_video_file_io
- •c_av_st_video_item
- •c_av_st_video_source_sink_base
- •c_av_st_video_sink_bfm_’SINK
- •c_av_st_video_source_bfm_’SOURCE
- •c_av_st_video_user_packet
- •c_pixel
- •Raw Video Data Format
- •Cadence Detection and Reverse Pulldown in the Deinterlacer II IP Core
- •Document Revision History
- •How to Contact Altera
Chroma Resampler IP Core |
7 |
2015.01.23
UG-VIPSUITE |
Subscribe |
Send Feedback |
The Chroma Resampler IP core resamples video data to and from common sampling formats.
The human eye is more sensitive to brightness than tone. Taking advantage of this characteristic, video transmitted in the Y’CbCr color space often subsamples the color components (Cb and Cr) to save on data bandwidth.
The Chroma Resampler IP core allows you to change between 4:4:4, 4:2:2 and 4:2:0 sampling rates where:
•4:4:4 specifies full resolution in planes 1, 2, and 3.
•4:2:2 specifies full resolution in plane 1; half width resolution in planes 2 and 3.
•4:2:0 specifies full resolution in plane 1; half width and height resolution in planes 2 and 3.
All modes of the Chroma Resampler IP core assume the chrominance (chroma) and luminance (luma) samples are co-sited (their values are sampled at the same time).
•Horizontal resampling process supports nearest-neighbor and filtered algorithms.
•Vertical resampling process supports only the nearest-neighbor algorithm.
You can configure the Chroma Resampler IP core to change image size at run time using control packets.
Horizontal Resampling (4:2:2)
Horizontal resampling process supports nearest-neighbor and filtered algorithms.
Conversion from sampling rate 4:4:4 to 4:2:2 and back are scaling operations on the chroma channels. This means that these operations are affected by some of the same issues as the Scaler II IP core. However, because the scaling ratio is fixed as 2× up or 2× down, the Chroma Resampler IP core is highly optimized for these cases.
© 2015 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services.
www.altera.com
ISO 9001:2008 Registered
101 Innovation Drive, San Jose, CA 95134
7-2 |
4:4:4 to 4:2:2 |
UG-VIPSUITE |
|
2015.01.23 |
|||
|
|
Figure 7-1: Resampling 4.4.4 to a 4.2.2 Image
The figure below shows the location of samples in a co-sited 4:2:2 image.
= Y’
+ = Cb
+ = Cr
++ = CbCr
++ = Y’CbCr
Sample No
1
2
3
4
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
++ |
|
++ |
|
++ |
|
++ |
|
++ |
|
++ |
|
++ |
|
++ |
|
The Chroma Resampler IP core supports only the cosited form of horizontal resampling—the form for 4:2:2 data in ITU Recommendation BT.601, MPEG-2, and other standards.
Note: For more information about the ITU standard, refer to Recommendation ITU-R BT.601, Encoding Parameters of Digital Television for Studios, 1992, International Telecommunications Union, Geneva.
You can configure the Chroma Resampler IP core to change image size at run time using control packets.
4:4:4 to 4:2:2
The nearest-neighbor algorithm is the simplest way to down-scale the chroma channels. The nearestneighbor algorithm discards the Cb and Cr samples that occur on even columns (assuming the first column is numbered 1). This algorithm is very fast and cheap but, due to aliasing effects, it does not produce the best image quality.
To get the best results when down-scaling, apply a filter to remove high-frequency data and thus avoid possible aliasing. The filtered algorithm for horizontal subsampling uses a 9-tap filter with a fixed set of coefficients. The coefficients are based on a Lanczos-2 function that the Scaler II IP core uses. Their quantized form is known as the Turkowski Decimator.
4:2:2 to 4:4:4
The nearest-neighbor algorithm is the simplest way to up-scale the chroma channels. The nearestneighbor algorithm duplicates each incoming Cb and Cr sample to fill in the missing data. This algorithm is very fast and cheap, but it tends to produce sharp jagged edges in the chroma channels.
The filtered algorithm uses the same upscaling method as the Scaler II IP core—that is a four-tap filter with Lanczos-2 coefficients. Use this filter with a phase offset of 0 for the odd output columns (those with existing data) and an offset of one-half for the even columns (those without direct input data). A filter with phase offset 0 has no effect, so the function implements it as a pass-through filter. A filter with phase offset of one-half interpolates the missing values and has fixed coefficients that bit-shifts and additions implement. This algorithm performs suitable upsampling and does not use memory or multipliers. It uses more logic elements than the nearest-neighbor algorithm and is not the highest quality available.
The best image quality for upsampling is obtained by using the filtered algorithm with luma-adaptive mode enabled. This mode looks at the luma channel during interpolation and uses this to detect edges. Edges in the luma channel make appropriate phase-shifts in the interpolation coefficients for the chroma channels.
Altera Corporation |
Chroma Resampler IP Core |
|
|
Send Feedback
UG-VIPSUITE |
Vertical Resampling (4:2:0) |
7-3 |
|
2015.01.23 |
|||
|
|
Figure 7-2: 4:2:2 Data at an Edge Transition
The figure below shows 4:2:2 data at an edge transition. Without taking any account of the luma, the interpolation to produce chroma values for sample 4 would weight samples 3 and 5 equally. From the luma, you can see that sample 4 falls on an the low side of an edge, so sample 5 is more significant than sample 3.
|
CbCr Color |
|
Value |
= Y’ |
|
+ = Cb |
|
+ = Cr |
Y’ Intensity |
++ = CbCr |
|
++ = Y’CbCr |
|
++
++
++ |
++ |
1 |
2 |
3 |
4 5 |
6 |
7 |
Sample No |
++ |
|
++ |
++ |
|
++ |
The luma-adaptive mode looks for such situations and chooses how to adjust the interpolation filter. From phase 0, it can shift to -1/4, 0, or 1/4; from phase 1/2, it can shift to 1/4, 1/2, or 3/4. This makes the interpolated chroma samples line up better with edges in the luma channel and is particularly noticeable for bold synthetic edges such as text. The luma-adaptive mode does not use memory or multipliers, but requires more logic elements than the straightforward filtered algorithm.
Vertical Resampling (4:2:0)
The Chroma Resampler IP core does not distinguish interlaced data with its vertical resampling mode. It only supports the co-sited form of vertical resampling.
Figure 7-3: Resampling 4.4.4 to a 4.2.0 Image
The figure below shows the co-sited form of vertical resampling.
= Y’
+ = Cb
+ = Cr
++ = CbCr
++ = Y’CbCr
Sample No
1
2
3
4
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
++ |
|
++ |
|
++ |
|
++ |
|
++ |
|
++ |
|
++ |
|
++ |
|
For both upsampling and downsampling, the vertical resampling algorithm is fixed at nearest-neighbor. The algorithm does not use any multipliers.
•Upsampling—uses four line buffers, each buffer being half the width of the image.
•Downsampling—uses one line buffer, which is half the width of the image.
Chroma Resampler IP Core |
Altera Corporation |
|
|
Send Feedback
7-4 |
Chroma Resampler Parameter Settings |
UG-VIPSUITE |
|
2015.01.23 |
|||
|
|
Note: All input data samples must be in unsigned format. If the number of bits per pixel per color plane is N, this means that each sample consists of N bits of data which are interpreted as an unsigned binary number in the range [0, 2N–1]. All output data samples are also in the same unsigned format.
Chroma Resampler Parameter Settings
Table 7-1: Chroma Resampler Parameter Settings
Parameter |
|
|
Value |
|
Description |
|
|
|
|
|
|
Maximum width |
|
32–2600, Default = 256 |
|
Specify the maximum image width in pixels. |
|
|
|
|
|
|
|
Maximum height |
|
32–2600, Default = 256 |
|
Specify the maximum image height in pixels. |
|
|
|
|
|
|
|
Bits per pixel per color plane |
|
4–20, Default = 8 |
|
Select the number of bits per pixel (per color |
|
|
|
|
|
|
plane). |
|
|
|
|
|
|
Color plane configuration |
|
• |
Sequence |
|
There must always be three color planes for |
|
|
• |
Parallel |
|
this function but you can select whether the |
|
|
|
three color planes are transmitted in sequence |
||
|
|
|
|
|
|
|
|
|
|
|
or in parallel. |
|
|
|
|
|
|
Input format |
|
• |
4:4:4 |
|
Select the format or sampling rate format for |
|
|
• |
4:2:2 |
|
the input frames. |
|
|
|
Note: The input and output formats |
||
|
|
• |
4:2:0 |
|
|
|
|
|
|
|
must be different. A warning is |
|
|
|
|
|
issued when the same values are |
|
|
|
|
|
selected for both. |
|
|
|
|
|
|
Output format |
|
• |
4:4:4 |
|
Select the format or sampling rate format for |
|
|
• |
4:2:2 |
|
the output frames. |
|
|
|
Note: The input and output formats |
||
|
|
• |
4:2:0 |
|
|
|
|
|
|
|
must be different. A warning is |
|
|
|
|
|
issued when the same values are |
|
|
|
|
|
selected for both. |
|
|
|
|
|
|
Horizontal filtering algorithm |
|
• |
Nearest Neighbor |
|
Select the algorithm to use in the horizontal |
|
|
• |
Filtered |
|
direction when you resample data to or from |
|
|
|
4:4:4. |
||
|
|
|
|
|
|
|
|
|
|
|
|
Luma adaptive |
|
On or Off |
|
Turn on to enable luma-adaptive mode. This |
|
|
|
|
|
|
mode looks at the luma channel during |
|
|
|
|
|
interpolation and detects edges. |
|
|
|
|
|
|
Altera Corporation |
Chroma Resampler IP Core |
|
|
Send Feedback