AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
March 2003

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2003.03.26 12:02 "LZW and 4bit tiffs", by John Carter
2003.03.26 23:30 "Re: LZW and 4bit tiffs", by Michael Still
2003.03.27 16:38 "Re: LZW and 4bit tiffs", by John Carter

2003.03.26 12:02 "LZW and 4bit tiffs", by John Carter

Hi
 
I'm having great fun here trying to write a LZW decompression function.
I've pretty much stuck to the description given in section 13 of the tiff
spec (v6)

it goes more or less like so
1) read in a compressed strip
2) extract codes until EOI (257 dec) (keeping track of bit boundaries etc)
   the codes I'm getting out seem ok

I have 2 questions
1) should the code you extract be in the table or at least 
   if not in the table the index to where the next new string will be
   added,
2) if statement 1 is false should the new string be written to location
   table[code] or should it be written to the first available free space in 
   the table.
 
the reason i ask is that with the following sequence of code extractions and
table additions i end up adding two strings of length 0 together ( malloc 
complains about this ).
 
thanks jc
 
code        result 
256         init table
153       
258        
259
260
261
262
87
173
203
247
251
268
269
270
383 ?
253           both strings = 0 length
265
272
275
240
274
276
113
265
274
280
276
250
283
277
399 ?
286           both strings = 0 length
271
277
289
269
111
257           EOI code
  

____________________________ 

John Carter
BSS O&M Development group,
Motorola,
Mahon Industrial Estate,
Cork. 
Tel:         +353 21 4807 637 (direct)
Fax:         +353 21 4357635  ( reception )
Mobile:  +353 86 3947920
Email mailto:john.a.carter@motorola.com
www http://www.cork.cig.mot.com/~jcarte01/

Homer: There's 3 ways to do things, the right way, the wrong  way, and the
max power way.
Bart: isn't that  the wrong way.
Homer: yea but faster.