[Libdlo] tubecable 0.1 - a low-level library for Displaylink devices with compression support
Florian Echtler
floe at butterbrot.org
Mon Jun 1 08:39:25 PDT 2009
Hello Phil,
> > If no-one else is volunteering I'll have a go at turning your
> > compression code into something more efficient, i.e. a binary table.
> I've been having a go at this but a couple of things have become apparent:
> - It is not entirely obvious what Florian's code actually does; just as
> I think I understand it I discover another "if (x%256==0)..." somewhere
> that adds another level of implicit looping. What we really need first
> is some documentation of what the format actually is.
Eh, sorry. I totally forgot about that, and when I re-read my code now,
I also get the impression that the comments only help when you already
know what it does.
I'll try to describe the basic algorithm briefly. Every compressed block
is 512 bytes long and ends with the register sequence AF20FFFF (kind of
a internal sync sequence). Therefore, 508 bytes are available for
compressed data, including headers. As one header can describe up to 256
pixels != bytes, it's a bit complicated.
So the main loop puts in a graphics data header and starts encoding
pixels until either a) the entire block is full or b) the maximum of 256
pixels has been encoded, which means that a new graphics data header is
necessary. As you can't know how many pixels can be encoded until you
reach the end of the block, a pointer to the pixel count value of the
last graphics data header needs to be maintained. When the entire block
is full, then this pointer is used to adjust the pixel count.
As an additional precaution, a new graphics data header is put in 20
bytes before the block ends to avoid running out of space for a new
header (if a new header would be necessary after, e.g. 504 bytes, then
it wouldn't fit in anymore).
Finally, the sync sequence is put into the last 4 bytes and the block is
done.
> - It would be great to have some version control for Florian's (and
> also Roberto's) work.
About 2 days before libdlo was announced, I registered a Sourceforge
project called simply "displaylink" for exactly that purpose. It's been
sitting unused since then, but that can change - just send me your
SF.net accounts and I'll add them to the project. This applies to
everybody who'd like to participate, of course.
> I think both of these need to be addressed before I can do anything else.
Quite right..
Yours, Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://lists.freedesktop.org/archives/libdlo/attachments/20090601/16136c84/attachment.pgp
More information about the Libdlo
mailing list