Re: Webcam (V4L-V4L2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Trent Piepho wrote:

> 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.

Yep, I scale all my precomputed tables up by 256, so it's all 16 bit integer
additions rather than floating point, and then / 256 (>> 8) afterwards. I
package it up as sample-at-a -time in-line conversion functions (effectively
macros), so the net result is actually probably fairly competetive with an MMX
conversion.

Ben







[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux