{"id":99,"date":"2005-07-27T22:09:39","date_gmt":"2005-07-28T04:09:39","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/?p=99"},"modified":"2006-05-18T10:43:23","modified_gmt":"2006-05-18T17:43:23","slug":"implementing-a-testbed-for-the-palettized-animation-video-codec","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/implementing-a-testbed-for-the-palettized-animation-video-codec\/","title":{"rendered":"Implementing A Testbed For The Palettized Animation Video Codec"},"content":{"rendered":"<p>I decided it is time to stop talking about what I going do and start talking about how I am going to do it. I want to try my hand at creating a new video codec. This is my first attempt at such a feat. I need to write both the encoder and decoder simultaneously. I need to develop some idea about which coding theories I wish to test and how I will go about testing them. I need test vectors for encoding.<\/p>\n<p>But first and foremost, I need a name for this new codec. I have decided on &#8220;Palettized Animation Video Codec.&#8221; That is what its name shall be unless someone can come up with a better name. The fourcc shall be &#8216;PAVC&#8217; which is yet unclaimed (although &#8216;PDVC&#8217; is claimed according to fourcc.org). Since this is an article about PAVC, I need to lead in with some cool shots of old video games, if only as a reminder of this endeavor&#8217;s challenge:<\/p>\n<p><center><\/p>\n<table>\n<tr>\n<td align=\"center\">\n<em><a href=\"http:\/\/www.mobygames.com\/game\/nes\/crystalis\">Crystalis, NES<\/a><br \/>\nWidely regarded as the finest video game ever produced<\/em><br \/>\n<br \/>\n<img decoding=\"async\" src=\"\/eggs\/images\/crystalis.png\" alt=\"Crystalis\" \/>\n<\/td>\n<td align=\"center\">\n<img decoding=\"async\" src=\"\/eggs\/images\/solarjetman.png\" alt=\"Solar Jetman\" \/><br \/>\n<br \/>\n<em><a href=\"http:\/\/www.mobygames.com\/game\/nes\/solar-jetman-hunt-for-the-golden-warpship\">Solar Jetman, NES<\/a><br \/>\nPerhaps the toughest Nintendo game to get the hang of<\/em>\n<\/td>\n<\/tr>\n<\/table>\n<p><\/center><\/p>\n<p><!--more--><\/p>\n<p>Things I need to start this experiment:<\/p>\n<ul>\n<li><strong>Test vectors:<\/strong> I need some sample media to encode.<br \/>\n<strong>Done:<\/strong> I have already used emulator tools to capture raw RGBA32 video frames into AVI files. I have test vectors from NES and SNES games. And I can easily generate many more, hard drive space permitting (1 second of a raw NES video requires over 14 megabytes).<\/li>\n<li><strong>Codec development infrastructure:<\/strong> I am using the <a href=\"http:\/\/ffmpeg.sourceforge.net\">FFmpeg<\/a> open source project for developing this codec. As a first step, I will make a stand-in codec module that is actually identical to RGBA32. The codec skeleton will simply be a passthrough and will not modify the video data in any way.<\/li>\n<li><strong>Codec validation infrastructure:<\/strong> Write out a sequence of RGB bitmaps generated from the raw test vectors. Develop a method for validating whether the new encode->decode process yields the same data.<\/li>\n<li><strong>Develop a palette transport model:<\/strong> The first step of encoding the first frame of video (or a keyframe) will be to build a new palette based on the new data. Do this by scanning the first frame&#8217;s pixels and storing each new color. Also, count each palette occurrence since this data might be useful in later video coding concepts. After settling on a palette table, figure out the minimum number of bits needed to represent the palette index. For example, an NES frame should have no more than 32 unique colors. Thus, a palette index (frame pixel) only needs 5 bits of resolution. Next, convert the frame to a palette index map.<\/li>\n<li><strong>Develop a basic coding model:<\/strong> Encode a keyframe with a header that specifies number of colors to unpack and the resolution of pixel indices. Encode each pixel using that number of bits. Write a decoder to take apart the basic keyframe.<\/li>\n<\/ul>\n<p><em>Screenshots from the <a href=\"http:\/\/www.mobygames.com\">MobyGames database<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Getting this new codec concept off the ground&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,20],"tags":[],"class_list":["post-99","post","type-post","status-publish","format-standard","hentry","category-open-source-multimedia","category-pavc"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/comments?post=99"}],"version-history":[{"count":0,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/99\/revisions"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}