AnsweredAssumed Answered

How to set full range for yuv2rgb on GPU?

Question asked by lin ya on Aug 16, 2018
Latest reply on Aug 17, 2018 by lin ya


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)

Outcomes