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

Re: qcam on NetBSD



Thomas Davis writes:
 > Russ Nelson writes:
 > 
 > Where the code gets slow is the decoding of the 6bpp/uni-directional mode
 > and the 4bpp/bi-directional mode.  The nybble packing just kills things..
 > (but makes for a fast transfer..)

Problem is that the stupid 386 doesn't have a barrel shifter (shifts
any number of bits in one cycle).  Problem is the 6bpp mode has to
convert three 8-bit bytes into four 6-bit bytes, right?  So burn some
memory.  Build one 256-byte table and two 64Kbyte tables.  Index into
them using the three bytes in turn.  The 4bpp mode is even easier.

Hand-coded, optimized assembler will get you twice the speed of a C
compiler's code.

-russ <nelson@crynwr.com>    http://www.crynwr.com/~nelson
Crynwr Software   | Crynwr Software sells packet driver support | PGP ok
11 Grant St.      | +1 315 268 1925 voice | Good government is a contradiction
Potsdam, NY 13676 | +1 315 268 9201 FAX   | in terms.  Ask me for details.

Follow-Ups: References: