Using glTexDirectVIVMap what is the pixel arrangement for GL_VIV_YV12?

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

Using glTexDirectVIVMap what is the pixel arrangement for GL_VIV_YV12?

1,061 Views
tanguymezzano
Contributor I

Hello,

I'd like to have some more specific information about the function glTexDirectVIVMap from the OpenGL extension support.
In the i.MX 6 Graphics User's Guide, I can see that the fourth parameter of this function (GLenum format) can be either YUV or RGBA format. In my case I need to send image data in Bayer format to this function but since this format is not supported, I chose the GL_VIV_YV12 format instead and somehow tried to arrange the bytes of my Bayer image as if they were constituting the Y plane of the image data I have. I made some tests assuming that the bytes of the Y plane are stored first for an image in GL_VIV_YV12 format but I got bad results in my application.

Could you indicate me what is the proper pixel arrangement for an image in GL_VIV_YV12 format ?

Thanks.

0 Kudos
2 Replies

578 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hi,

RGB565 and RGB formats are supported according to the driver code in the function glTextDirectVIVMap

switch (format)
{
case GL_VIV_YV12:
case GL_VIV_I420:
case GL_VIV_NV12:
case GL_VIV_NV21:
case GL_VIV_YUY2:
case GL_VIV_UYVY:
case GL_RGB565:
case GL_RGB:
case GL_RGBA:
case GL_BGRA_EXT:
case GL_RG8_EXT:
case GL_ALPHA:
case GL_LUMINANCE8_ALPHA8_EXT:
return GL_TRUE;

I guess you can try to convert your bayer with  V4L2 driver

Regards

0 Kudos

578 Views
linya
Contributor II

The glTextDirectVIVMap API is able to load UYVY texture.
What is the accurate algorithm that API convert UYVY to RGB ?

I found this algorithm for G2D from Processor Reference Manual.
16 <= Y <= 235
16 <= U <= 240
16 <= V <= 240
A = Y - 16
B = U - 128
C = V - 128
R = clip(( 298*A + 410*C + 128) >> 8)
G = clip((298*A - 101*B - 209*C + 128) >> 8)
B = clip((298*A + 519*B + 128) >> 8)

Is glTextDirectVIVMap API the same as G2D ?
I want to get a precise calculation of the GPU.

0 Kudos