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

Chapter 13: Color Space Converter MegaCore Function 13–3
Functional Description
January 2013 Altera Corporation Video and Image Processing Suite
User Guide
Constant Precision
The Color Space Converter MegaCore function requires fixed point types to be
defined for the constant coefficients and constant summands. The user entered
constants (in the white cells of the matrix in the parameter editor) are rounded to fit in
the chosen fixed point type (these are shown in the purple cells of the matrix).
Calculation Precision
The Color Space Converter MegaCore function does not lose calculation precision
during the conversion. The calculation and result data types are derived from the
range of the input data type, the fixed point types of the constants, and the values of
the constants. If scaling is selected, the result data type is scaled up appropriately such
that precision is not lost.
Result of Output Data Type Conversion
After the calculation, the fixed point type of the results must be converted to the
integer data type of the output. This conversion is performed in four stages, in the
following order:
1. Result Scaling. You can choose to scale up the results, increasing their range. This
is useful to quickly increase the color depth of the output. The available options
are a shift of the binary point right –16 to +16 places. This is implemented as a
simple shift operation so it does not require multipliers.
2. Removal of Fractional Bits. If any fractional bits exist, you can choose to remove
them. There are three methods:
■ Truncate to integer. Fractional bits are removed from the data. This is
equivalent to rounding towards negative infinity.
■ Round - Half up. Round up to the nearest integer. If the fractional bits equal
0.5, rounding is towards positive infinity.
■ Round - Half even. Round to the nearest integer. If the fractional bits equal 0.5,
rounding is towards the nearest even integer.
3. Conversion from Signed to Unsigned. If any negative numbers can exist in the
results and the output type is unsigned, you can choose how they are converted.
There are two methods:
■ Saturate to the minimum output value (constraining to range).
■ Replace negative numbers with their absolute positive value.
4. Constrain to Range. If any of the results are beyond the range specified by the
output data type (output guard bands, or if unspecified the minimum and
maximum values allowed by the output bits per pixel), logic that saturates the
results to the minimum and maximum output values is automatically added.