How to set full range for yuv2rgb on GPU?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to set full range for yuv2rgb on GPU?

1,245件の閲覧回数
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)

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

1,104件の閲覧回数
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 件の賞賛
返信

1,104件の閲覧回数
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 件の賞賛
返信