About color conversion in i.MX6DQ.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

About color conversion in i.MX6DQ.

590 Views
keitanagashima
Senior Contributor I

Dear All,

Hello. I have a question about color conversion in IPU of i.MX6DQ.

Refer to attached code (ipu_ic.c) from Platform SDK.

The coefficient which converts a color space from YCbCr to RGB is defined below.

//L347 in ipu_ic.c

unsigned int ycbcr2rgb_coeff[4][3] = {

        {0x95, 0x0, 0xCC},

        {0x95, 0x1CE, 0x198},

        {0x95, 0xFF, 0x0},

        {0x1E42, 0x10A, 0x1DD6},    // A0, A1, A2

[Q1]

When converting the inputted YCbCr data from CSI to RGB, Is the IC (IPU) converting a color space using this coefficient (=ycbcr2rgb_coeff[4][3] )?

[Q2]

What kind of YCbCr format (BT.656? BT.601? BT.709?) above defined ycbcr2rgb_coeff[4][3]?

[Q3]

We couldn't understand relation ycbcr2rgb_coeff[4][3] and the comment (L354~L358).

//L354~L358 comments

/*

       R = (1.164 * alpha *  (Y - 16)) + (1.596 * (Cr - 128));

       G = (1.164 * alpha * (Y - 16)) - (0.392 * (Cb - 128)) - (0.813 * (Cr - 128));

       B = (1.164 * alpha * (Y - 16)) + (2.017 * (Cb - 128);

*/

Is source code and comment the following relation?

0x95 : 1.164

0xCC : 1.596

0x1CE : -0.392

We consider that the comment doesn't correspond to source code.

Best Regards,

Keita

Labels (4)
0 Kudos
2 Replies

359 Views
joanxie
NXP TechSupport
NXP TechSupport

Q1: depends on what input you use, if you use yuv as input, and rgb as output, then CSC  moudle would use this

Q2: normally this ycbcr means yuv422, if you want to use BT601 or BT709,  you should use another coeff

Q3:I don't think you should understand this,CSC moudle is hardware module, this formula is regular formula.

0 Kudos

359 Views
keitanagashima
Senior Contributor I

Hi Guanqiong Xie,

Thank you for your quick reply.

> Q1: depends on what input you use, if you use yuv as input, and rgb as output, then CSC  module would use this

Yes. We will use the BT.601 or BT.709 as input, and rgb as output.

Refer to Figure 37-1. IPU Block Diagram in IMX6DQRM(Rev.2).

I think that CSC function (module) in IC block.

Is my understanding correct?

> Q2: normally this ycbcr means yuv422, if you want to use BT601 or BT709,  you should use another coeff

> Q3:I don't think you should understand this,CSC moudle is hardware module, this formula is regular formula.

Do you have reference coeff for BT.601 or BT.709?

Best Regards,

Keita

0 Kudos