libredwg
[Top][All Lists]
Advanced

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

[libredwg] LZ77 Compression


From: Dave Coventry
Subject: [libredwg] LZ77 Compression
Date: Wed, 12 Sep 2012 20:17:15 +0200

Can someone assist me on decoding LZ77 compression?

I am trying to read a 2007 dwg file.

I have extracted the header information at address 0x80 and have
selected every third byte which I have stored in a data array.

The array has the following information beginning at byte 32:

0x20,0x0,0x0,0x2,0x0,0x70,0x60,0x2,0xA6,0xA0,0x67,0x0,0x1,0xA6,0x15,0xED,0x7D,0x6D,0x62,0xE6,0x9,0x7F,0x77,0x8,0x2,0x4,
...

Reading the sourcecode decode_r2007.c:

unsigned char opcode = *src++;

  if ((opcode & 0xf0) == 0x20)
    {
      src += 2;
      length = *src++ & 0x07;

      if (length == 0)
        return 1;
    }

opcode is indeed 0x20, and length is 2.

But where to next? I suppose I'm a little confused by the pointer
programming, and I can't work out the process.

Thank you,

Dave Coventry



reply via email to

[Prev in Thread] Current Thread [Next in Thread]