VP 510
9
R
G =
B
200
200
200
247
F5A
D5B
146
EA5
391
Y
I
Q
CONVERSION FROM Y Cr Cb TO RGB
The analog conversion matrix is given below;
R =
G =
B
Y + 1.402( Cr - 128 )
Y - 0.714( Cr - 128 ) - 0.344( Cb - 128 )
Y +1.772( Cb - 128 )
=
If the Y Cr Cb ranges are all 1 to 254, then the RGB range
produced will be 1 to 254. If the Y range is 16 to 235 and the
Cr Cb ranges are 16 to 240, then the expected RGB range is
16 to 235. Incoming Y CR Cb data can be adjusted to either of
these ranges by using the SEL bit in the Control Register. The
input circuit also does the necessary subtraction of 128 from
the Cr and Cb values ( the BYPASS bit must be reset ). The
resulting HEX values which must be loaded into the coefficient
store are given below;
C1 C2
C4 C5
C7 C8
C3
C6
C9
200
200
200
2CE
E92
0
0
F50
38B
=
The digital conversion matrix is given below;
R =
G =
B
Y + 1.37( Cr - 128 )
Y - 0.698( Cr - 128 ) - 0.336( Cb - 128 )
Y + 1.73( Cb - 128 )
The corresponding HEX values are given below;
C1 C2
C4 C5
C7 C8
C3
C6
C9
200
200
200
2BD
E9B
0
0
F54
376
=
The digitalmatrix only functions correctly when the Y range
is 16 to 235 and the Cr Cb ranges are 16 to 240. The RGB
range produced should then be 16 to 235. Both the SEL and
BYPASS bits should thus be reset.
CONVERSION FROM RGB TO Y Cr Cb
The analog matrix is given below;
Y
Cr =
Cb =
=
0.299R + 0.587G + 0.114B
0.5R - 0.419G - 0.081B + 128
-0.169R - 0.331G + 0.5B + 128
This can handle RGB ranges of either 1 to 254 or 16 to 235.
If necessary the RAM based look up tables can be used to limit
the range of the incoming RGB. The BYPASS bit must always
be reset, and the NORM bit set, when producing Cr and Cb
data.
The SEL bit is used to limit the range of the YCr Cb values
which are outputed. When SEL is set all three output ranges
are 1 to 254. When it is reset the Y range is 16 to 235, and the
Cr Cb ranges are 16 to 240. Values ouside the range limits will
be forced to the correct maximum or minimum value. The
offset of 128 is added to the Cr Cb values before the ranging
is done.
The HEX values which correspond to the analog matrix are
given below;
C1 C2
C4 C5
C7 C8
C3
C6
C9
99
100
FA9
12D
F29
F57
3A
FD7
100
=
In the CCIR601 specification the digital matrix is ex-
pressed as fractions of 256, and is given below;
Y
Cr =
Cb =
=
77/256R + 150/256G + 29/256B
131/256R - 110/256G - 21/256B + 128
-44/256R - 87/256G + 131/256B + 128
The HEX values which correspond to this digital matrix are
given below;
C1 C2
C4 C5
C7 C8
C3
C6
C9
9A
106
FA8
12C
F24
F52
3A
FD6
106
=
This matrix expects the RGB inputs to be in the range of 16
to 235, and also the SEL bit to detemine the output range.
CONVERSION BETWEEN RGB AND Y,R-
Y,AND B-Y
The analog matrices used to convert between RGB and Y
Cr Cb can also be used with normalized colour difference
information. The BYPASS bit must, however, be reset to avoid
the 128 offset circuitry. RGB and Y inputs and outputs will
have a range of 0 to 255. Colour difference inputs and outputs
will have a range of -128 to +127 (
±
0.5 ). The NORM bit should
always be set.
When working with analog colour difference values the
following coefficients should be used, with the NORM bit reset.
R - Y will have a range of
±
0.701, and B - Y a range of
±
0.886.
Y
R-Y
B-Y
0.299
0.701
-0.299
0.587
-0.587
-0.587
0.114
-0.114
0.886
R
G
B
=
R
G
B
=
1
1
1
1
-0.509
0
0
-0.194
1
Y
R-Y
B-Y
The corresponding HEX values are given below;
Y
R-Y =
B-Y
099
167
F67
12C
ED3
ED3
03A
FC6
1C6
R
G
B
R
G
B
200
200
200
200
EFB
0
0
F9D
200
Y
R-Y
B-Y
=