User guide

Table Of Contents
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.