A82: ZCP for Sam


[Prev][Next][Index][Thread]

A82: ZCP for Sam




here's a good explanation of the purpose of ZCP and EZCMP (another
compressor) for you, Sam....

for everyone else, you may now either read if you too do not understand,
or you may just delete this if you do.

Here's the explanation from EZCMP (as you can no doubtably see):

o  What is EZCMP?
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
EZCMP was originally a compression system for ZShell on the TI85
calculator.
EZCMP has been ported for use with the TI-82 calculator by Wouter
Demuynck.
It can be used to compress pictures, level data, maps or whatever data
that needs to be compressed.
Porting was actually a very easy thing to do so all the credits should 
still go to Chris Busch. The only thing that I (Wouter) had to change was
the multiple pass decoder. I also tried to optimize things as much as 
possible and updated all docs. The decoder is now about 20 bytes smaller.


o  How does it work?
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
Knowing that nibbles take up less space bytes, EZCMP converts bytes
to nibbles!  But you think: wouldn't that make EZCMP only have a maximum
of 50% compression, since a nibble is 4 bits and a byte is 8 bits?
Nope, because unlike RLE, EZCMP can be applied recursively to achieve
very good compression ratios.  



o How is it encoded?
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
The header of the encoded data stream is as follows.  The first byte
contains the number of passes the compressor did make and the decoder
will make.  The next two bytes describe the size of the input to the
previous pass of the compressor.  The next 15 bytes is the high
frequency look up table.

The rest of the encoded data can be one or more of the following
sequences
of bytes:

     NnnnNnnn
 Where Nnnn is a 0-14 value used to fetch a byte from the 15 byte look up
 table.

     Nnnn1111 Vvvvvvvv
 Where 1111, "shift", indicates the next byte should be outputted.

     1111CCCC Xxxxxxxx ... Xxxxxxxx
 Here the "shift" nibble is followed by a count of 1-16 that signifies
 how many bytes need to be outputted.



o How do I use EZCMP?
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
Use EZCMP.exe to compress your raw binary file that represents the
data that you what to be compressed.

           EZCMP -options input.obj output.asm

Then look at the example program, EZCMPEX.ASM, to see how to use your
output.asm file.  Check your output.asm file to see if you achieved
any compression.  If you did not, try ZCP.EXE (should be available in
this package) or no compression technique at all.  EZCMP is not suppose 
to replace ZCP, so try both and see which one works better for the data 
that you are using at the moment.




o How about more detailed instructions?
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
                            For pictures:
Create your picture using Paint Shop Pro for Windows (a downloadable
shareware paint program) or some other program that can produce .PBM
files.  Save your pictures as portable bitmap files.  Then run
cmppbm.bat on your .pbm file, do so like so (notice there isn't an
extension on mypic):
                          
                          CmpPBM mypic

Now you have a compressed picture!

(for the TI82, make your picture 96x64 BW)
(for the TI85, make your picture 128x64 BW)

                           For other data:
Create a .asm file using .db and .dw describing the data you want to be
compressed.  Use CmpAsm.bat like so:
              CmpAsm infile outfile
(Do not use extensions with these .bat files.)  CmpAsm will
produce outfile.asm that will be your compressed data.

Note : You will need TASM in the same directory or in the path if
       you want to use the CmpPBM.bat and CmpAsm.bat files


_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]