How to work a YUV to RGB color space conversion in H.264 video decoder?

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

How to work a YUV to RGB color space conversion in H.264 video decoder?

2,421 Views
takayuki_ishii
Contributor IV

Hello,

I have two questions about H.264 video decoder.

In YUV to RGB color space conversion about H.264 video decoder worked on the Stagefright,

 1) Which module is color space conversion working on?

 2) Which matrix and formula does it use?

Best regards,

Ishii.

Labels (4)
0 Kudos
5 Replies

1,312 Views
takayuki_ishii
Contributor IV

Hello Joan,

I check registers value working on both kernel.

IPUx_DP_COM_CONF_SYNC : 0x00000804

IPUx_DP_Graph_Wind_CTRL_SYNC : 0x80000000

Other registers set to zero from 0x02x8100C to 0x02x81114

And I set DP_CSC_DEF_SYNC bit to enable CSC, but LCD output is blackout

and IPU_INT_STAT_10[19].DI0_SYNC_DISP_ERR is detected.

The other hand, in the following thread suggest that GPU is used for color conversion.

https://community.nxp.com/docs/DOC-93611

I hope to know which method and matrix value to use CSC for H.264.

Best regards,

Ishii.

0 Kudos

1,312 Views
takayuki_ishii
Contributor IV

Hello Joan, 

Thank you for your quick response.

And sorry for my late reply.

>. "But JB4.2.2 seems output YUV directory. RGB data like .png file can show correctly." what does this mean?

In Gallery application of JB4.2.2.

  Jpeg file is a YCbCr data format, so output color is missed.

  PNG file is a RGB data format, it can show correct color.

> could you enable this bit in JB4.2.2? as I known, JB4.2.2 supports CSC, for your limitation information, I couldn't confirm

> anything, maybe you need to check the source code to confim where the error is.

It seems that current kernel source is not match to JB4.2.2.

I replace kernel_imx directory to old one (maybe clone before Feb./2017),

It can work YUV -> RGB conversion correctly.

Please teach me a source file to do YUV-RGB converion in Kernel_imx.

I will check it.

Best regards,

Ishii.

0 Kudos

1,312 Views
takayuki_ishii
Contributor IV

Hello Joan,

Thank you for your response.

I try to check CRC register both Android JB4.2.2 and M6.0.1.

YUV -> RGB conversion on M6.0.1 worked correctly both H.264 and Jpeg decode.

But JB4.2.2 seems output YUV directory. RGB data like .png file can show correctly.

In this time, IPUx_DP_COM_CONF_SYNC.DP_CSC_DEF_SYNC[9:8] bit set

to 00(CRC disable) and CRC matrix value on JB4.2.2 are zero.

Do you have some method to fix it?

Best regards,

Ishii.

0 Kudos

1,312 Views
joanxie
NXP TechSupport
NXP TechSupport

"But JB4.2.2 seems output YUV directory. RGB data like .png file can show correctly." what does this mean?

could you enable this bit in JB4.2.2? as I known, JB4.2.2 supports CSC, for your limitation information, I couldn't confirm anything, maybe you need to check the source code to confim where the error is.

0 Kudos

1,312 Views
joanxie
NXP TechSupport
NXP TechSupport

in IPU, one can find the module named CSC (color space conversion) module which can do this.

for more detailed information, one can refer to the Reference Maual, focus on the IPU chapter, which includes the matrix and formula, pls focus on the chapter 37.4.9.5 Color Space Conversion unit - CSC

0 Kudos