User guide
Table Of Contents
- Contents
- 1. About This MegaCore Function Suite
- Release Information
- Device Family Support
- Features
- Design Example
- Performance and Resource Utilization
- 2D FIR Filter
- 2D Median Filter
- Alpha Blending Mixer
- Avalon-ST Video Monitor
- Chroma Resampler
- Clipper
- Clocked Video Input
- Clocked Video Output
- Color Plane Sequencer
- Color Space Converter
- Control Synchronizer
- Deinterlacer
- Deinterlacer II
- Frame Buffer
- Gamma Corrector
- Interlacer
- Scaler
- Scaler II
- Switch
- Test Pattern Generator
- Trace System
- 2. Getting Started with Altera IP Cores
- 3. Interfaces
- Interface Types
- Avalon-ST Video Protocol
- Avalon-MM Slave Interfaces
- Avalon-MM Master Interfaces
- Buffering of Non-Image Data Packets in Memory
- 4. 2D FIR Filter MegaCore Function
- 5. 2D Median Filter MegaCore Function
- 6. Alpha Blending MegaCore Function
- 7. Avalon-ST Video Monitor MegaCore Function
- 8. Chroma Resampler MegaCore Function
- 9. Clipper MegaCore Function
- 10. Clocked Video Input MegaCore Function
- 11. Clocked Video Output MegaCore Function
- 12. Color Plane Sequencer MegaCore Function
- 13. Color Space Converter MegaCore Function
- 14. Control Synchronizer MegaCore Function
- 15. Deinterlacer MegaCore Function
- Core Overview
- Functional Description
- Parameter Settings
- Signals
- Control Register Maps
- 16. Deinterlacer II MegaCore Function
- 17. Frame Reader MegaCore Function
- 18. Frame Buffer MegaCore Function
- 19. Gamma Corrector MegaCore Function
- 20. Interlacer MegaCore Function
- 21. Scaler MegaCore Function
- 22. Scaler II MegaCore Function
- 23. Switch MegaCore Function
- 24. Test Pattern Generator MegaCore Function
- 25. Trace System MegaCore Function
- A. Avalon-ST Video Verification IP Suite
- B. Choosing the Correct Deinterlacer
- Additional Information

8–2 Chapter 8: Chroma Resampler MegaCore Function
Functional Description
Video and Image Processing Suite January 2013 Altera Corporation
User Guide
The Chroma Resampler MegaCore Function only supports the cosited form of
horizontal resampling—the form for 4:2:2 data in ITU Recommendation BT.601, MPEG-
2, and other standards.
f 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.
4:4:4 to 4:2:2
The nearest-neighbor algorithm is the simplest way to down-scale the chroma
channels. It works by simply discarding 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, you can 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 (“Choosing and Loading
Coefficients” on page 21–6) that the Scaler MegaCore function uses. Their quantized
form is known as the Turkowski Decimator.
f For more information about the Turkowski Decimator, refer to Ken Turkowski. Graphics
Gems, chapter Filters for common resampling tasks, pages 147–165. Academic Press
Professional, Inc., San Diego, CA, USA, 1990.
The coefficients are fixed and approximate to powers of two, therefore they can be
implemented by bit-shifts and additions. This algorithm efficiently eliminates aliasing
in the chroma channels, and uses no memory or multipliers. However, it does use
more logic area than the nearest-neighbor algorithm.
4:2:2 to 4:4:4
The nearest-neighbor algorithm is the simplest way to up-scale the chroma channels.
It works by simply duplicating 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 method as the Scaler MegaCore function would
use for upscaling, 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 uses no 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.