Jun 022015

DPOver the last few months I have been performing some Dark Arts conjuring and raising from the dead some of my old tools. I’ve been getting them functional on the 64 bit architecture and giving them a new graphical interface, I’ve also started adding some new features that have been sitting at the back of my head for way too many years.

During this process I needed to rewrite the Deluxe Paint Animator decoder (because hey why not!)… this is for the vintage .ANM file format from about 20 years ago. During the resurrection of this decoder I wanted to verify the details of the compression technique which is called RunSkipDump, I was a little disappointed to discover that this information wasn’t being preserved somewhere online so in an attempt to record how to decode this data I have written up a few notes below, hopefully they might prove useful to someone in the future.

The data stream is encoded as an indexed bitmap meaning the output data is 1 byte per pixel (0-255) which is used to lookup the real colour value from a palette.

Loop the following until you have decoded the expected number of pixels for the bitmap (usually width * height) or until you hit the end terminator of the data.

read byte
if byte is positive
   perform dump - copy that many pixels from the stream.
if byte is 0
   read byte - length
   read byte - pixel
   perform run - duplicate the read pixel for the specified length.
clear bit 7.
if byte is 0
   load word
   if word is > 0
      perform skip of the (read word) length
   if word is < 0
      clear word bit 15
      if word bit 14 set
         Clear bit 14
         Read byte pixel.
         perform run - duplicate the read pixel for the (word) length
         Perform Copy word length number of bytes (pixels)
   Quit. Your done - no more data to read.
perform skip byte length

Hopefully this helps to keep the information alive for others.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>