Hi !

> > the conversion YUV -> RGB for every pixel in _software_.
> How is the YUV format layed out btw?

Well basically the conversion matrixes for RGB <-> YUV are:

y      0.299   0.587   0.114    R
u  =  -0.1687 -0.3313  0.5    . G
v      0.5    -0.4187 -0.0813   B

Inverse:

R      1  0        1.402        Y
G  =   1 -0.34414 -0.71414    . U
B      1  1.772    0.0          V

The u/v parameters are signed, i.e. UV=+-128 !

While RGB->YUV is overflow-free by design, YUV->RGB needs clamping to avoid 
overflows.

This should theretically be an operation that is boosted by all those 
multimedia processor extensions.

In case you are more interested in the layout of the data structures:
Common structs are either separated y,u,v arrays, with u,v 1:2 subsampled,
as the eye isn't particularly sensitive to the color transitions as compared 
to brightness edges, or something like yuyv in various permutations, so you 
only have a 1:2 subsampling in one axis.

CU, ANdy

-- 
Andreas Beck              |  Email :  <[EMAIL PROTECTED]>

Reply via email to