On Wed, 28 Mar 2001, Colin Shaw wrote:
> converting from say RGB888 to YUV420 where the space spanned by the result
> is significantly smaller than that of the original.  It would appear that
> this lookup table would require about 2^24 entries and would only map to
> 64 possible YUV420 colors.  Do you apply granularity to the RGB888
> pointers so that it doesn't hog so much memory?  Are there any obvious
> shortcuts that I am overlooking?

The standard way it to use 9 tables of 256 entries, one for each combination
of (R, G, B) with (Y, U, V).  Then you do something like

Y = R_to_Y[R] + G_to_Y[G] + B_to_Y[B];
U = R_to_U[R] + G_to_U[G] + B_to_U[B];
V = R_to_V[R] + G_to_V[G] + B_to_V[B];

So instead of one table lookup, in a huge table, you do 9 lookups plus a few
additions.  For more accuracy you would probably want to use fixed point
arithmetic.  You don't need all 9 tables either, as some of them will end up
being the same.



_______________________________________________
Video4linux-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/video4linux-list

Reply via email to