home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 4 / AUCD4.iso / acornuser / 1998 / apr1998 / pd2 / MususUmbra / Huffman / Huff_txt < prev   
Text File  |  1998-02-17  |  3KB  |  91 lines

  1. Huff
  2. ~~~~
  3.  
  4. Huff is a simple non-adaptive huffman en/decoder.  It is supplied here so
  5. that those who wish to may (de)compress the Automine sprites and edit them.
  6.  
  7. Please note that you must not distribute such modified files - if you want
  8. to share your new sprites, you must extract them into (a) standalone
  9. spritefile(s) and distribute only your work (with some instructions as to
  10. how to install them :)
  11.  
  12. Huffman encoding is lossless in nature, but less efficient than (say) LZW
  13. compression.  Where Huffman encoding scores over LZW is that is requires
  14. only a small fraction of the memory to compress/decompress a set of data -
  15. hence its use in Automine.
  16.  
  17. The huff utility preserves filetype, datestamp, etc. (much as Squash does).
  18.  
  19. Encoded files are given the filetype EA4 which is unofficial (and indeed
  20. lies in the 'generic data types' range), but I'm not aware of any
  21. clashes.  Automine uses the filetype of the sprite files to decide whether
  22. to load then using huffman decoding, or just as plain sprites.
  23.  
  24. The two sprite files supplied are high- and low- resolution file icons for
  25. huffman encoded data.
  26.  
  27. Use
  28. ~~~
  29. huff compresses from one file to another.  If two files are specified on
  30. teh command line, then the must not be the same.  If only one is specified,
  31. huff will automatically substitute a scrapfile for the <outfile> and then
  32. replace the <infile> with the scrapfile if successful.
  33.  
  34. The syntax is:
  35.         huff [-v[v]] [-d] <infile> [<outfile>]]
  36.  
  37. The options are:
  38.         -v  : verbose mode.  Progress reports are printed, along with
  39.               some statistics.
  40.         -vv : super-verbose mode.  As -v, but additionally the character
  41.               frequencies, encoding tree and bit patters are displayed.
  42.         -d  : decode (decompress).  The default action is to encode.
  43.  
  44. So, to compress the file 'Foo' saving the output as 'Foo-h', you could use:
  45.         huff -v Foo Foo-h
  46. And to decompress 'Foo-h' as 'Foo':
  47.         huff -d -v Foo-h Foo
  48.  
  49. If you specify the <outfile> as '-', output will be written to vdu:.  This
  50. is only provided so that encoded text files may be *type-d using huff.
  51.  
  52. If the <infile> is not suitable for the operation requested, an error message
  53. is printed, but the program terminates 'successfully', eg. it won't stop
  54. an Obey file processing.
  55.  
  56. A file is suitable for encoding if it isn't already encoded (ie. its filetype
  57. isn't &EA4 and its first four characters aren't "HUFF").  A file is suitable
  58. for decoding if its filetype is &EA4 and its first four bytes are "HUFF".
  59.  
  60.  
  61.  
  62. Licence Disclaimer
  63. ~~~~~~~~~~~~~~~~~~
  64. (c) Musus Umbra 1997/8
  65.  
  66. This software is covered by the terms of the Acorn User PD Scheme.
  67. Basically, this means that for three months from its publication, the
  68. copyright in this software belongs to Acorn User.
  69.  
  70. So:
  71.         You may not distribute copies of this software within
  72.         three months of its appearance in Acorn User.
  73.  
  74.         After this time, you may freely distribute *unmodified*
  75.         copies of this software.
  76.  
  77.  
  78. NB: there is no warranty of any kind.  The author cannot be held
  79. responsible for any loss/damage arising from the use/inability to use
  80. this software.  It is the user's responsibility to determine the fitness
  81. of this software for any purpose they put it to.
  82.  
  83. (But if it doesn't work, I will try to help :-)
  84.  
  85.  
  86. Contact Details
  87. ~~~~~~~~~~~~~~~
  88. e-mail: mailto:musus@argonet.co.uk
  89. WWW   : http://www.argonet.co.uk/users/musus
  90. snail : Adny, c/o 23 Baronsway, Whitkirk, Leeds, LS15 7AW.
  91.