The color coefficients used for converting from yuv to rgb

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

The color coefficients used for converting from yuv to rgb

868 Views
gyuropark
Contributor I

Hi there,

In i.MX6DL/Q GPU SDK, it is coming through with the several formats of the pixel data extended noted in gl2ext.h:

 #define GL_VIV_YV12 0x8FC0
 #define GL_VIV_NV12 0x8FC1
 #define GL_VIV_YUY2 0x8FC2
 #define GL_VIV_UYVY 0x8FC3
 #define GL_VIV_NV21 0x8FC4

With GL_VIV_NV12 I am currently trying to render the textures, but the color quality being shown in display seems to be not as good as I expected.

As for the degradation, I could guess that this issue is related to the color coefficients used for converting from YUV (in that case, NV12) to RGB.

Perhaps,

could anyone comment the color coefficients used in Vivante GPU engine?

or could I adjust the color coefficients via any API?

Best regards,

Gyuro

Labels (1)
Tags (3)
0 Kudos
2 Replies

673 Views
igorpadykov
NXP Employee
NXP Employee

Hi Gyuro

please check sect.2.4.1 Color space conversion from YUV to RGB

attached i.MX_6_Graphics_User's_Guide.pdf and sect.7.3.15 Video conversion Linux Guide

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

673 Views
gyuropark
Contributor I

Hi igor,

Thanks for your reply.

Nevertheless, the section you noticed wasn't fitted to my point.

Basically, in order to convert the color space of yuv to rgb, all the coefficients should be known for linear combination.

To help your understanding, please see the formula below. (YUV - Wikipedia, the free encyclopedia)

{\begin{aligned}{\begin{bmatrix}Y'\\U\\V\end{bmatrix}}&={\begin{bmatrix}0.299&0.587&0.114\\-0.14713&-0.28886&0.436\\0.615&-0.51499&-0.10001\end{bmatrix}}{\begin{bmatrix}R\\G\\B\end{bmatrix}}\\{\begin{bmatrix}R\\G\\B\end{bmatrix}}&={\begin{bmatrix}1&0&1.13983\\1&-0.39465&-0.58060\\1&2.03211&0\end{bmatrix}}{\begin{bmatrix}Y'\\U\\V\end{bmatrix}}\end{aligned}}

That is just what I want to know.

Best regards,

Gyuro

0 Kudos