From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9cecf056761bd1d9 X-Google-Attributes: gid103376,public From: tojst1+@pitt.edu (Tore Joergensen) Subject: Re: Data compression (in Ada) Date: 1996/06/29 Message-ID: <4r200g$lh6@usenet.srv.cis.pitt.edu>#1/1 X-Deja-AN: 162694569 references: <31D41C54.794BDF32@mailgw.sanders.lockheed.com> organization: University of Pittsburgh newsgroups: comp.lang.ada Date: 1996-06-29T00:00:00+00:00 List-Id: Mike Roske (mroske@mailgw.sanders.lockheed.com) wrote: : I am looking for an Ada 83 implementation of a file : compression/decompression algorithm (a la Zip). It doesn't have to be : compatible with Zip. : I have a need to take a file, compress it, and store it on an embedded : file system (part of the load process). At run-time I will be : uncompressing the file into RAM in order to access the data. There : isn't enough EEPROM to store the uncompressed file, but I have enough : RAM once I get started. Try to find some information on LZW compression. This is the compression algorithm Zip is based on, and it's fairly easy to implement. I'd recommend to use a table index-size of two bytes and a data-size of one byte (then you will avoid having to shift the bits), unless this doesn't make sense for your program. I made a LZW compression program in Ada as an assignment in a course, but I don't have the code anymore. It is really easy to implement, and the nice thing about it is that it builds the compression-table while you write and read the file, so you don't have to store the table with the file. -- +-------------------------+-------------------------------------------+ | Tore B. Joergensen | e-mail : tore@lis.pitt.edu | | Centre Court Villa | web : http://www.pitt.edu/~tojst1 | | 5535 Centre Avenue # 6 | | | Pgh, PA 15232, USA | Norwegian MSIS-student at Univ. of Pgh. | +-------------------------+-------------------------------------------+