home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Acorn User 4
/
AUCD4.iso
/
acornuser
/
1998
/
apr1998
/
pd2
/
MususUmbra
/
Huffman
/
Huff_txt
< prev
Wrap
Text File
|
1998-02-17
|
3KB
|
91 lines
Huff
~~~~
Huff is a simple non-adaptive huffman en/decoder. It is supplied here so
that those who wish to may (de)compress the Automine sprites and edit them.
Please note that you must not distribute such modified files - if you want
to share your new sprites, you must extract them into (a) standalone
spritefile(s) and distribute only your work (with some instructions as to
how to install them :)
Huffman encoding is lossless in nature, but less efficient than (say) LZW
compression. Where Huffman encoding scores over LZW is that is requires
only a small fraction of the memory to compress/decompress a set of data -
hence its use in Automine.
The huff utility preserves filetype, datestamp, etc. (much as Squash does).
Encoded files are given the filetype EA4 which is unofficial (and indeed
lies in the 'generic data types' range), but I'm not aware of any
clashes. Automine uses the filetype of the sprite files to decide whether
to load then using huffman decoding, or just as plain sprites.
The two sprite files supplied are high- and low- resolution file icons for
huffman encoded data.
Use
~~~
huff compresses from one file to another. If two files are specified on
teh command line, then the must not be the same. If only one is specified,
huff will automatically substitute a scrapfile for the <outfile> and then
replace the <infile> with the scrapfile if successful.
The syntax is:
huff [-v[v]] [-d] <infile> [<outfile>]]
The options are:
-v : verbose mode. Progress reports are printed, along with
some statistics.
-vv : super-verbose mode. As -v, but additionally the character
frequencies, encoding tree and bit patters are displayed.
-d : decode (decompress). The default action is to encode.
So, to compress the file 'Foo' saving the output as 'Foo-h', you could use:
huff -v Foo Foo-h
And to decompress 'Foo-h' as 'Foo':
huff -d -v Foo-h Foo
If you specify the <outfile> as '-', output will be written to vdu:. This
is only provided so that encoded text files may be *type-d using huff.
If the <infile> is not suitable for the operation requested, an error message
is printed, but the program terminates 'successfully', eg. it won't stop
an Obey file processing.
A file is suitable for encoding if it isn't already encoded (ie. its filetype
isn't &EA4 and its first four characters aren't "HUFF"). A file is suitable
for decoding if its filetype is &EA4 and its first four bytes are "HUFF".
Licence Disclaimer
~~~~~~~~~~~~~~~~~~
(c) Musus Umbra 1997/8
This software is covered by the terms of the Acorn User PD Scheme.
Basically, this means that for three months from its publication, the
copyright in this software belongs to Acorn User.
So:
You may not distribute copies of this software within
three months of its appearance in Acorn User.
After this time, you may freely distribute *unmodified*
copies of this software.
NB: there is no warranty of any kind. The author cannot be held
responsible for any loss/damage arising from the use/inability to use
this software. It is the user's responsibility to determine the fitness
of this software for any purpose they put it to.
(But if it doesn't work, I will try to help :-)
Contact Details
~~~~~~~~~~~~~~~
e-mail: mailto:musus@argonet.co.uk
WWW : http://www.argonet.co.uk/users/musus
snail : Adny, c/o 23 Baronsway, Whitkirk, Leeds, LS15 7AW.