]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00277003 IPUv3: Update IC RGB2YUV CSC matrix parameters
authorLiu Ying <Ying.Liu@freescale.com>
Wed, 28 Aug 2013 03:07:52 +0000 (11:07 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 20 Aug 2014 08:06:19 +0000 (10:06 +0200)
This patch updates IPUv3 IC RGB to YUV color space conversion
matrix's parameters to align with the default VIV GPU CSC
implementation so that we may pass relevant Android CTS test
cases.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
drivers/mxc/ipu3/ipu_ic.c

index 2129f04680fad731d72a0e6015490f8dfe728c3e..418b8099ad8578b74d550ab0d05d7cb93ba9feae 100644 (file)
@@ -697,15 +697,16 @@ int _ipu_ic_idma_init(struct ipu_soc *ipu, int dma_chan,
 static void _init_csc(struct ipu_soc *ipu, uint8_t ic_task, ipu_color_space_t in_format,
                      ipu_color_space_t out_format, int csc_index)
 {
-
-/*     Y = R *  .299 + G *  .587 + B *  .114;
-       U = R * -.169 + G * -.332 + B *  .500 + 128.;
-       V = R *  .500 + G * -.419 + B * -.0813 + 128.;*/
+       /*
+        * Y =  0.257 * R + 0.504 * G + 0.098 * B +  16;
+        * U = -0.148 * R - 0.291 * G + 0.439 * B + 128;
+        * V =  0.439 * R - 0.368 * G - 0.071 * B + 128;
+        */
        static const uint32_t rgb2ycbcr_coeff[4][3] = {
-               {0x004D, 0x0096, 0x001D},
-               {0x01D5, 0x01AB, 0x0080},
-               {0x0080, 0x0195, 0x01EB},
-               {0x0000, 0x0200, 0x0200},       /* A0, A1, A2 */
+               {0x0042, 0x0081, 0x0019},
+               {0x01DA, 0x01B6, 0x0070},
+               {0x0070, 0x01A2, 0x01EE},
+               {0x0040, 0x0200, 0x0200},       /* A0, A1, A2 */
        };
 
        /* transparent RGB->RGB matrix for combining