<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Breaking Eggs And Making Omelettes &#187; On2/Duck</title>
	<atom:link href="http://multimedia.cx/eggs/category/reverse-engineering/on2duck/feed/" rel="self" type="application/rss+xml" />
	<link>http://multimedia.cx/eggs</link>
	<description>Topics On Multimedia Technology and Reverse Engineering</description>
	<lastBuildDate>Thu, 26 Jan 2012 18:47:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WebM Cabal</title>
		<link>http://multimedia.cx/eggs/webm-cabal/</link>
		<comments>http://multimedia.cx/eggs/webm-cabal/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 06:05:59 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[On2/Duck]]></category>
		<category><![CDATA[VP8]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/?p=2941</guid>
		<description><![CDATA[Non-details from the WebM meeting]]></description>
			<content:encoded><![CDATA[<p>I traveled to a secret clubhouse today to take part in a clandestine meeting to discuss exactly how WebM will rule over all that you see and hear on the web. I can&#8217;t really talk about it. But I can show you the cool hat I got:</p>
<p><center><br />
<img src="http://multimedia.cx/eggs/wp-content/uploads/2010/10/webm-schwag.jpg" alt="" title="WebM hat" width="300" height="286" class="aligncenter size-full wp-image-2942" /><br />
<em>Yeah, you&#8217;re jealous.</em><br />
</center></p>
<p>The back of the hat has an Easter egg for video codec nerds&#8211; the original Duck Corporation logo (<a href="http://multimedia.cx/eggs/reflections-on-on2/">On2&#8242;s original name</a>):</p>
<p><center><br />
<img src="http://multimedia.cx/eggs/wp-content/uploads/2010/10/webm-schwag-duck-logo.jpg" alt="" title="WebM hat feature the Duck Corporation logo" width="300" height="248" class="aligncenter size-full wp-image-2945" /><br />
</center></p>
<p>Former employees of On2 (now Googlers) were well-represented. It was an emotional day of closure as I met the person &#8212; the only person to date &#8212; who <a href="http://multimedia.cx/eggs/legal-threat-00001/">contacted me with a legal threat</a> so many years ago. He still remembered me too.</p>
<p>I met a lot of people involved in creating various Duck and On2 codecs and learned a lot of history and lore behind then&#8211; history I hope to be able to <a href="http://wiki.multimedia.cx/">document</a> one day.</p>
<p>I&#8217;m glad I got that <a href="http://multimedia.cx/eggs/the-worst-vp8-encoder/">first rough draft of a toy VP8 encoder</a> done in time for the meeting. It was the subject of much mirth.</p>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/webm-cabal/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>VP8: The Savior Codec</title>
		<link>http://multimedia.cx/eggs/vp8-the-savior-codec/</link>
		<comments>http://multimedia.cx/eggs/vp8-the-savior-codec/#comments</comments>
		<pubDate>Sat, 17 Apr 2010 05:52:56 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Multimedia PressWatch]]></category>
		<category><![CDATA[On2/Duck]]></category>
		<category><![CDATA[VP8]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/?p=2400</guid>
		<description><![CDATA[What is VP8? What do you want it to be?]]></description>
			<content:encoded><![CDATA[<p>This past week, the internet picked up &#8212; <a href="http://tech.slashdot.org/story/10/04/13/0141208/Google-to-Open-Source-the-VP8-Codec?from=rss">and subsequently</a> <a href="http://www.theregister.co.uk/2010/04/13/reports_says_google_will_open_source_on2_codec_in_may/">sprinted like</a> <a href="http://arstechnica.com/open-source/news/2010/04/google-planning-to-open-the-vp8-video-codec.ars">a cheetah with</a> &#8212; <a href="http://newteevee.com/2010/04/12/google-to-open-source-vp8-for-html5-video/">an unsourced and highly unsubstantiated rumor that Google will open source the VP8 video codec</a>, recently procured through their <a href="http://multimedia.cx/eggs/on2-acquisition/">On2 acquisition</a>. I wager that the FSF is already working on their press release claiming full credit should this actually come to pass. I still retain my &#8220;I&#8217;ll believe it when I see it&#8221; attitude. However, I thought this would be a good opportunity to consolidate all of the public knowledge regarding On2&#8242;s VP8 codec.</p>
<p><center><br />
<img src="http://multimedia.cx/eggs/wp-content/uploads/2010/04/vp8vsh264.jpg" alt="" title="VP8 vs. H.264" width="530" height="264" class="aligncenter size-full wp-image-2402" /><br />
<em>Pictured: All the proof you need that VP8 is superior to H.264</em><br />
<em>Update: The preceding comment is meant in sarcastic jest. Read on</em><br />
</center></p>
<p><strong>The Official VP8 Facts:</strong><br />
<span id="more-2400"></span></p>
<ul>
<li>VP8 is superior to H.264. Source: <a href="http://www.on2.com/index.php?603">On2&#8242;s website, many PSNR graphs</a>.</li>
<li>VP8 is free from patent worries. Source: <a href="http://www.on2.com/index.php?599">On2&#8242;s website</a> (&#8220;no patent-pool royalty hassles&#8221;).</li>
<li>VP8 delivers objectively better visual quality than H.264 at the same bitrate. Source: <a href="http://www.on2.com/index.php?599">Video encoded in On2 VP6, created by On2, posted on On2&#8242;s website</a>.</li>
<li>VP8 can be implemented on low-power hardware. Source: <a href="http://www.dspdesignline.com/showArticle.jhtml?articleID=214303691">DSP Design Line article authored by On2&#8242;s CTO</a>.</li>
<li>VP8 uses golden frames (just like every On2 video codec since VP3). Source: <a href="http://www.on2.com/index.php?602">On2&#8242;s website</a>.</li>
<li>VP8 uses loop filtering (another cornerstone of every On2 video codec since VP3). Source: <a href="http://www.on2.com/index.php?601">On2&#8242;s website</a>.</li>
<li>VP8 is scalable to many cores. Source: <a href="http://www.on2.com/index.php?604">On2&#8242;s website</a>.</li>
<li>VP8 produces objectively better results than even x264. Source: Again, <a href="http://www.on2.com/index.php?603">On2&#8242;s website</a>. Sorry, my <a href="http://x264dev.multimedia.cx/">x264 pals</a>, but <a href="http://www.stickergiant.com/charts-and-graphs_d49.html">they have charts and graphs to back them up, so, you know&#8230;</a></li>
</ul>
<p>That&#8217;s pretty much all we know about On2 VP8. Notice a common theme? That&#8217;s right: Everything we know about On2 VP8 comes from On2&#8242;s own publicity material. As of yet, we have no samples encoded in the format, and we certainly don&#8217;t have any public encoders or decoders.</p>
<p>So, yeah, you can write me off as being consistently annoyed when the VP8 topic crops up. Take a look at the subtitle of this blog: &#8220;Topics on multimedia&#8230;&#8221; Codecs are my business (well, hobby, anyway) and my multimedia pals and I have <a href="http://wiki.multimedia.cx/index.php?title=Category:Video_Codecs">cataloged <strong>around 200 different video codecs</strong></a> on our little wiki. Call us codec snobs but we like to know technical details surrounding codecs. Or, failing that, we like to have samples we can study along with maybe a binary decoder and/or encoder so we can evaluate the suitability of the codec for certain tasks. Thus far, all we have to go on is On2&#8242;s own word about how awesome their technology is. It&#8217;s a bit odd to see so many people taking a (non-Apple) company&#8217;s claims at face value.</p>
<p>Do you believe the marketing material? As a baseline, you&#8217;re invited to read the <a href="http://multimedia.cx/mirror/vp6-white-paper.pdf">VP6</a> and <a href="http://multimedia.cx/mirror/vp7-white-paper.pdf">VP7 whitepapers</a> which provide similar objective proof of those algorithms&#8217; superiority over H.264 and other standard codecs.</p>
<p><strong>Different Requirements</strong><br />
From most of the stuff I have been reading (articles, blog posts, and ensuing comment debates), people are lapping up the marketing material. I was incredulous until I realized that most of these observers are simply interested in different things than I am.</p>
<p>I &#8212; and, I suspect, many of my multimedia colleagues &#8212; are salivating for some more solid technical details surrounding this codec. It&#8217;s what we live for. I need to recognize that most outside observers take the view that a video codec is a video codec is a video codec, i.e., they&#8217;re all <a href="http://multimedia.cx/eggs/of-filesystems-and-codecs/">more or less the same and fairly interchangeable</a>. The hope is that On2 VP8 will, at long last, provide patent and license purity that all relevant stakeholders (Google, Apple, Microsoft, Mozilla) will be able to agree on. Quality? That would be nice too, but it seems to be a foregone conclusion that VP8 offers more than enough quality, especially when considering that Theora is based on VP3, which many consider good enough, and VP8 has a higher number than VP3. Ergo, VP8 must be 5 times better than VP3/Theora. Or 5 more better. Or something. And besides, On2&#8242;s own marketing materials explicitly state that VP8 is better than H.264.</p>
<p><strong>Flash-Killa</strong><br />
It would be disingenuous to omit the Flash-killer angle driving so much of the fervent anticipation surrounding the VP8 speculation. VP8 goes open source =&gt; all major browsers adopt it overnight as a standard video codec for HTML5 video =&gt; blight of Adobe Flash is eradicated the following week, since Flash&#8217;s only use is as a naive video player. Things move just that quickly. <a href="http://multimedia.cx/eggs/htmlol5-video/">I&#8217;ve covered this ground already</a>, i.e., how all of this HTML5 stuff is totally going to crush <a href="http://blogs.adobe.com/penguin.swf/">the stuff I work on at my day job</a>.</p>
<p><strong>What Is It, Really?</strong><br />
There&#8217;s too much speculation out there surrounding On2 VP8&#8230; but that won&#8217;t stop me from adding my own: Since, to my knowledge, VP8 has never actually been licensed or used outside of On2, the engineers could still be tweaking it behind the scenes, or even overhauling large segments of the algorithm. The list of publicly discussed features doesn&#8217;t explain a whole lot about the overall codec operation.</p>
<p>Writing this article motivated me to re-read and carefully study that DSP Design Line article and I must confess that there are some interesting tidbits in there. One item that caught my attention was their concept of SIMD without dedicated SIMD instructions. It&#8217;s nice to see On2 getting back to their roots&#8211; this concept forms the basis of On2&#8242;s very first video codec, <a href="http://wiki.multimedia.cx/index.php?title=Duck_TrueMotion_1">Duck TrueMotion 1</a> (effectively VP1).</p>
<p>The DSP Design Line article is far more fascinating than any of the literature on On2&#8242;s site. The article paints a picture of a powerful and flexible codec that is suitable for low, medium, and high bandwidth applications and whose decoding algorithm can be scaled to operate realtime on low power, mobile CPUs all the way up to beefy, multicore desktop machines, all while offering efficient and accurate compression. If the codec offers all of these technical benefits, plus truly free licensing terms and is satisfactorily patent-free (or indemnified), I look forward to singing VP8&#8242;s praises.</p>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/vp8-the-savior-codec/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>On Open Sourcing On2</title>
		<link>http://multimedia.cx/eggs/on-open-sourcing-on2/</link>
		<comments>http://multimedia.cx/eggs/on-open-sourcing-on2/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 15:37:57 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[On2/Duck]]></category>
		<category><![CDATA[Open Source Multimedia]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/?p=2273</guid>
		<description><![CDATA[Let's seriously consider the possibility of Google open sourcing On2 video codecs]]></description>
			<content:encoded><![CDATA[<p>I have been reading way too many statements from people who confidently assert that Google will open source all of On2&#8242;s IP based on no more evidence than&#8230; the fact that they <em>really, really</em> hope it happens. Meanwhile, I have found myself pettily hoping it doesn&#8217;t happen simply due to the knowledge that <a href="http://www.fsf.org/blogs/community/google-free-on2-vp8-for-youtube/">the FSF will claim total credit</a> for such a development (don&#8217;t believe me? They already <a href="http://www.fsf.org/news/ibad_launch">claim credit for Apple dropping DRM from music purchases</a>: &#8220;Our Defective by Design campaign has a successful history of targeting Apple over its DRM policies&#8230; and under the pressure Steve Jobs dropped DRM on music.&#8221;)</p>
<p>But for the sake of discussion, let&#8217;s run with the idea: Let&#8217;s assume that Google open sources any of On2&#8242;s intellectual property. Be advised that if you&#8217;re the type who believes that all engineering problems large and small can be solved by applying, not thought, but a mystical, nebulous force called &#8220;open source&#8221;, you can go ahead and skip this post.</p>
<p><strong>The Stack</strong></p>
<p><span id="more-2273"></span></p>
<p>I like thinking about specific multimedia problems on this blog because people who read this blog often know beans about multimedia technology and are equipped to think about the issues involved. So imagine that Google open sources On2&#8242;s video codecs. What does that mean? <strong>Free web video for all!</strong> Well, not so fast. There are a few issues to consider. While most observers can only see as far as the video codec portion, there are, at the very least, 3 things to consider when putting together a video for consumption:</p>
<ol>
<li>Video codec &#8212; how are the pictures compressed and encoded?</li>
<li>Audio codec &#8212; presumably, you want some sound to go along with those moving pictures</li>
<li>Container format &#8212; there has to be a method for tying together audio and video for delivery and playback</li>
</ol>
<p>So, Google open sourcing On2&#8242;s video codecs would address the first need. What about the second need? Obviously, MP3 and AAC &#8212; which represent the standards today &#8212; would just get the open video argument back to square one. <strong>&#8220;VORBIS!!!&#8221;</strong> would be the reflexive cry of the open source checklister crowd. Indeed, this just might work. Vorbis has problems and shortcomings but is generally considered a reasonable replacement for MP3, WMA, and AAC, at least for desktop computing applications (we&#8217;ll think outside of the desktop arena a little later). Actually, there is another option: Did you know that On2 dabbled in audio codecs at one time? They developed 2 <a href="http://wiki.multimedia.cx/index.php?title=IMA_ADPCM">IMA ADPCM</a> variants (<a href="http://wiki.multimedia.cx/index.php?title=Duck_DK4_IMA_ADPCM">DK4</a> and <a href="http://wiki.multimedia.cx/index.php?title=Duck_DK3_IMA_ADPCM">DK3</a>) which wouldn&#8217;t be seriously considered for this application. They also have something they simply called <a href="http://wiki.multimedia.cx/index.php?title=On2_Audio_for_Video_Codec">Audio for Video Codec</a> (inspired). I know we have samples of the latter somewhere.</p>
<p>How about the last component on the list, the container format? How about Ogg? Ogg is not usually considered a general-purpose container format. It would require extension to be capable of storing any new codec (I argue that a container is not general-purpose if a demuxer has to have special code to handle every codec that could possibly be inside, which is pretty much how Ogg works). The prevailing container format on the standard MPEG side is the QuickTime-derived MP4 format. This could hold new On2 data (and probably does so in various applications today), but I&#8217;m not sure about encoding Vorbis data.</p>
<p>This is the part of the post where I learned something new (which is a big reason I like writing these blog posts). My theory was that there was no agreed-upon method for storing Vorbis audio data in QuickTime/MP4. But if there were something resembling a standard on this front, FFmpeg would implement it. So I tried transcoding an audio file to a Vorbis encoded .MOV or .MP4 and not only did both take, both played back in FFplay.</p>
<p><strong>Mobile Considerations</strong></p>
<p>Okay, so the MP4/VPn/Vorbis stack might just be crazy enough to work&#8230; <em>in the desktop realm</em>. There&#8217;s the emerging world out there collectively called &#8220;mobile&#8221; &#8212; cell phones, netbooks, tablet computers, and more &#8212; and they all want to be able to show video. They often do this with dedicated processors that are designed to decode the standard MPEG codecs (H.264 and AAC). I&#8217;ve read from various observers who wave away this problem of decoding a new stack on mobile by invoking 3 magic letters: &#8216;DSP&#8217;. This is a good example of how a little knowledge can be dangerous. There seems to be a general misconception that DSPs (digital signal processors) are extraordinary devices that can be programmed to accelerate the decoding of any video or audio codec. The reality isn&#8217;t so simple.</p>
<p>I confess, I don&#8217;t know to what extent today&#8217;s generation of mobile devices employ general-purpose, programmable DSPs vs. custom MPEG ASICs but that would make for an interesting survey. While I&#8217;m confident that any device in the &#8220;mobile&#8221; category could likely be programmed to play data encoded in the MP4/VPn/Vorbis stack, the issue then becomes battery usage&#8211; how long can the custom programmed system play video vs. how long could the same unit play by pushing MPEG data through the custom ASICs? Again, don&#8217;t know, but it would be interesting to find some numbers or develop experiments to test this.</p>
<p><strong>The Google/YouTube Factor</strong></p>
<p>Observers obsess about the Google/YouTube angle in all this, which is understandable due to the large mindshare that YouTube controls when it comes to web video. &#8220;Control the YouTube video format, control the future of the internet,&#8221; or so the popular sentiment seems to go (be advised, however, that <a href="http://www.reelseo.com/long-tail-time-spent-video/">YouTube doesn&#8217;t necessarily represent as much online video viewing as you might think</a>). One received bit of wisdom is that Google already stores multiple copies of every video in various formats, so one more shouldn&#8217;t be any big burden. Our thoughts are not Google&#8217;s thoughts, neither are Google&#8217;s ways our ways (I&#8217;m sure I read that somewhere). It&#8217;s hard to know exactly how YouTube operates, but we can always <a href="http://multimedia.cx/eggs/poking-at-youtube/">poke at it to find clues</a>. Outside of Google, few people are as interested in YouTube&#8217;s operation as <a href="http://x264dev.multimedia.cx/">Dark Shikari</a> of x264 fame and <a href="http://news.ycombinator.com/item?id=1138476">here are some interesting tidbits he has empirically determined</a>. Of interest to this discussion is the following: &#8220;They could have saved 30-50% on bandwidth by offering an H.264 High stream for PC viewers, but they <em>didn&#8217;t</em> because it would have required they keep around a separate stream.&#8221; This indicates that Google doesn&#8217;t necessarily consider disk space to be limitless, at least not in the disk space vs. bandwidth trade-off calculation. I know for a fact that YouTube also keeps around the original copies of all the videos that have ever been uploaded (because certain videos that were not transcoded properly years ago are now correct). However, YouTube only needs to keep one copy of the original around (and maybe a backup somewhere) while transcoded videos need to be shipped off to any number of content distribution nodes.</p>
<p>This doesn&#8217;t rule out the possibility that Google could push an MP4/VPn/Vorbis stack as the new web video standard and maintain parallel MPEG &#038; open copies of each YouTube video. But it&#8217;s not a foregone conclusion that it would be a drop in the bucket for Google&#8217;s resources. As a <a href="http://blogs.adobe.com/penguin.swf/">programmer for a large technology company</a>, I endure more than my fair share of outside advice regarding what my company ought to do for the benefit of everyone else except the company. I can only imagine how frustrating it must be for Google people to constantly read declarations along the lines of, &#8220;Google needs to spend untold millions of its own money in order to do what <em>I</em> believe is right,&#8221; especially considering that whole &#8220;don&#8217;t be evil&#8221; charter/moral bludgeon.</p>
<p><strong>In Closing</strong></p>
<p>Anyway, I just wanted to think about these issues from a purely technical standpoint, a perspective that I really don&#8217;t see discussed anywhere else (except when I read <a href="http://news.ycombinator.com/threads?id=DarkShikari">Dark Shikari try to talk sense</a> into online forums where video discussions abound). I don&#8217;t have all the facts but I enjoy not only searching for them, but also figuring out <em>how</em> to search for them.</p>
<p>Check out Silvia Pfeiffer&#8217;s recent blog post: <a href="http://blog.gingertech.net/2010/02/20/googles-challenges-of-freeing-vp8/">Google&#8217;s challenges of freeing VP8</a>. In addition to wondering about some of the same technical issues I have outlined here, she addresses the tough legal and patent issues surrounding a possible open sourcing. And none of this even begins to address the political and social issues surrounding the adoption of such a standard.</p>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/on-open-sourcing-on2/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>On2 Acquisition</title>
		<link>http://multimedia.cx/eggs/on2-acquisition/</link>
		<comments>http://multimedia.cx/eggs/on2-acquisition/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 02:11:38 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[On2/Duck]]></category>
		<category><![CDATA[VP3/Theora]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/?p=2254</guid>
		<description><![CDATA[Do you really think that Google is going to open source On2's codecs now that they own On2?]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been hearing it ever since <a href="http://multimedia.cx/eggs/reflections-on-on2/">last August</a>:</p>
<p><em>Google owns On2. They are going to open source all of On2&#8242;s codecs.</em><br />
<span id="more-2254"></span><br />
Well, no. Google does not own On2. They made a bid for the company last August, sweetened the offer somewhere along the line, and saw the offer accepted 2 days ago. From all of my reading, the deal is still not closed (though many reports are optimistic that today is the big day; and what do you know? As I was proofreading this entry, <a href="http://investor.google.com/releases/20100219.html">today turned out to be that big day.</a>).</p>
<p><em>Whatever. Google is going to own On2 soon and then they&#8217;re going to open source all of On2&#8242;s codecs.</em></p>
<p>What on earth makes you think that they would do that?</p>
<p><em>Everyone is saying that Google is going to open source all of On2&#8242;s codecs.</em></p>
<p>Take a good look at <a href="http://en.wikipedia.org/wiki/List_of_acquisitions_by_Google">this lengthy list of companies that Google has acquired</a>. Can you name 3 instances where Google acquired a company with proprietary software technology and promptly released said technology as open source? I guess Etherpad counts as 1. That&#8217;s not exactly a trend.</p>
<p><em>Google is going to open source VP6, VP7, and VP8, all of which come from the lineage of VP3 (the name indicates that, so it must be the case), which is what Theora is based on, which has been <a href="http://people.xiph.org/~greg/video/ytcompare/comparison.html">indisputably shown</a> to be <a href="http://people.xiph.org/~maikmerten/youtube/">better than H.264</a>, the current web standard. Therefore, these later codecs are going to be even more awesome than Theora, which is already more awesome than H.264.</em></p>
<p>Okay, it helps to understand how misleading those alleged benchmarks were. The distilled thesis that Theora is better than H.264&#8230; you know what? Go ahead and believe that Theora is technically superior to H.264 if you wish. It doesn&#8217;t matter. People who matter (i.e., decision-makers) know better.</p>
<p><em>Google is going to open source On2&#8242;s codecs and that&#8217;s going to <a href="http://www.fsf.org/blogs/community/google-free-on2-vp8-for-youtube/">kill Adobe Flash Player</a>.</em></p>
<p>Every week, there&#8217;s something else that&#8217;s supposedly going to be the final nail in the coffin of what <a href="http://blogs.adobe.com/penguin.swf/">I work on at my day job</a>. This week, the buzz was all about On2 (at least among people who grasp what a video codec is). Anyway, what makes you think that the open sourcing of said codecs would kill Flash Player?</p>
<p><em>People only use Flash Player to watch video on the web, and the only site that serves video on the web is YouTube, and Google owns YouTube.</em></p>
<p>You&#8217;re welcome to extrapolate general usage models based on your own perception and behavior while ignoring <a href="http://www.reelseo.com/long-tail-time-spent-video/">research from outfits who study these trends all day</a>. I want to get back to this core assumption that Google is interested in On2 so that they can open source On2&#8242;s video codecs.</p>
<p><em>Due to the magical power of open source, as soon as Google open sources all of On2&#8242;s codecs, the open source community will embrace the code and integrate it into every relevant piece of software everywhere.</em></p>
<p>Okay, this is where I must issue a dire warning: <strong>Be careful what you wish for.</strong> You&#8217;re salivating at the prospect of being able to read and hack around with On2&#8242;s code? You can get a taste of On2&#8242;s code here: <a href="http://duck.com/vpvision/">Download their VpVision product</a> from back in the day. It includes VP3 (adapted to become Theora) as well as VP1 and VP2 (née Duck TrueMotion 1 and 2) along with 2 ADPCM audio codecs. Go ahead and try to make it compile. Some very talented multimedia hackers have studied it for 8 years and still haven&#8217;t figured out everything about those codecs in that code.</p>
<p>In summary: I don&#8217;t think Google is buying On2 so that they can open source On2&#8242;s codecs. I have absolutely no insight into why Google cares about On2. But then, neither does anyone else commenting on the matter. I&#8217;m just a <a href="http://wiki.multimedia.cx/index.php?title=Main_Page">codec nerd</a> who has been watching On2/Duck for nearly as long as they have existed. Most people claiming that Google is going to open source On2&#8242;s codecs only seem to be citing as evidence their own wishes as well as those of their fellow bloggers/tweeters. But, hey, that&#8217;s the internet for you.</p>
<p><strong>See also:</strong></p>
<ul>
<li><a href="http://multimedia.cx/eggs/reflections-on-on2/">Reflections on On2</a></li>
<li><a href="http://multimedia.cx/eggs/htmlol5-video/">HTMLOL5 Video</a></li>
<li><a href="http://multimedia.cx/eggs/quacking-like-duck/">Assorted fruitless</a> <a href="http://multimedia.cx/eggs/duck-hieroglyphics/">efforts to understand</a> <a href="http://multimedia.cx/eggs/compiled-duck/">On2/Duck codecs</a> (<a href="http://multimedia.cx/eggs/duck-truemotion-1-redux/">with the</a> <a href="http://multimedia.cx/eggs/duck-truemotion-1-progress/">occassional success</a>)</li>
<li><a href="http://multimedia.cx/eggs/legal-threat-00001/">That one time that On2 threatened to sue me</a>: I ain&#8217;t mad at ya, homey; it&#8217;s all right</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/on2-acquisition/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Reflections On On2</title>
		<link>http://multimedia.cx/eggs/reflections-on-on2/</link>
		<comments>http://multimedia.cx/eggs/reflections-on-on2/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 04:06:30 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[On2/Duck]]></category>
		<category><![CDATA[VP3/Theora]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/?p=1712</guid>
		<description><![CDATA[Reflecting on the times I've shared with On2]]></description>
			<content:encoded><![CDATA[<p>I read something in the past few months which noted that, in this day and age, the ultimate phase of any tech startup&#8217;s business plan is to be purchased by <a href="http://www.google.com/">Google</a>. Viewed through that lens, <a href="http://www.on2.com/">On2</a> is about to live the dream, even though they existed years before Google, years before most people even knew what a search engine was.</p>
<p><center><br />
<img src="http://multimedia.cx/eggs/wp-content/uploads/2009/08/duck-on2-google.jpg" alt="Assorted logos of Duck, On2, and Google" title="Assorted logos of Duck, On2, and Google" width="450" height="525" class="aligncenter size-full wp-image-1713" /><br />
</center></p>
<p>So <a href="http://www.google.com/intl/en/press/pressrel/ir_20090805.html">Google has announced its intention to purchase On2</a>. Wow, it feels like the end of an era. It seems like I&#8217;ve had some relationship with On2 for the entire 9 years I&#8217;ve been into multimedia hacking. Something that got lost in yesterday&#8217;s coverage and commentary was that On2 started life as the Duck Corporation, also a codec company. During this period, they largely focused on gaming applications. But I&#8217;m pretty sure that <a href="http://wiki.multimedia.cx/index.php?title=RAD_Game_Tools">RAD Game Tools</a> kicked them out of that market with their <a href="http://wiki.multimedia.cx/index.php?title=Smacker">Smacker</a> and <a href="http://wiki.multimedia.cx/index.php?title=Bink_Video">Bink</a> technologies. However, files encoded with the Duck&#8217;s multimedia codecs were among the first I studied back around 2000-2001. So that always makes me sentimental.</p>
<p><span id="more-1712"></span></p>
<p>Somewhere along the line, they transformed into On2 and created VP3. Near the end of 2001, On2 announced they would release VP3 as open source (they were working on VP5 around this time), hoping that some nebulous open source community would make something useful out of it. I&#8217;ll have you know that <em>I was that open source community</em> for quite awhile. I delved into their code and wrote the first <a href="http://multimedia.cx/vp3-format.txt">documentation about the codec bitstream and decoding process</a> which would later serve as the foundation of the formal Theora specification. Then I wrote an independent implementation for <a href="http://ffmpeg.org/">FFmpeg</a>.</p>
<p>And I never judged the codec either.</p>
<p>Ah, On2. People always worry that I&#8217;m going to get sued to death for writing this blog, but <a href="http://multimedia.cx/eggs/legal-threat-00001/">On2 remains the only company that has ever leveled any kind of legal threat against me</a>. But I ain&#8217;t mad at ya. Later that same year, I went to work for Adobe where I gained official access to the very algorithm I was trying to reverse engineer. Strange how things work out.</p>
<p>And now I work on the <a href="http://blogs.adobe.com/penguin.swf/">Adobe Flash Player</a>, arguably the single biggest use case for any technology that has ever come out of On2. At least, <em>so far</em>. What does Google want with On2? You&#8217;re asking the wrong person. My company&#8217;s official answer is to contact On2 or Google.</p>
<p>There has been no shortage of speculation on Google&#8217;s motives, most of it misinformed at best, outright silly at worst. Dan Rayburn has a fantastic &#8220;day after&#8221; piece debunking myths about the deal: <a href="http://seekingalpha.com/article/154160-google-on2-deal-debunking-myths-questioning-vp8-s-quality">Debunking Myths, Questioning VP8&#8242;s Quality</a>. His piece, however, does not address the idea floating around that Google will open source all of On2&#8242;s technologies. That&#8217;s certainly in keeping with the idealistic Google image of a promoter of free and open technologies, even if it would cause a lot of extra work for FFmpeg developers and multimedia historians alike. But seriously, take a look at the <a href="http://en.wikipedia.org/wiki/List_of_acquisitions_by_Google">list of companies Google has acquired</a>. Can you pick out any proprietary, closed source technologies they have purchased and subsequently released under an open source license? I don&#8217;t recognize Google&#8217;s history of doing this. Quite the contrary, it seems that when they buy closed source programs they keep them closed, like <a href="http://picasa.google.com/mac/">Picasa</a>, and in cases like <a href="http://sketchup.google.com/">SketchUp</a>, they even charge for upgraded versions.</p>
<p>My colleague <a href="http://x264dev.multimedia.cx/">Dark Shikari</a> has some <a href="http://news.ycombinator.net/item?id=743780">choice words to say on this situation</a>. He remains extremely sceptical of any literature On2 has published regarding their codecs&#8217; performance. Remember also the nonsense that circulated a few months ago regarding specious comparisons claiming that <a href="http://people.xiph.org/~greg/video/ytcompare/comparison.html">Theora is better than H.264</a> (more accurately stated: Theora can be tweaked enough to encode arguably better video than what YouTube&#8217;s H.264 encoder can generate in its default, lowest quality mode; but that entire thesis usually gets distilled into simpler, less accurate headlines). Finally, I have read some speculation that Google might want On2 not for any specific multimedia-related intellectual property, but for their talent pool.</p>
<p>To tie together all of the items in the previous paragraph: It&#8217;s possible that Google needs the expertise in cooking codec comparisons to keep the Theora faithful at bay.</p>
<p>For those keeping track, this is On2&#8242;s codec scorecard as of this writing:</p>
<p><strong>Video Codecs</strong></p>
<table cellpadding="5">
<tr>
<td><a href="http://wiki.multimedia.cx/index.php?title=Duck_TrueMotion_1">TrueMotion 1</a></td>
<td style="background-color:#33FF22">Open source</td>
</tr>
<tr>
<td><a href="http://wiki.multimedia.cx/index.php?title=Duck_TrueMotion_2">TrueMotion 2</a></td>
<td style="background-color:#33FF22">Open source</td>
</tr>
<tr>
<td><a href="http://wiki.multimedia.cx/index.php?title=On2_VP3">VP3</a></td>
<td style="background-color:#33FF22">Open source, foundation for Theora</td>
</tr>
<tr>
<td><a href="http://wiki.multimedia.cx/index.php?title=On2_VP4">VP4</a></td>
<td style="background-color:#FF2222">Unknown</td>
</tr>
<tr>
<td><a href="http://wiki.multimedia.cx/index.php?title=On2_VP5">VP5</a></td>
<td style="background-color:#FFFF00">Reverse engineered</td>
</tr>
<tr>
<td><a href="http://wiki.multimedia.cx/index.php?title=On2_VP6">VP6</a></td>
<td style="background-color:#FFFF00">Reverse engineered</td>
</tr>
<tr>
<td><a href="http://wiki.multimedia.cx/index.php?title=On2_VP7">VP7</a></td>
<td style="background-color:#FF2222">Unknown</td>
</tr>
<tr>
<td>VP8</td>
<td>Unreleased</td>
</tr>
</table>
<p>If you have ever wondered what happened to VP1 and VP2, you may assume that TrueMotion 1 and 2 filled those positions.</p>
<p><strong>Audio Codecs</strong></p>
<table cellpadding="5">
<tr>
<td><a href="http://wiki.multimedia.cx/index.php?title=Duck_DK4_IMA_ADPCM">DK4 ADPCM</a></td>
<td style="background-color:#33FF22">Open source</td>
</tr>
<tr>
<td><a href="http://wiki.multimedia.cx/index.php?title=Duck_DK3_IMA_ADPCM">DK3 ADPCM</a></td>
<td style="background-color:#33FF22">Open source</td>
</tr>
<tr>
<td>Audio For Video codec</td>
<td style="background-color:#FF2222">Unknown</td>
</tr>
</table>
<p>It still annoys me that I reverse engineered DK4 and DK3 from binary only to later discover that they were already open sourced along with TrueMotion 1 and 2, and VP3.</p>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/reflections-on-on2/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>JavaFX and On2 TrueMotion</title>
		<link>http://multimedia.cx/eggs/javafx-and-on2-truemotion/</link>
		<comments>http://multimedia.cx/eggs/javafx-and-on2-truemotion/#comments</comments>
		<pubDate>Sun, 17 Aug 2008 04:35:02 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[Multimedia PressWatch]]></category>
		<category><![CDATA[On2/Duck]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/javafx-and-on2-truemotion/</guid>
		<description><![CDATA[Have you heard of Sun&#8217;s JavaFX? It&#8217;s due out later this year and is allegedly positioned to compete in the RIA space. It might be pertinent to mention that I work on a competing technology. Anyway, the reason I bring this up is that I recently learned that On2 is reported to be supplying JavaFX [...]]]></description>
			<content:encoded><![CDATA[<p>Have you heard of <a href="http://www.sun.com/software/javafx/">Sun&#8217;s JavaFX</a>? It&#8217;s due out later this year and is allegedly positioned to compete in the RIA space. It might be pertinent to mention that <a href="http://blogs.adobe.com/penguin.swf/">I work on a competing technology</a>. Anyway, the reason I bring this up is that I recently learned that <a href="http://www.on2.com/">On2</a> is reported to be supplying JavaFX with video codec technology. According to <a href="http://www.on2.com/index.php?id=439&#038;news_id=622">&#8220;Sun Adds Comprehensive Video Capabilities to Ubiquitous Java Platform with On2 Technologies,&#8221;</a> Sun licensed On2&#8242;s &#8220;TrueMotion&#8221; codec. I&#8217;m not entirely sure what codec they&#8217;re talking about and I can&#8217;t quite find any solid details. On2&#8242;s site seems to classify TrueMotion as encompassing both VP6 and VP7. I&#8217;m always surprised to hear the name TrueMotion since I thought that went away after the Duck Corporation morphed into On2. But the VP* series seems to be interchangeable with TrueMotion, just for extra confusion.</p>
<p>Who knows? Maybe they actually <em>are</em> using the classic <a href="http://wiki.multimedia.cx/index.php?title=Duck_TrueMotion_1">Duck TrueMotion video codec</a> in JavaFX.</p>
<p>Curiously, there is no word on what JavaFX will use for audio. Maybe logarithmic PCM in <a href="http://wiki.multimedia.cx/index.php?title=Au/snd">au/snd files</a>?</p>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/javafx-and-on2-truemotion/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Compiled Duck</title>
		<link>http://multimedia.cx/eggs/compiled-duck/</link>
		<comments>http://multimedia.cx/eggs/compiled-duck/#comments</comments>
		<pubDate>Tue, 04 Sep 2007 04:12:03 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[On2/Duck]]></category>
		<category><![CDATA[Reverse Engineering]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/compiled-duck/</guid>
		<description><![CDATA[I actually got the original Duck TM1 decoder compiled and hooked up to a small test bench app. It even runs without crashing. However, it produces unequivocally incorrect output: I was expecting something more in a solid white for this particular frame. This doesn&#8217;t exhibit the normal Duck TM1 bidirectional artifacts that I&#8217;m used to [...]]]></description>
			<content:encoded><![CDATA[<p>I actually got the original <a href="http://wiki.multimedia.cx/index.php?title=Duck_TrueMotion_1">Duck TM1</a> decoder compiled and hooked up to a small test bench app. It even runs without crashing. However, it produces unequivocally incorrect output:</p>
<p><center><br />
<img src="/eggs/images/bad-duck-tm1.jpg" alt="Bad Duck TrueMotion 1 Decode" /><br />
</center></p>
<p>I was expecting something more in a solid white for this particular frame. This doesn&#8217;t exhibit the normal Duck TM1 bidirectional artifacts that I&#8217;m used to seeing. I also wired up a number of different blitting calls with both 16- and 24-bit data, to no avail.</p>
<p>I&#8217;ll give the API calls another look to see if I&#8217;m missing anything obvious in that department (this approach is unlikely to bear fruit, considering the dearth of documentation). Failing that, I might find myself in the ironic position of using libavcodec&#8217;s native Duck TM1 decoder to verify the operation of the original decoder to see what is going wrong with files that are known to work correctly in lavc, so that the original decoder will work completely and yield clues about the large body of problem TM1 files.</p>
<p><em>Addendum:</em> I decided to enlist <a href="http://valgrind.org/">Valgrind&#8217;s</a> assistance against the adversary. This is the first time I have touched the utility in awhile. Let&#8217;s see what it has to say&#8230;</p>
<pre>
  valgrind: the 'impossible' happened:
     Killed by fatal signal
</pre>
<p>I&#8217;m not sure what to think about that. Should I feel proud? Fortunately, leading up to the impossible condition are plenty of other memory errors, all ripe for investigation.</p>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/compiled-duck/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Duck Hieroglyphics</title>
		<link>http://multimedia.cx/eggs/duck-hieroglyphics/</link>
		<comments>http://multimedia.cx/eggs/duck-hieroglyphics/#comments</comments>
		<pubDate>Mon, 27 Aug 2007 00:56:23 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[On2/Duck]]></category>
		<category><![CDATA[Reverse Engineering]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/duck-hieroglyphics/</guid>
		<description><![CDATA[It&#8217;s like digital archaeology&#8211; understanding the ancient (by internet time) workings of less advanced engineering efforts. Pop culture depictions of archaeology would have us believe that those who toil in the field are searching for that one artifact that would neatly solve the entire puzzle at hand. Historically, perhaps the artifact that came closest to [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s like digital archaeology&#8211; understanding the ancient (by internet time) workings of less advanced engineering efforts. Pop culture depictions of archaeology would have us believe that those who toil in the field are searching for that one artifact that would neatly solve the entire puzzle at hand. Historically, perhaps the artifact that came closest to fitting this archetype was the <a href="http://en.wikipedia.org/wiki/Rosetta_stone">Rosetta Stone</a>, and even that was incomplete (if I&#8217;m observing the pictures correctly).</p>
<p>So it is with my current investigation. Much like Sean Connery playing Indiana Jones&#8217; dad searching for the Holy Grail in <a href="http://www.imdb.com/title/tt0097576/">The Last Crusade</a>, I run the risk of making the <a href="http://wiki.multimedia.cx/index.php?title=Duck_TrueMotion_1">Duck TrueMotion 1 algorithm</a> my lifelong obsession. I got that Duck TM1 source code into a state where I could compile it against a standalone program. It only required 38 C source files from the original <a href="http://www.duck.com/vpvision/">vpvision</a> source tree and a mess of attendant header files to boot.</p>
<p><span id="more-453"></span></p>
<p>Eventually, I noticed a .txt file somewhere in the original source tree. I have no idea what &#8216;hfb&#8217; means in the tree so I&#8217;ll have a look in hfb/corelibs/hfb/generic/readme.txt:</p>
<pre>
 Testing
</pre>
<p>Not so useful. Let&#8217;s try a file called iva/iva.txt:</p>
<pre>
 no documentation yet
</pre>
<p><em>Why do I bother? Why do I devote time to a hobby of interpreting the scrawlings that cavemen engineers splattered on their cube walls?</em></p>
<p>There are 2 copies of a file called ccreadme.txt that have statistics on the performance of various optimized colorspace converters. Someone was obviously proud of that work and saw fit to preserve the numbers for future generations.</p>
<p>Perhaps the only semi-useful document file I found is b_readme.txt, in the main tm1.0 source directory. See, there are 25 of these files in the tm1.0 source directory that have the format bXYmn.c &#8216;b&#8217; is &#8216;b&#8217;. As for the remainder of the characters, well, here&#8217;s where we get into the hieroglyphics&#8211; the letters &#8216;X&#8217; and &#8216;Y&#8217; represent a character, either s, f, t, or e. What do they mean? 16, 24, 32, or 8 bits, respectively. Huh? Your guess on the mapping logic is as valid as mine. &#8216;m&#8217; is a number 0-3. This has to do with stretching mode, apparently, but what the modes exactly represent is not clearly explained (&#8220;Next character is a mode (0-3) such as same, stretch, and bright (implemented with interpolation or otherwise).&#8221;). &#8216;n&#8217; is a number (0-2) indicating, I suppose, a stretching algorithm (&#8220;dumb, smart, or fat-freddy&#8221;). I googled for a fat freddy algorithm but only found reference to an aberrant <a href="http://en.wikipedia.org/wiki/Fat_Freddy">cartoon character</a>. Apparently, even Duck/On2&#8242;s algorithms are inside jokes.</p>
<p>The file singles out a particular engineer, one Scott LaVarnway, for his exemplary work in the blitter department, and for one blitter in particular which is extra special and deviates from the naming convention somewhat.</p>
<p>I don&#8217;t know how, or if, I missed this file when I studied this codec the first time around. I do remember that it was painful to figure out which of the b????.c files I was supposed to RE. I could tell that different ones were used for 16- or 24-bit source data and implemented different interpolation modes. Now I recognize that, for understanding 24-bit decoding, bft00.c is perhaps my best bet (24-bit source data, 32-bit output target, no stretching, no interpolation algorithm).</p>
<p>So hopefully, that will help in figuring out the 24-bit mode. There is still the matter of many corrupted DUCK TM1 files that don&#8217;t work with the libavcodec TM1 decoder. It will be useful to feed them into this decoder somehow and see if it can handle them, and then figure out what the official decoder is doing that the lavc decoder needs to do. I thought I had a good idea of what the relevant functions were until I noticed that these particular functions were static within the file.</p>
<p>Now I think I have the real API figured out, at least partially&#8211; I believe I know how the data goes in, though I&#8217;m not clear on where the data comes out just yet. The initialization also doesn&#8217;t get very far before erroring out. Now I&#8217;m just debugging the thing using gdb to figure out why it&#8217;s not responding as expected.</p>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/duck-hieroglyphics/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Quacking Like Duck</title>
		<link>http://multimedia.cx/eggs/quacking-like-duck/</link>
		<comments>http://multimedia.cx/eggs/quacking-like-duck/#comments</comments>
		<pubDate>Tue, 14 Aug 2007 05:31:57 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[On2/Duck]]></category>
		<category><![CDATA[Reverse Engineering]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/quacking-like-duck/</guid>
		<description><![CDATA[I don&#8217;t learn very quickly. A good illustration of this personal shortcoming is my ongoing battle with the Duck TrueMotion 1 video codec, a conflict that is well into its 8th year at this point. This was one of my first exposures to the field of multimedia hacking as I discovered some Duck TM1-encoded AVI [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t learn very quickly. A good illustration of this personal shortcoming is my ongoing battle with the <a href="http://wiki.multimedia.cx/index.php?title=Duck_TrueMotion_1">Duck TrueMotion 1 video codec</a>, a conflict that is well into its 8th year at this point. This was one of my first exposures to the field of multimedia hacking as I discovered some Duck TM1-encoded AVI files on select Sega Saturn console games all the way back in 1998. I found a few Japanese Windows programs that could play the files. Early in my multimedia hacking career, I worked hard to reverse engineer the TM1 algorithm.</p>
<p><center><br />
<img src="/eggs/images/duck-truemotion1-logo.png" alt="Duck TrueMotion logo" /><br />
</center></p>
<p>In 2002, <a href="http://on2.com/">On2</a> (formerly Duck) open sourced their <a href="http://wiki.multimedia.cx/index.php?title=On2_VP3">VP3 codec</a> (which would later become Theora). I kept stubbornly trying to RE TM1 from the binary when <a href="http://www.artificis.hu/">Alex</a> notified me that <a href="http://www.duck.com/vpvision/">On2&#8242;s open source VpVision package</a> contains the decoders for TrueMotion 1 and 2. It also included the decoders for <a href="http://wiki.multimedia.cx/index.php?title=Duck_DK3_IMA_ADPCM">Duck DK3</a> and <a href="http://wiki.multimedia.cx/index.php?title=Duck_DK4_IMA_ADPCM">DK4 ADPCM</a>, both of which I successfully <em>had</em> RE&#8217;d from binary code, and at around the time that VpVision had been released as open source.</p>
<p>The VpVision source has been quite valuable in RE&#8217;ing both the TM1 and TM2 algorithms. It&#8217;s extremely difficult to understand, however, as is often the case with code produced on a deadline. Some TM1 files still fail to work correctly with the native FFmpeg decoder. I always thought it would be useful if I could compile the code and run it in a step debugger, or perhaps profile it with other tools, in order to sort out the correct operation when decoding certain files. But the code seemed like such a mess that I didn&#8217;t think it would compile on Linux. It looked like it would only compile on Windows or maybe Mac, and only with some effort.</p>
<p><span id="more-452"></span></p>
<p>I feel a little silly since I discovered today how simple it is to compile the TM1 code on Linux. This is how I got it to compile:</p>
<ul>
<li>download and unpack <a href="http://www.duck.com/vpvision/">vpvision0.5_source.zip</a></li>
<li>&#8216;cd vpvision/ducksoft/&#8217;</li>
<li>edit private.h/duck_dxl.h and comment out the definition of DXL_GetXImageFrameBuffer() at lines 190-192</li>
<li>&#8216;cd tm1.0/linux&#8217;</li>
<li>&#8216;make&#8217;</li>
</ul>
<p>This produces a nice little file called libtm1.a in the obj/ directory. Similar work could probably get the <a href="http://wiki.multimedia.cx/index.php?title=Duck_TrueMotion_2">TrueMotion 2</a> library into shape, but <a href="http://codecs.multimedia.cx/">Kostya</a> already has that algorithm locked down.</p>
<p>In retrospect, I think I had previously opted not to try compiling the smaller modules in the package based on my foul experience attempting to compile the VP3 decoder. That module has a lot of dependencies on Win32 or Mac platform facilities. Eventually, I did separate out and modify just enough VP3 code to make a standalone decoder that compiles with gcc on Linux. I have since forgotten where I put that code but at the time, it helped me validate my new FFmpeg VP3 decoder.</p>
<p>So, how to make this useful? I suppose we could concatenate all of the files together as a new TM1 decoder and submit a mega-patch to the ffmpeg-devel list, if only to get a rise out of <a href="http://guru.multimedia.cx/">the Guru</a>. However, our new decoder seems to be a bit more efficient, size-wise. Under gcc 4.1.1 on an i386, libavcodec/truemotion1.o compiles to 13304 bytes while obj/libtm1.a weighs in at 59432 bytes (both counts represent strip&#8217;d binaries). The TM1 algorithm is fairly simple but does rely on a mess of data tables.</p>
<p>I still want to incorporate this library into FFmpeg, at least on an experimental basis so that I learn the code paths being executed for certain problem files. Now the issue is understanding the API by which one is expected to interact with this beast. And a beast it is. Forget about developer documentation. It&#8217;s all up to the developer. I started with a function that I remember as being core to the decoding process and traced up the call tree. Using this strategy, the functions in tm1.c appear to be top level functions. However, the corresponding tm1.h file does not have any useful information. The developers didn&#8217;t even want to create that header file based on the comment &#8220;To appease the strict Mac&#8221;.</p>
<p>However, the real break in the case comes when I recall that decoding the TM1 frame header involves a XOR operation. There is only one &#8216;^&#8217; operator in the code and that leads me to where encoded data is unequivocally accessed in the decoder. It is beginning to look as though the API works something like:</p>
<ul>
<li>init TM1 system with tm1_Init()</li>
<li>allocate xImage with tm1_xImageCreate()</li>
<li>call methods assigned within xImage: seedData() specifies a new data buffer to be decoded and dx() asks for a decode operation</li>
</ul>
<p>So I decide to give it a whirl with just a simple C program calling tm1_Init(). No go, because there are a bunch of support functions required that live in other directories in the VpVision tree. It should be possible to pull these things in. However, I don&#8217;t have time to pursue this idea further at this time. Until such time that I do, this blog entry will just serve as a notepad for where I am along this path. </p>
<p>In case someone else wants to take up this task, the immediate goal is to figure out how the API operates and plug it into the FFmpeg decoder for testing purposes. Use the existing truemotion1.c file and reroute the decoding logic to this decoder library. The API is quite mysterious, though. The tm1_Init() function wants a parameter that specifies &#8220;maxframes&#8221;. I have no idea what kind of number is expected. Further, the seedData() function that apparently receives an encoded data buffer to be decoded only takes a char* parameter. Such functions generally need a buffer length parameter to go along with the raw buffer. I don&#8217;t remember anything special about the TM1 coding method where a particular byte value indicated that the end of the stream had been reached.</p>
<p><strong>Related posts:</strong></p>
<ul>
<li><a href="http://multimedia.cx/eggs/duck-truemotion-1-redux/">Duck TrueMotion 1 Redux</a></li>
<li><a href="http://multimedia.cx/eggs/duck-truemotion-1-progress/">Duck TrueMotion 1 Progress</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/quacking-like-duck/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Duck TrueMotion-S</title>
		<link>http://multimedia.cx/eggs/duck-truemotion-s/</link>
		<comments>http://multimedia.cx/eggs/duck-truemotion-s/#comments</comments>
		<pubDate>Wed, 14 Dec 2005 14:13:11 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[On2/Duck]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/?p=158</guid>
		<description><![CDATA[Another TrueMotion 1 sighting...]]></description>
			<content:encoded><![CDATA[<p><a href="http://fourcc.org/">The FOURCC List</a> affords us many scattered bits of intelligence on various codecs used throughout the history of multimedia technology. Duck/On2&#8242;s early TrueMotion codecs are assigned a variety of FOURCCs&#8211; such as DUCK, TMOT, and PVEZ&#8211; which may or may not refer to distinct TrueMotion variants.</p>
<p>Serge van den Boom informed me that the <a href="http://www.mobygames.com/game/star-control-ii/screenshots">3DO version of Star Control II</a> made use of some TM variation named TrueMotion-S. The <a href="http://sc2.sf.net/">open sourced Star Control II</a> effort includes code to decode this video. The relevant files are dukvid.[ch] in <a href="http://cvs.sourceforge.net/viewcvs.py/sc2/sc2/src/sc2code/libs/video/">this directory</a>. A sample (logo.tar.bz2) is available in my <a href="http://www.multimedia.cx/samples/ducktm1/">Duck TM1 samples directory</a>. Interestingly, the bundle actually contains 4 files. The .duk file has all of the video data stuffed together. The .hdr file contains some header information. The .frm file contains the frame offset boundaries for the .duk data file. And the .tbl file apparently contains data for initializing the delta table to use for decoding the data.</p>
<p>I am not yet sure if the data is decoded to 16- or 24-bit video. If someone is willing to jump in and figure this out, it might help us sort out the remaining pieces of the generalized Duck TM1 decoder for FFmpeg. It stands to reason, however, that the data is 16-bit at best since Star Control 2 is such an early game in terms of the multimedia genre. The game is reportedly one of the earliest games that Duck TM1 was used for so it may be on the bottom rung of the Duck predictive evolutionary ladder.</p>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/duck-truemotion-s/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

