How to set full range for yuv2rgb on GPU?

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

How to set full range for yuv2rgb on GPU?

1,241 Views
linya
Contributor II


hardware: i.mx6q
softwart: yocto 3.14.28

GPU will convert yuv to rgb while I load texture by function glTexDirectVIVMap.
Generally this convert method is limit rang for yuv input.
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)

May I configure it as full range for yuv input?
0 <= Y <= 255
0 <= U <= 255
0 <= V <= 255
A = Y
B = U
C = V
R = clip((256*A + 292*C) >> 8)
G = clip((256*A - 100*B - 149*C) >> 8)
B = clip((256*A + 520*B) >> 8)

Labels (1)
0 Kudos
Reply
2 Replies

1,100 Views
joanxie
NXP TechSupport
NXP TechSupport

refer to the Reference Manual, chatper 31.4.1.13 YUV to RGB Conversion of R2D GPU, the range of YUV is:

16 <= Y <= 235
16 <= U <= 240
16 <= V <= 240

if you need full range, I suggest that you can use CSC of IPU, for more detailed inforamtion, pls refer the chapter 37.4.9.5 Color Space Conversion unit - CSC

0 Kudos
Reply

1,100 Views
linya
Contributor II

Hi Joan Xie,

YUV2RGB is not the final purpose.

Our application is 360 surround view.

our input  is full range yuv source.

We need to load it by GPU. But GPU is work on limit rang.

It's may cause color deflection.

0 Kudos
Reply