{"id":28,"date":"2009-12-21T17:58:43","date_gmt":"2009-12-21T17:58:43","guid":{"rendered":"https:\/\/blogs.scummvm.org\/st\/?p=28"},"modified":"2022-05-23T18:00:12","modified_gmt":"2022-05-23T18:00:12","slug":"un-decoding-vdxs","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/st\/2009\/12\/21\/un-decoding-vdxs\/","title":{"rendered":"Un-Decoding VDXs"},"content":{"rendered":"<p>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 &#8216;how hard can it be?&#8217;, I decided to work on working on going the opposite direction and have a look at encoding instead.<\/p>\n<p>As it turns out, still frames were fairly straight-forward to implement due to the simple structure.<\/p>\n<p><a href=\"https:\/\/blogs.scummvm.org\/st\/wp-content\/uploads\/sites\/40\/2009\/12\/154.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-31\" src=\"https:\/\/blogs.scummvm.org\/st\/wp-content\/uploads\/sites\/40\/2009\/12\/154.jpg\" alt=\"\" width=\"656\" height=\"518\" srcset=\"https:\/\/blogs.scummvm.org\/st\/wp-content\/uploads\/sites\/40\/2009\/12\/154.jpg 656w, https:\/\/blogs.scummvm.org\/st\/wp-content\/uploads\/sites\/40\/2009\/12\/154-300x237.jpg 300w\" sizes=\"auto, (max-width: 656px) 100vw, 656px\" \/><\/a>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 &#8220;new line&#8221; opcode at the end of *every* line &#8211; not just those that end early). The final result can be found at <a href=\"https:\/\/web.archive.org\/web\/20120320103227\/http:\/\/www.youtube.com\/watch?v=nyrGCol-fY0\">this<\/a> YouTube video (sorry &#8211; no embedding, since my blog doesn&#8217;t support it).<\/p>\n<p>Encode speeds currently aren&#8217;t the greatest yet, the output VDX files are not compressed, and the encoder requires 8bpp Indexed BMPs for use as input, but it&#8217;s certainly a start for proof-of-concept purposes \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8216;how hard can it be?&#8217;, I decided to work on working on going the opposite direction and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-28","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/st\/wp-json\/wp\/v2\/posts\/28","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/st\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/st\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/st\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/st\/wp-json\/wp\/v2\/comments?post=28"}],"version-history":[{"count":2,"href":"https:\/\/blogs.scummvm.org\/st\/wp-json\/wp\/v2\/posts\/28\/revisions"}],"predecessor-version":[{"id":32,"href":"https:\/\/blogs.scummvm.org\/st\/wp-json\/wp\/v2\/posts\/28\/revisions\/32"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/st\/wp-json\/wp\/v2\/media?parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/st\/wp-json\/wp\/v2\/categories?post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/st\/wp-json\/wp\/v2\/tags?post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}