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

13–2 Chapter 13: Color Space Converter MegaCore Function
Functional Description
Video and Image Processing Suite January 2013 Altera Corporation
User Guide
Given a set of nine coefficients [A0, A1, A2, B0, B1, B2, C0, C1, C2] and a set of three
summands [S0, S1, S2], the output values on channels 0, 1, and 2 (denoted dout_0,
dout_1, and dout_2) are calculated as follows:
dout_0 = (A0 × din_0) + (B0 × din_1) + (C0 × din_2) + S0
dout_1 = (A1 × din_0) + (B1 × din_1) + (C1 × din_2) + S1
dout_2 = (A2 × din_0) + (B2 × din_1) + (C2 × din_2) + S2
where din_0, din_1, and din_2 are inputs read from channels 0, 1, and 2
respectively.
User-specified custom constants and the following predefined conversions are
supported:
■ Computer B’G’R’ to CbCrY’: SDTV
■ CbCrY’: SDTV to Computer B’G’R’
■ Computer B’G’R’ to CbCrY’: HDTV
■ CbCrY’: HDTV to Computer B’G’R’
■ Studio B’G’R’ to CbCrY’: SDTV
■ CbCrY’: SDTV to Studio B’G’R’
■ Studio B’G’R’ to CbCrY’: HDTV
■ CbCrY’: HDTV to Studio B’G’R’
■ IQY' to Computer B'G'R'
■ Computer B'G'R' to IQY'
■ UVY' to Computer B'G'R'
■ Computer B'G'R' to UVY'
The values are assigned in the order indicated by the conversion name. For example,
if you select Computer B’G’R’ to CbCrY’: SDTV, din_0 = B’, din_1 = G’, din_2 = R’,
dout_0 = Cb’, dout_1 = Cr, and dout_2 = Y’.
If the channels are in sequence, din_0 is first, then din_1, and din_2. If the channels are
in parallel, din_0 occupies the least significant bits of the word, din_1 the middle bits
and din_2 the most significant bits. For example, if there are 8 bits per sample and one
of the predefined conversions inputs B’G’R’, din_0 carries B’ in bits 0–7, din_1 carries
G’ in bits 8–15, and din_2 carries R’ in bits 16–23.
1 Predefined conversions only support unsigned input and output data. If signed input
or output data is selected, the predefined conversion produces incorrect results. When
using a predefined conversion, the precision of the constants must still be defined.
Predefined conversions are based on the input bits per pixel per color plane. If using
different input and output bits per pixel per color plane, you must scale the results by
the correct number of binary places to compensate.