|
THS8200 Datasheet, PDF (22/97 Pages) Texas Instruments – ALL FORMAT OVERSAMPLED COMPONENT VIDEO/PC GRAPHICS D/A SYSTEM WITH THREE 11-BIT DACS,CGMS DATA INSERTION | |||
|
◁ |
The formulas for RGB to YCbCr conversion are:
⢠Yd = 0.2126*Rd + 0.7152*Gd + 0.0722*Bd
⢠Cb = â0.1172*Rd â 0.3942*Gd + 0.5114*Bd + 512
⢠Cr = 0.5114*Rd â 0.4646*Gd â 0.0468*Bd + 512
To program the red coefficient of channel 1 (Y) with the value of 0.2126 the following must be done:
1. Realize that this is a positive value so the sign bit of the integer part is 0. (bit 5 of csc_ric1 = 0)
2. Note that there is no integer portion of the coefficient (bit 4âbit 0 = 00000).
3. The binary representation of the fractional part can be constructed directly from the binary equivalent of the
fractional part multiplied by 1024 (0.2126 Ã 1024 = 217.7), rounded to the nearest integer (218) and
represented as a binary 10-bit number (00 1101 1010).
Using the above method all the registers for the CSC blocks can be programmed with the correct value for RGB to
YCbCr conversion. Below is a complete list of register values for the above conversion.
0.2126 â> csc_ric1 = 00 0000
0.7152 â> csc_gic1 = 00 0000
0.0722 â> csc_bic1 = 00 0000
csc_rfc1 = 00 1101 1010
csc_gfc1 = 10 1101 1100
csc_bfc1 = 00 0100 1010
â0.1172 â> csc_ric2 = 10 0000
â0.3942 â> csc_gic2 = 10 0000
0.5114 â> csc_bic2 = 00 0000
csc_rfc2 = 00 0111 1000
csc_gfc2 = 01 1001 0100
csc_bfc2 = 10 0000 1100
0.5114 â> csc_ric3 = 00 0000
â0.4646 â> csc_gic3 = 10 0000
â0.0468 â> csc_bic3 = 10 0000
csc_rfc3 = 10 0000 1100
csc_gfc3 = 01 1101 1100
csc_bfc3 = 00 0011 0000
For the offsets necessary in the second and third equation the csc_offset<n> registers need to be programmed. We
need to add 512 to the Cb and Cr channels. The value to be programmed is 1/4 of this offset in a signed magnitude
representation, thus 128 or csc_offset2 = csc_offset3 = 00 1000 0000.
Packing these individual registers into the I2C register map, the programmed values are:
SUBADDRESS REGISTER NAME
0x04
csc_r11
VALUE
0000 0000
SUBADDRESS
0x0F
REGISTER NAME
csc_g32
VALUE
1101 1100
0x05
csc_r12
1101 1010
0x10
csc_b11
0000 0000
0x06
csc_r21
1000 0000
0x11
csc_b12
0100 1010
0x07
csc_r22
0111 1000
0x12
csc_b21
0000 0010
0x08
0x09
0x0A
csc_r31
csc_r32
csc_g11
0000 0010
0000 1100
0000 0010
0x13
0x14
0x15
csc_b22
csc_b31
csc_b32
0000 1100
1000 0000
0011 0000
0x0B
csc_g12
1101 1100
0x16
csc_offs1
0000 0000
0x0C
csc_g21
1000 0001
0x17
csc_offs12
0000 1000
0x0D
csc_g22
1001 0100
0x18
csc_offs23
0000 0010
0x0E
csc_g31
1000 0001
0x19
csc_offs3
0000 0000
CSC configuration example: HDTV YCbCr to HDTV RGB
⢠Gd = â0.4577*Cr + Yd â 0.1831*Cb +328 (= 0.6408*128*4)
⢠Bd = 0*Cr + Yd + 1.8142* Cb â 929 (= â1.8142*128*4)
⢠Rd = 1.5396* Cr +Yd +0*Cb â 788 (= â1.5396*128*4)
4â7
|
▷ |