Scott T: The Blog

Un-Decoding VDXs

Posted Mon, Dec 21, 2009 at 5:20pm by Scott
Tagged: programming, scummvm

The usual direction when adding support for T7G and 11H to ScummVM is to take the data files, decode them, and get the video and/or audio out of them. Last week in a moment of boredom, curiosity, and 'how hard can it be?', I decided to work on working on going the opposite direction and have a look at encoding instead.

As it turns out, still frames were fairly straight-forward to implement due to the simple structure.

Animation frames were a little harder. Most of the issues resolved to be related to how I was attempting to keep track of palette changes between frames (and the rewriting of the new frame to line up colours common between both palettes but at differing indices), but I also got caught up in some minor logic errors in the encoder (in particular, encoding the same tile using two different methods, and requiring a "new line" opcode at the end of *every* line - not just those that end early). The final result can be found at this YouTube video (sorry - no embedding, since my blog doesn't support it).

Encode speeds currently aren't the greatest yet, the output VDX files are not compressed, and the encoder requires 8bpp Indexed BMPs for use as input, but it's certainly a start for proof-of-concept purposes :)


There are no comments posted yet.
Post a comment
Name to list as author of the comment.
Your email. Will be kept private.
Website to link your name to. Optional.
Plain text only - no HTML markup
Spam Count 
  • 1854 spam comments
Boring Stuff 

The images shown on this site are ones myself or family members have taken (unless otherwise noted). Don't use them unless you let us know - leave a comment somewhere as I'll usually find it.

Things I write can be used as quotes elsewhere however as long as they are attributed to me (preferably with a link and a comment somewhere that you've used it).