Home
AD9880 Color Space Converter User's Guide
Contents
1. Register Address Value Red Cr Coeff 1 0x35 0x08 0x36 0x2D Red Cr Coeff 2 0x37 0x18 0x38 0x93 Red Cr Coeff 3 0x39 Ox1F 0x3A Ox3F Red Cr Coeff Offset Ox3B 0x08 0 3 0 00 Green Y Coeff 1 Ox3D 0x03 Ox3E 0x68 Green Y Coeff 2 Ox3F 0x0B 0x40 0x71 Green Y Coeff 3 0x41 0x01 0x42 0x27 Green Y Coeff Offset 0x43 0x00 0x44 0x00 Blue Cb Coeff 1 0x45 0 1 0 46 0 21 Blue Cb Coeff 2 0x47 0x19 0x48 OxB2 Blue Cb Coeff 3 0x49 0x08 0 4 0x2D Blue Cb Coeff Offset 0 48 0x08 0 4 0 00 REV 0 Table RGB 0 255 to HDTV YCrCb 16 235 Register Address Value Red Cr Coeff 1 0x35 0x07 0x36 0x06 Red Cr Coeff 2 0x37 0x19 0x38 0 Red Cr Coeff 3 0x39 Ox1F 0x3A 0x5B Red Cr Coeff Offset 0x3B 0x08 0 3 0 00 Green Y Coeff 1 Ox3D 0x02 Ox3E OxED Green Y Coeff 2 Ox3F 0x09 0x40 OxD3 Green Y Coeff 3 0x41 0x00 0x42 OxFD Green Y Coeff Offset 0 43 0x01 0x44 0x00 Blue Cb Coeff 1 0x45 0 1 0 46 0 64 Blue Cb Coeff 2 0x47 0 48 0 96 Blue Cb Coeff 3 0x49 0x07 0 4 0 06 Blue Cb Coeff Offset 0 48 0 08 0 4 0 00 AN 795 Table XIII RGB 0 255 to HDTV YCrCb 0 255 Register Address Value Red Cr Coeff 1 0x35 0x08 0x36 0x2D Red Cr Coeff 2 0x37 0x19 0x38 0x27 Red Cr Coeff 3 0x39 0 1 0x3A OxAC Red Cr Coeff Offset Ox3B 0x08 0 3 0 0
2. This is the same conversion as the example The coeficients are the default settings for the AD9880 REV 0 5 AN 795 Table IX SDTV YCrCb 0 255 to RGB 0 255 Register Address Value Red Cr Coeff 1 0x35 0 2 0 36 OxFA Red Cr Coeff 2 0x37 0x08 0x38 0x00 Red Cr Coeff 3 0x39 0x00 0 0 00 Red Cr Coeff Offset 0x3B 0 3 0 84 Green Y Coeff 1 Ox3D Ox1A Ox3E 0x6A Green Y Coeff 2 Ox3F 0x08 0x40 0x00 Green Y Coeff 3 0x41 0x1D 0x42 0x50 Green Y Coeff Offset 0x43 0x04 0x44 0x23 Blue Cb Coeff 1 0x45 0x00 0x46 0x00 Blue Cb Coeff 2 0x47 0x08 0x48 0x00 Blue Cb Coeff 3 0x49 0x0D 0x4A OxDB Blue Cb Coeff Offset Ox4B 0x19 0 4 0 12 Table X SDTV YCrCb 16 235 to RGB 0 255 Register Address Value Red Cr Coeff 1 0x35 0x46 0x36 0x63 Red Cr Coeff 2 0x37 0x04 0x38 0 8 Red Cr Coeff 3 0x39 0x00 0x3A 0x00 Red Cr Coeff Offset 0x3B 0 1 0 3 0 84 Green Y Coeff 1 Ox3D 0 1 Ox3E 0 0 Green Y Coeff 2 Ox3F 0x04 0x40 0xA8 Green Y Coeff 3 0x41 Ox1E 0x42 Ox6F Green Y Coeff Offset 0 43 0x02 0x44 0 1 Blue Cb Coeff 1 0x45 0x00 0x46 0x00 Blue Cb Coeff 2 0x47 0x04 0x48 0xA8 Blue Cb Coeff 3 0x49 0x08 0 4 0 11 Blue Cb Coeff Offset 0 48 Ox1B 0 4 0 REV 0 AN 795 Table XI RGB 0 255 to HDTV YCrCb 0 255
3. C3 2 C3 1 C3 0 0x87 Blue Cb 0x4B unused unused unused C4 12 4 11 24 10 C4 9 4 8 0 18 Offset 0 4 04 7 04 6 C4 5 C4 4 C4 3 C4 2 C4 1 C4 0 OxBD Legend Bit name as per register table Example bit value Example register value AN 795 APPENDIX Register Settings for Standard Color Space Conversions Table VII HDTV YCrCb 0 255 to RGB 0 255 Table VIII HDTV YCrCb 16 235 to RGB 0 255 Register Address Value Register Address Value Red Cr Coeff 1 0x35 0 0 Red Cr Coeff 1 0x35 0x47 0x36 0x52 0x36 0x2C Red Cr Coeff 2 0x37 0x08 Red Cr Coeff 2 0x37 0x04 0x38 0x00 0x38 0xA8 Red Cr Coeff 3 0x39 0x00 Red Cr Coeff 3 0x39 0x00 0 0 00 0x3A 0x00 Red Cr Coeff Offset 0x3B 0x19 Red Cr Coeff Offset 0x3B 0x1C 0x3C 0 07 0 3 Ox1F Green Y Coeff 1 0x3D 0x1C Green Y Coeff 1 0x3D 0x1D Ox3E 0x54 Ox3E OxDD Green Y Coeff 2 Ox3F 0x08 Green Y Coeff 2 Ox3F 0x04 0x40 0x00 0x40 0xA8 Green Y Coeff 3 0x41 Ox3E Green Y Coeff 3 0x41 Ox1F 0x42 0x89 0x42 0x26 Green Y Coeff Offset 0x43 0x02 Green Y Coeff Offset 0x43 0x01 0x44 0x91 0x44 0x34 Blue Cb Coeff 1 0x45 0x00 Blue Cb Coeff 1 0x45 0x00 0x46 0x00 0x46 0x00 Blue Cb Coeff 2 0x47 0x08 Blue Cb Coeff 2 0x47 0x04 0x48 0x00 0x48 0xA8 Blue Cb Coeff 3 0x49 OxOE Blue Cb Coeff 3 0x49 0x08 0 4 0 87 0 4 0x75 Blue Cb Coeff Offset Ox4B 0x18 Blue Cb Coeff Offset Ox4B 0 18 0 4 OxBD 0 4 0x7D
4. 0 Green Y Coeff 1 Ox3D 0x04 Ox3E 0 9 Green Y Coeff 2 Ox3F 0x09 0x40 0x64 Green Y Coeff 3 0x41 0x01 0x42 OxD3 Green Y Coeff Offset 0 43 0x00 0x44 0x00 Blue Cb Coeff 1 0x45 0x1D 0x46 Ox3F Blue Cb Coeff 2 0x47 Ox1A 0x48 0x93 Blue Cb Coeff 3 0x49 0x08 0 4 0x2D Blue Cb Coeff Offset Ox4B 0x08 0x4C 0x00 2005 Analog Devices Inc All rights reserved Trademarks and registered trademarks are the property of their respective owners 8 Table XIV RGB 0 255 to HDTV YCrCb 16 235 Register Address Value Red Cr Coeff 1 0x35 0x07 0x36 0x06 Red Cr Coeff 2 0x37 0 38 Ox1E Red Cr Coeff 3 0x39 0 1 Ox3A OxDC Red Cr Coeff Offset Ox3B 0x08 0 3 0 00 Green Y Coeff 1 Ox3D 0x04 Ox3E 0 1 Green Y Coeff 2 Ox3F 0x08 0x40 0x11 Green Y Coeff 3 0x41 0x01 0x42 0x91 Green Y Coeff Offset 0 43 0x01 0x44 0x00 Blue Cb Coeff 1 0x45 0x1D 0x46 0 Blue Cb Coeff 2 0x47 Ox1B 0x48 0x57 Blue Cb Coeff 3 0x49 0x07 0 4 0 06 Blue Cb Coeff Offset Ox4B 0x08 0 4 0 00 REV 0 05556 0 5 05 0
5. ANALOG AN 795 DEVICES APPLICATION NOTE One Technology Way Box 9106 Norwood MA 02062 9106 Tel 781 329 4700 Fax 781 461 3113 www analog com AD9880 Color Space Converter User s Guide by Del Jones COLOR SPACE CONVERSION MATRIX diagram for a single channel in the CSC is repeated for The color space conversion matrix CSC in the AD9880 is a 3 X 3 matrix with full programmability of all coef ficients in the matrix Each coefficient is 12 bits wide to the other two remaining Channels B and C The coef ficients for these channels are called B1 B2 B3 B4 C1 C2 C3 and C4 ensure that signal integrity is maintained The CSC is designed to run at speeds of up to 150 MHz supporting 1080 p 60 Hz rates With the any to any color space support formats such as RGB YUV YCrCb and others are supported by the CSC A1 12 0 A4pi20 CSC_SCALE 1 0 IN A 11 0 OUT A 11 0 The CSC contains three identical processing channels IN B 11 0 one of which is shown in Figure 1 The main inputs In A In B and In C come from 8 bit outputs of each ADC DVI channel Each input to the individual channels to the CSC is multiplied by a separate coefficient for each chan nel In Figure 1 these coefficients are marked A1 A2 and A3 The variable in the figure labelled A4 is used as an offset control for Channel A in the CSC The functional IN C 11 0 Figure 1 Single CSC Channel The coefficie
6. e VI Table VI Color Space Conversion and Decimation Filters Register Address Bit Description and Values Hex Value Red Cr 0x35 unused CSC scale 1 0 1 12 1 11 1 10 1 9 1 8 0x0C Coeff 1 0x36 A1 7 1 6 15 A1 4 A1 3 A1 2 A1 1 A1 0 0x52 Red Cr 0x37 unused unused unused A2 12 A2 11 A2 10 A2 9 A2 8 0x08 Coeff 2 0x38 A2 7 2 6 2 5 2 4 2 3 2 2 A2 1 A2 0 0x00 Red Cr 0x39 unused unused unused 12 11 10 9 8 0 00 Coeff 3 0x3A A3 7 A3 6 A3 5 A3 3 A3 2 A3 1 0 0 00 Red Cr Ox3B unused unused unused A4 12 A4 11 A4 10 4 9 A4 8 0x19 Offset 0 3 4 7 4 6 4 5 A4 4 A4 3 A4 2 A4 1 A4 0 0 07 Green Y 0x3D unused unused unused B1 12 B1 11 B1 10 B1 9 B18 0x1C Coeff 1 Ox3E B1 7 B1 6 B1 5 B1 4 B1 3 B1 2 B1 1 B1 0 0x54 Green Y Ox3F unused unused unused B2 12 B2 11 B2 10 B2 9 B2 8 0x08 Coeff 2 0x40 B B2 6 B B2 4 B B B B2 0 0x00 Green Y 0x41 unused unused unused B3 12 B3 11 B3 10 B3 9 B3 8 Ox3E Coeff 3 0x42 B3 7 B3 6 B3 5 B3 4 B3 3 B3 2 B3 1 B3 0 0x89 Green Y 0x43 unused unused unused B4 12 B4 11 B4 10 B4 9 B4 8 0x02 Coeff 4 0x44 B4 B4 6 B4 B4 4 B4 B4 B4 B4 0 0x91 Blue Cb 0x45 0x00 Coeff 1 0x46 0x00 Blue Cb 0x47 unused unused unused C2 12 C2 11 C2 10 C2 9 2 8 0 08 Coeff 2 0x48 C2 7 C2 6 C2 5 C24 02 3 C2 2 C2 1 C2 0 0x00 Blue Cb 0x49 unused unused unused C3 12 C3 11 C3 10 C3 9 C3 8 0x0E Coeff 3 0 4 3 7 C3 6 C3 5 C3 4 C3 3
7. ed to ensure that the resulting output code does not exceed the 12 bit limit of 4095 Table Il describes the conditions under which each 5 scale setting should be used Note that if any coefficient in any of the three CSC equations requires scaling 5 scale 7 0 then all coefficients including the offset values are scaled as indicated by Equations 1 2 and 3 The values of A1 4 B1 B4 and C1 C4 will equal the coefficients from the desired conversion formula multiplied by 4096 2CSC scale Table Il CSC scale Settings CSC scale Conversion Coefficient 1 1 N lt 2 2 2 N lt 4 Note that for the CSC to operate properly the channel mapping shown Table III must be followed Table Ill CSC Port Mapping AD9980 Input Channel analog CSC Channel Red Pr Rain A Green Y Gan B Blue Pb Bain C Output mapping depends on the output format Refer to the AD9880 data sheet for details Programming Steps To arrive at programming values from typical formulas the following steps must be performed 1 Check the value of each coefficient The coefficients can only be programmed in the range of 0 999 0 999 To support larger coefficients the CSC scale function should be used see Table Il Determine the setting for CSC scale and adjust coefficients if necessary 2 Program the coefficient values Convert the float point coefficients into 12 bit fixed decimal format by multiplying t
8. f ficient range The overall outputs of the CSC are then increased by a fixed value of two thus compensating for the scaled down coefficients REV 0 AN 795 The coefficient values are programmed with 12 bit accuracy in a fixed point format In the example the biggest coefficient is 1 816 so the CSC scale bits would be set to 01 1 To achieve a coefficient value of 1 0 for any given To translate the float point coefficients they must coefficient the 5 scale bits should be set to 1 and the coefficient should actually be programmed to a value of 0 5 Otherwise the largest value would be 4095 4096 0 9997 which is not exactly 1 While this be multiplied by 212 4096 and then rounded to 12 bits Twos complement notation should be used for nega tive numbers value could be interpreted as a 1 it is recommended to use the value of 0 5 and the 5 scale bit for maxi mum accuracy In A carries the Pr or R components In B contains the Y G components and In C delivers the Pb or B com ponents Similarly Out A Pr or R Out B Y or G and Out C Pb or B Program the Offset Values When programming the offset values A4 B4 C4 the CSC scale is setto 1 so the offset value from the original equation must be divided by 2 2 For very large coefficient values e g 2 58 the 5 scale must be set to 2 and all coefficients must be scaled by one quarter which makes them fit in
9. hem by 4096 268 1 Convert into binary format using twos complement for negative values Program 1 B1 and C1 3 Progam the offset values Depending on the type of color space conversion offsets may have to be used Program AA B4 and C4 CSC EXAMPLE The following sets of equations give an example of a conversion from an HDTV YCbCr to RGB 12 bits R Y 1 540 Cr 2048 Y 1 540 x Cr 3154 G Y 0 459 Cr 2048 0 183 Cb 2048 Y 0 459 x Cr 0 183 Cb 1315 B Y 1 816 Cb 2048 Y 1 816 Cb 3719 The original equations give offset values of 128 for the Pr and Pb components The value of 128 equates to half the range on an 8 bit system It must be noted that the CSC of the AD9880 operates on a 12 bit range The offsets therefore must be changed from 128 to half the range of a 12 bit system which is 2048 Check the Value of Each Coefficient The maximum value for each coefficient on its own can only be within the range of 4095 4096 to 4095 4096 which equals 0 999755859375 0 999755859375 Values outside this range do not fit into the 12 bit fixed point format used to program the coefficients If the value of one or more coefficients exceeds the sup ported coefficient range the CSC needs to be scaled using the 5 scale bits With the CSC scale set to 1 all coefficients must be scaled by half which makes them fit into the given coe
10. nts are detailed in Table with their default 2 power on reset values Table CSC Coefficients Bit AD9880 Register Default Value Description CSC scale 1 0 0 35 bits 6 5 1 Scaling for CSC formula A1 12 0 0x35 0x36 3154 Coefficients for Channel A A2 12 0 0x37 0x39 2048 A3 12 0 0x39 0x3A 0 B1 12 0 Ox3D Ox3E 940 Coefficients for Channel B B2 12 0 Ox3F 0x40 2048 B3 12 0 0x41 0x42 375 C1 12 0 0x45 0x46 0 Coefficients for Channel C C2 12 0 0x47 0x48 2048 C3 12 0 0x49 0x4A 3719 A4 12 0 Ox3B 0x3C 1577 Offsets for the three channels B4 12 0 0x43 0x44 658 C4 12 0 Ox4B 0 4 1859 REV 0 AN 795 PROGRAMMING THE CSC The equations performed by the CSC are as follows CSC Channel A Al A2 In Cx 3 A4 x2CSC scale 4096 4096 4096 1 CSC Channel Out A In Ax B1 B2 Out B In Ax B In_Cx Bx BA x 265C scale 2 4096 4096 6 CSC Channel C Out C In Ax c1 _ 2_ n Cx C4 x 205C scale 3 4096 4096 96 As Equations 1 2 and 3 show the A1 B1 and C1 coefficients are used to scale the primary inputs The values of A4 B4 and C4 are then added as offsets The CSC scale bits allow the user to implement conver sion formulas in which the conversion coefficients are 1 In other words if an equation is being implemented whose coefficients 1 the CSC scale bits can be us
11. to the given coefficient range The overall outputs of the CSC are then gained up by a fixed value of four thus compensating for the scaled down coefficients Program the coefficient values as follows R 1 540 X Cr 0 x Cb 1 x Y 3154 Table IV Example Offset Values Hex Value G 0459 x Cr 0 183 x Cb 1 Y 1315 Original Adjusted 13 bit twos Equation Offset Offset Register complement 0 xY Red 3154 1577 A4 12 0 0x19D7 Green 1315 657 B4 12 0 0x0291 Blue 3719 1859 C4 12 0 Ox18BD Since the CSC scale is set to 1 the calculated coefficient is divided by 2 2CSC scale Table V Example Coefficient Calculations Equation Rounded Result Hex Value Equation Coefficients Calculation 1 4096 N lt 4096 Register Twos complement Red Cr 1 54 1 54 x 4096 2 3154 A1 12 0 0x0C52 Y 1 1 4096 2 2048 A2 12 0 0x0800 Cb 0 0 4096 2 0 A3 12 0 0x0000 Green Cr 0 459 0 459 4096 2 940 B1 12 0 0x1C54 Y 1 1 4096 2 2048 B2 12 0 0x0800 Cb 0 183 0 183 4096 2 375 B3 12 0 0x3E89 Blue Cr 0 0 x 4096 2 0 C1 12 0 0x000 Y 1 1 X 4096 2 2048 C2 12 0 0x0800 Cb 1 816 1 816 x 4096 2 3719 C3 12 0 0 0 87 Since the CSC scale is set to 1 the calculated coefficient is divided by 2 REV 0 AN 795 REGISTER SETTINGS FOR CSC EXAMPLE For the CSC example the 12 registers of the AD9880 must be programmed with the values shown in Tabl
Download Pdf Manuals
Related Search
Related Contents
APILADOR MANUAL AY-1100 – APM 組立説明書(PDF: 0.6 MB) Copyright © All rights reserved.
Failed to retrieve file