From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: 3717dac89a,32247abf28da27d4 X-Google-Attributes: gid3717dac89a,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!news-out.readnews.com!news-xxxfer.readnews.com!panix!usenet.stanford.edu!news.ucr.edu!news.jpl.nasa.gov!nntp-server.caltech.edu!not-for-mail From: glen herrmannsfeldt Newsgroups: alt.sys.pdp11,comp.sys.dec,comp.os.vms Subject: Re: QBUS Prototyping Date: Thu, 29 Apr 2010 18:38:52 +0000 (UTC) Organization: California Institute of Technology, Pasadena Message-ID: References: <8265dgFs33U3@mid.individual.net> <4dff54d9-dfc7-4d90-9307-995e5d96e53f@y36g2000yqm.googlegroups.com> <4bd96b18$0$281$14726298@news.sunsite.dk> NNTP-Posting-Host: thalia.ugcs.caltech.edu X-Trace: naig.caltech.edu 1272566332 13004 131.215.176.116 (29 Apr 2010 18:38:52 GMT) X-Complaints-To: abuse@caltech.edu NNTP-Posting-Date: Thu, 29 Apr 2010 18:38:52 +0000 (UTC) User-Agent: tin/1.9.3-20080506 ("Dalintober") (UNIX) (Linux/2.6.26-2-686 (i686)) Xref: g2news2.google.com alt.sys.pdp11:1521 comp.sys.dec:1982 comp.os.vms:30674 In alt.sys.pdp11 Jerome H. Fine wrote: (snip related to Fortran and virtual arrays) > As for the compression algorithm itself, can anyone provide some > information on just how that 128 KB table is accessed? > READ ONLY? Random? Sequential? Same on decompression? > It would make a big difference if the access was sequential, > but somehow it would seem that it must be random access to > that 128 KB table and maybe the table even gets altered as > the algorithm progresses through the input file? For compression, it generates a tree structure based on what it has seen so far. Last time I looked into this was compress.c, in the days before gzip. If I put compress.c into google, the second hit, the one with actual source, comes from apple.com. It is copyright University of California 1986, last changed in 1985. It seems I wasn't quite right on the 128K. The compression table needs 2**BITS words, each of which holds a value between -1 and 2**BITS-1, such that the usual implementation (with #ifdef) uses (int) (16 bits on smaller machines in 1985) for BITS<16, and (long int) for BITS==16. One might be able to do that with a 65536 entry table of 16 bit integers, and a 65536 bit table indicating which entries where -1 to save memory. There is even an #ifdef pdp11 which sets BITS to 12. > While I am not about to implement the code, it would help to > know the characteristics of what is being discussed. The basic idea is to build a tree structure based on substrings previously seen. If you find one again, point to the tree entry, otherwise add a new entry to the tree. Well, that isn't quite right because the new entry, pointing to the previous substring, is also added to the tree. I think that means that for each character input you read one tree entry. When you find a substring not previously seen, write one tree entry. For compression, there is not much reason not to use BITS==12. The files will be a little larger, but the 16 bit decompression program will still be able to decompress them. The 12 bit decompression program, though, won't be able to decompress files with BITS==16. -- glen