<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multimedia.cx/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Aurel</id>
	<title>MultimediaWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multimedia.cx/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Aurel"/>
	<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php/Special:Contributions/Aurel"/>
	<updated>2026-09-09T15:56:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=SubStation_Alpha&amp;diff=12746</id>
		<title>SubStation Alpha</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=SubStation_Alpha&amp;diff=12746"/>
		<updated>2010-06-26T17:41:50Z</updated>

		<summary type="html">&lt;p&gt;Aurel: mention muxing in avi&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Extensions: .ssa or .ass&lt;br /&gt;
** Can also be muxed into [[Matroska]] and [[AVI]] files (AviMux)&lt;br /&gt;
* Website: http://www.eswat.demon.co.uk/substation.html (No longer available)&lt;br /&gt;
* Specs: http://moodub.free.fr/video/ass-specs.doc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''SubStation Alpha''' (SSA) is an external subtitle fileformat that supports Text Formatting and Styling. It has an enormous amount of options including Karaoke, audio effects, graphic drawing etc. It is usually considered to be somewhat bloated and badly designed, however is the only subtitle format that (at least on windows) really supports text formatting and styling at all. It is popular in the Anime scene and among Karaoke fans.&lt;br /&gt;
&lt;br /&gt;
There were several versions. 1, 2, 3, 4 and 4+. The latter is better known Advanced SubStation (ASS). Only 4 and 4+ are still being used.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== SSA V4+ (ASS) ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Script Info]&lt;br /&gt;
; This is an Advanced Sub Station Alpha v4+ script.&lt;br /&gt;
; For Sub Station Alpha info and downloads,&lt;br /&gt;
; go to http://www.eswat.demon.co.uk/&lt;br /&gt;
; or email kotus@eswat.demon.co.uk&lt;br /&gt;
; &lt;br /&gt;
; Advanced Sub Station Alpha script format developed by #Anime-Fansubs@EfNET&lt;br /&gt;
; http://www.anime-fansubs.org&lt;br /&gt;
; &lt;br /&gt;
; For additional info and downloads go to http://vobsub.edensrising.com/&lt;br /&gt;
; or email gabest@freemail.hu&lt;br /&gt;
; &lt;br /&gt;
; Note: This file was saved by Subresync.&lt;br /&gt;
; &lt;br /&gt;
ScriptType: v4.00+&lt;br /&gt;
Collisions: Normal&lt;br /&gt;
PlayResX: 384&lt;br /&gt;
PlayResY: 288&lt;br /&gt;
Timer: 100.0000&lt;br /&gt;
&lt;br /&gt;
[V4+ Styles]&lt;br /&gt;
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding&lt;br /&gt;
Style: Default,Tahoma,16,&amp;amp;H00000000,&amp;amp;H00ffffff,&amp;amp;H00ffffff,&amp;amp;H00c0c0c0,-1,0,0,0,100,100,0,0.00,1,2,3,2,20,20,20,1&lt;br /&gt;
&lt;br /&gt;
[Events]&lt;br /&gt;
Format: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text&lt;br /&gt;
Dialogue: 0,0:01:41.70,0:01:46.84,Default,,0000,0000,0000,,Le rugissement des larmes !\NTu es mon ami.&lt;br /&gt;
Dialogue: 0,0:02:00.99,0:02:02.87,Default,,0000,0000,0000,,Est-ce vraiment Naruto ?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SSA v4 ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Script Info]&lt;br /&gt;
; This is a Sub Station Alpha v4 script.&lt;br /&gt;
; For Sub Station Alpha info and downloads,&lt;br /&gt;
; go to http://www.eswat.demon.co.uk/&lt;br /&gt;
; or email kotus@eswat.demon.co.uk&lt;br /&gt;
Title: Spirited Away&lt;br /&gt;
Original Script: Ian Roberts&lt;br /&gt;
Original Translation: Eisuke Ishibashi&lt;br /&gt;
ScriptType: v4.00&lt;br /&gt;
Collisions: Normal&lt;br /&gt;
PlayResY: 480&lt;br /&gt;
PlayDepth: 0&lt;br /&gt;
Wav: 0, 28688,H:\3.wav&lt;br /&gt;
LastWav: 1&lt;br /&gt;
Timer: 100.0000&lt;br /&gt;
&lt;br /&gt;
[V4 Styles]&lt;br /&gt;
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding&lt;br /&gt;
Style: ICredit,Gill Sans Condensed,36,16777215,65535,65535,-2147483640,-1,0,1,3,0,2,70,70,40,0,0&lt;br /&gt;
Style: IDefault,Gill Sans Condensed,30,65535,65535,65535,-2147483640,-1,0,1,3,0,2,70,70,40,0,0&lt;br /&gt;
Style: IScreenText,Gill Sans Condensed,30,16744576,65535,65535,-2147483640,-1,0,1,3,5,2,70,70,40,0,0&lt;br /&gt;
&lt;br /&gt;
[Events]&lt;br /&gt;
Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text&lt;br /&gt;
Dialogue: Marked=0,0:00:06.60,0:00:08.90,IScreenText,,0000,0000,0000,,{\a10}See you again... Best wishes&lt;br /&gt;
Dialogue: Marked=0,0:00:11.84,0:00:14.74,ICredit,,0000,0000,0100,,{\a2}Story, Script &amp;amp; Direction - MIYAZAKI Hayao&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SSA v3 ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
!: This is a Sub Station Alpha v3.x script.&lt;br /&gt;
&lt;br /&gt;
!: You cannot load this script into any version of Sub Station Alpha prior to v2.00&lt;br /&gt;
&lt;br /&gt;
!: Check web page http://www.eswat.demon.co.uk/ for SSA details and latest versions,&lt;br /&gt;
&lt;br /&gt;
!: or e-mail kotus@eswat.demon.co.uk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Title: Lupin TV ep. 3&lt;br /&gt;
&lt;br /&gt;
Original Script: Neko Creations&lt;br /&gt;
&lt;br /&gt;
Original Translation: Miki Okamoto&lt;br /&gt;
&lt;br /&gt;
Original Editing: Neko-chan&lt;br /&gt;
&lt;br /&gt;
Original Timing: Neko-chan&lt;br /&gt;
&lt;br /&gt;
Original Script Checking: Neko-chan&lt;br /&gt;
&lt;br /&gt;
Synch Point: start of LD--play immediately pause.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ScriptType: v3.00&lt;br /&gt;
&lt;br /&gt;
Collisions: Reverse&lt;br /&gt;
&lt;br /&gt;
PlayResY: 480&lt;br /&gt;
&lt;br /&gt;
PlayResX: 640&lt;br /&gt;
&lt;br /&gt;
PlayDepth: 24&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Comment: Marked=0,0:00:00.0,0:00:00.5,*Default,Warning,0000,0000,0000,This is a script for SSA v2.x\nYou are running SSA v1.x, which will crash if you use this script&lt;br /&gt;
&lt;br /&gt;
Wav: 0,C:\Program Files\ssa32-v2\lupin3.wav&lt;br /&gt;
&lt;br /&gt;
Wav: 0,C:\Program Files\Sub Station Alpha v3.00T\lupin4.wav&lt;br /&gt;
&lt;br /&gt;
Timer: 100.0000&lt;br /&gt;
&lt;br /&gt;
Style: Default,Arial,20,65535,65280,16777215,0,-1,0,2,3,2,30,35,35,255&lt;br /&gt;
Style: Normal1,Arial,18,65535,65408,16777215,0,-1,0,1,3,2,30,30,30,255&lt;br /&gt;
Style: owari,Arial,18,65535,65280,16777215,0,-1,0,2,3,2,40,40,35,255&lt;br /&gt;
Style: songgreen,Arial,18,65280,16777215,65535,0,-1,0,2,3,2,35,35,35,255&lt;br /&gt;
Style: top,Arial,20,65535,65280,16777215,0,-1,0,2,3,2,45,45,380,255&lt;br /&gt;
&lt;br /&gt;
Dialogue: Marked=0,0:00:02.07,0:00:11.81,*Default,Credit,0000,0000,0300,,Lupin III&lt;br /&gt;
Dialogue: Marked=0,0:00:14.00,0:00:19.01,Normal1,Credit,0000,0000,0000,,{\fs20\c&amp;amp;HFFFFFF&amp;amp;\a1}Song of Lupin III\nCharley Kohsei&lt;br /&gt;
Dialogue: Marked=0,0:00:28.91,0:00:33.01,Normal1,Credit,0000,0000,0000,,{\fs20\c&amp;amp;HFFFFFF&amp;amp;}Original idea\nMonkey Punch&lt;br /&gt;
Dialogue: Marked=0,0:01:37.46,0:01:38.66,owari,Fujiko,0000,0000,0000,,It's fantastic, Lupin.&lt;br /&gt;
Dialogue: Marked=0,0:01:38.95,0:01:41.75,owari,Lupin,0000,0000,0000,,Yeah, love is wonderful.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SSA v1 ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
!: This is a Sub Station Alpha v1.x script.&lt;br /&gt;
!: Check web page http://www.eswat.demon.co.uk/ for details&lt;br /&gt;
!: or e-mail kotus@eswat.demon.co.uk&lt;br /&gt;
Timer: 100.000&lt;br /&gt;
Style: title,Arial,28,16777215,65280,16776960,-2147483640,-1,0,1,3,2,30,30,30&lt;br /&gt;
Style: White Text,Arial,28,16777215,65535,16777215,2039583,-1,0,1,4,2,30,30,30&lt;br /&gt;
Style: Song Title,Arial,24,16777215,65535,16777215,2039583,-1,0,1,3,2,30,30,50&lt;br /&gt;
Comment: Marked=0,0:00:10.0,0:00:12.0,title,,0000,0000,0000,From the collection &lt;br /&gt;
of\nAnnapuma's Script Crypt http://www.archea.demon.co.uk/crypt.html&lt;br /&gt;
Comment: Marked=0,0:00:13.0,0:00:15.0,White Text,,0000,0000,0000,Original transl&lt;br /&gt;
ation by Arctic Animation&lt;br /&gt;
Comment: Marked=0,0:00:16.0,0:00:18.0,White Text,,0000,0000,0000,Re-timed, re-ed&lt;br /&gt;
ited, and partially re-translated by Studio Kawaii&lt;br /&gt;
Comment: Marked=0,0:00:19.0,0:00:21.0,White Text,synch point,0000,0000,0000,Stud&lt;br /&gt;
io Kawaii version SK 1.0&lt;br /&gt;
Comment: Marked=0,0:00:22.0,0:00:24.0,*Default,synch point,0000,0000,0000,Pause &lt;br /&gt;
laserdisk at chapter 1.  Unpause laserdisk and begin subtitling simultaneously&lt;br /&gt;
Dialogue: Marked=0,0:01:16.0,0:01:23.4,White Text,Usagi,0000,0000,0000,Pretty So&lt;br /&gt;
ldier Sailor Moon&lt;br /&gt;
Dialogue: Marked=0,0:01:30.1,0:01:33.3,Song Title,Usagi,0000,0000,0000,{\a5}Wish&lt;br /&gt;
 I could be as honest about you&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Subtitle Formats]]&lt;/div&gt;</summary>
		<author><name>Aurel</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=FFmpeg_SFLC_representation&amp;diff=11035</id>
		<title>FFmpeg SFLC representation</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=FFmpeg_SFLC_representation&amp;diff=11035"/>
		<updated>2009-02-03T00:16:05Z</updated>

		<summary type="html">&lt;p&gt;Aurel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== FFmpeg legal representation ===&lt;br /&gt;
&lt;br /&gt;
The [http://softwarefreedom.org/ Software Freedom Law Center (SFLC)] represents FFmpeg in legal affairs. To do this, they need a signed contract with individual copyright holders that gives them the right to represent them in legal matters concerning FFmpeg. To have an overview who signed those papers, we are collecting the names of those developers who already signed here.&lt;br /&gt;
&lt;br /&gt;
Add your names in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
* Aurelien Jacobs&lt;br /&gt;
* Diego Biurrun&lt;br /&gt;
&lt;br /&gt;
[[Category:FFmpeg]]&lt;/div&gt;</summary>
		<author><name>Aurel</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Electronic_Arts_Formats&amp;diff=8842</id>
		<title>Electronic Arts Formats</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Electronic_Arts_Formats&amp;diff=8842"/>
		<updated>2007-10-28T16:02:06Z</updated>

		<summary type="html">&lt;p&gt;Aurel: set NFSC byte order&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Extensions: ASF, CMV, DCT, SND, TGI, TGV, TGQ, WVE, UV, UV2, MAD, VP6&lt;br /&gt;
* Company: [[Electronic Arts]]&lt;br /&gt;
&lt;br /&gt;
Electronic Arts, the video game publishing empire, and the various constituent development houses under its umbrella, have deployed a number of multimedia formats in its games.&lt;br /&gt;
&lt;br /&gt;
EA multimedia formats are comprised of a series of blocks with the following format:&lt;br /&gt;
&lt;br /&gt;
 bytes 0-3    block type [[FourCC]]&lt;br /&gt;
 bytes 4-7    block size (including this 8-byte preamble)&lt;br /&gt;
 bytes 8..    block payload&lt;br /&gt;
&lt;br /&gt;
It is important to note that there is no consistent byte order for multi-byte numbers. However, order is optimized for target platform.&lt;br /&gt;
&lt;br /&gt;
== Chunk Types ==&lt;br /&gt;
&lt;br /&gt;
* Audio&lt;br /&gt;
** [[Electronic Arts SEAD]]: SEAD, SNDC, SEND&lt;br /&gt;
** [[Electronic Arts 1SNx]]: 1SNh, 1SNd, 1SNl, 1SNe&lt;br /&gt;
** [[Electronic Arts SCxl]]: SCHl, SCCl, SCDl, SCLl, SCEl&lt;br /&gt;
* Video&lt;br /&gt;
** [[Electronic Arts CMV]]: MVIh, MVIf, MVIe&lt;br /&gt;
** [[Electronic Arts TGV]]: kVGT, fVGT&lt;br /&gt;
** [[Electronic Arts DCT]]: mTCD&lt;br /&gt;
** [[Electronic Arts TGQ]]: pQTG, TGQs (rumored MUVf?)&lt;br /&gt;
** [[Electronic Arts TQI]]: pIQT, (rumored UV2f?)&lt;br /&gt;
** [[Electronic Arts MAD]]: MADk, MADm, MADe&lt;br /&gt;
** [[Electronic Arts VP6]]: MVhd, MV0K, MV0F&lt;br /&gt;
** [[Electronic Arts MPC]]: MPCh&lt;br /&gt;
&lt;br /&gt;
== Games Using Electronic Arts Multimedia Formats ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
! Name !! File Ext !! Video Codec !! Audio Codec || Byte Order&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/dos/nhl-95 NHL 95]&lt;br /&gt;
| cmv || CMV || none || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/dos/nhl-96 NHL 96]&lt;br /&gt;
| tgv || ? || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/dos/cybermage-darklight-awakening CyberMage: Darklight Awakening]&lt;br /&gt;
| tgv || TGV || 1SNx/EACS/pcm_s8 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed Need for Speed]&lt;br /&gt;
| tgv || TGV || 1SNx/EACS/pcm_s8 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/privateer-2-the-darkening Privateer 2: The Darkening]&lt;br /&gt;
| tgv || TGV || SEAD/adpcm_ima_ea_sead || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/dos/nba-live-96 NBA Live 96]&lt;br /&gt;
| tgv || TGV || 1SNh/EACS/adpcm_ima_ea_eacs || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-ii Need for Speed 2]&lt;br /&gt;
| dct || DCT || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-ii Need for Speed 2 (Demo)]&lt;br /&gt;
| uv || TGQ || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/saturn/warcraft-ii-the-dark-saga Warcraft II: The Dark Saga (Sega Saturn)]&lt;br /&gt;
| tgq || TGQ || ? || be&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/superbike-2001 Superbike 2001]&lt;br /&gt;
| tgq || ? || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/saturn/crusader-no-remorse Crusader: No Remorse (Sega Saturn)]&lt;br /&gt;
| tgq || TGQ || 1SNh/EACS/mulaw || be&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/harry-potter-quidditch-world-cup Harry Potter: Quidditch World Cup]&lt;br /&gt;
| tgq || TQI (not a typo) || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/windows/wing-commander-prophecy Wing Commander: Prophecy]&lt;br /&gt;
| wve || TQI || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/windows/the-sims The Sims]&lt;br /&gt;
| wve || TQI || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/nba-live-99 NBA Live 99]&lt;br /&gt;
| mad || MAD || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-iii-hot-pursuit Need for Speed 3: Hot Pursuit]&lt;br /&gt;
| mad || MAD || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-high-stakes Need for Speed 4: High Stakes]&lt;br /&gt;
| mad || MAD || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-porsche-unleashed Need for Speed 5: Porsche]&lt;br /&gt;
| mad || MAD || SCHl/PT/adpcm_ea_r1 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-hot-pursuit-2 Need for Speed 6: Hot Pursuit 2]&lt;br /&gt;
| mad || MAD || SCHl/PT/adpcm_ea_r1 || le&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot;| [http://www.mobygames.com/game/nba-live-2003 NBA Live 2003]&lt;br /&gt;
| mad || MAD || pcm_s16le_planar || le&lt;br /&gt;
|-&lt;br /&gt;
| asf || none || SCHl/PT/mp3 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/fifa-soccer-2005 FIFA 2004]&lt;br /&gt;
| mad || ? || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/fifa-soccer-2005 FIFA 2005]&lt;br /&gt;
| mad || MAD || SCHl/PT/adpcm_ea_r1, SCHl/PT/adpcm_ea_r3 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/windows/simcity-4-rush-hour Sim City 4: Rush Hour]&lt;br /&gt;
| mad || MAD || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/sims-2 The Sims 2]&lt;br /&gt;
| mad || MAD || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-underground-2 Need for Speed: Underground 2]&lt;br /&gt;
| vp6 || VP6 || SCHl/GSTR/adpcm_ea_r3 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-most-wanted Need for Speed: Most Wanted]&lt;br /&gt;
| vp6 || VP6 || SCHl/GSTR/adpcm_ea_r3 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-carbon Need for Speed: Carbon]&lt;br /&gt;
| vp6 || VP6 || SCHl/GSTR/adpcm_ea_r3 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/windows/lord-of-the-rings-the-battle-for-middle-earth The Lord of the Rings: The Battle for Middle Earth]&lt;br /&gt;
| vp6 || VP6 || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/lord-of-the-rings-the-battle-for-middle-earth-ii The Lord of the Rings: The Battle for Middle Earth II]&lt;br /&gt;
| vp6 || VP6 || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/windows/lord-of-the-rings-the-battle-for-middle-earth-ii-the-rise-of-the The Lord of the Rings: The Battle for Middle Earth II - The Rise of the Witch-King]&lt;br /&gt;
| vp6 || VP6 || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| Command &amp;amp; Conquer: Tiberium Wars&lt;br /&gt;
| vp6/snd || VP6 || adpcm_ea_r3 || le&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In addition to FMV, the EA audio chunk types are frequently used throughout Electronic Arts games for music tracks, audio effects and speech. Older titles use the .ASF file extension for individual music tracks, whereas newer titles store multiple audio sequentially within the one file (hence rational for the ending chunk types) and use a variety of file extensions. &lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Aurel</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Electronic_Arts_Formats&amp;diff=8841</id>
		<title>Electronic Arts Formats</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Electronic_Arts_Formats&amp;diff=8841"/>
		<updated>2007-10-28T15:59:21Z</updated>

		<summary type="html">&lt;p&gt;Aurel: fix codec name&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Extensions: ASF, CMV, DCT, SND, TGI, TGV, TGQ, WVE, UV, UV2, MAD, VP6&lt;br /&gt;
* Company: [[Electronic Arts]]&lt;br /&gt;
&lt;br /&gt;
Electronic Arts, the video game publishing empire, and the various constituent development houses under its umbrella, have deployed a number of multimedia formats in its games.&lt;br /&gt;
&lt;br /&gt;
EA multimedia formats are comprised of a series of blocks with the following format:&lt;br /&gt;
&lt;br /&gt;
 bytes 0-3    block type [[FourCC]]&lt;br /&gt;
 bytes 4-7    block size (including this 8-byte preamble)&lt;br /&gt;
 bytes 8..    block payload&lt;br /&gt;
&lt;br /&gt;
It is important to note that there is no consistent byte order for multi-byte numbers. However, order is optimized for target platform.&lt;br /&gt;
&lt;br /&gt;
== Chunk Types ==&lt;br /&gt;
&lt;br /&gt;
* Audio&lt;br /&gt;
** [[Electronic Arts SEAD]]: SEAD, SNDC, SEND&lt;br /&gt;
** [[Electronic Arts 1SNx]]: 1SNh, 1SNd, 1SNl, 1SNe&lt;br /&gt;
** [[Electronic Arts SCxl]]: SCHl, SCCl, SCDl, SCLl, SCEl&lt;br /&gt;
* Video&lt;br /&gt;
** [[Electronic Arts CMV]]: MVIh, MVIf, MVIe&lt;br /&gt;
** [[Electronic Arts TGV]]: kVGT, fVGT&lt;br /&gt;
** [[Electronic Arts DCT]]: mTCD&lt;br /&gt;
** [[Electronic Arts TGQ]]: pQTG, TGQs (rumored MUVf?)&lt;br /&gt;
** [[Electronic Arts TQI]]: pIQT, (rumored UV2f?)&lt;br /&gt;
** [[Electronic Arts MAD]]: MADk, MADm, MADe&lt;br /&gt;
** [[Electronic Arts VP6]]: MVhd, MV0K, MV0F&lt;br /&gt;
** [[Electronic Arts MPC]]: MPCh&lt;br /&gt;
&lt;br /&gt;
== Games Using Electronic Arts Multimedia Formats ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
! Name !! File Ext !! Video Codec !! Audio Codec || Byte Order&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/dos/nhl-95 NHL 95]&lt;br /&gt;
| cmv || CMV || none || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/dos/nhl-96 NHL 96]&lt;br /&gt;
| tgv || ? || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/dos/cybermage-darklight-awakening CyberMage: Darklight Awakening]&lt;br /&gt;
| tgv || TGV || 1SNx/EACS/pcm_s8 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed Need for Speed]&lt;br /&gt;
| tgv || TGV || 1SNx/EACS/pcm_s8 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/privateer-2-the-darkening Privateer 2: The Darkening]&lt;br /&gt;
| tgv || TGV || SEAD/adpcm_ima_ea_sead || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/dos/nba-live-96 NBA Live 96]&lt;br /&gt;
| tgv || TGV || 1SNh/EACS/adpcm_ima_ea_eacs || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-ii Need for Speed 2]&lt;br /&gt;
| dct || DCT || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-ii Need for Speed 2 (Demo)]&lt;br /&gt;
| uv || TGQ || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/saturn/warcraft-ii-the-dark-saga Warcraft II: The Dark Saga (Sega Saturn)]&lt;br /&gt;
| tgq || TGQ || ? || be&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/superbike-2001 Superbike 2001]&lt;br /&gt;
| tgq || ? || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/saturn/crusader-no-remorse Crusader: No Remorse (Sega Saturn)]&lt;br /&gt;
| tgq || TGQ || 1SNh/EACS/mulaw || be&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/harry-potter-quidditch-world-cup Harry Potter: Quidditch World Cup]&lt;br /&gt;
| tgq || TQI (not a typo) || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/windows/wing-commander-prophecy Wing Commander: Prophecy]&lt;br /&gt;
| wve || TQI || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/windows/the-sims The Sims]&lt;br /&gt;
| wve || TQI || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/nba-live-99 NBA Live 99]&lt;br /&gt;
| mad || MAD || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-iii-hot-pursuit Need for Speed 3: Hot Pursuit]&lt;br /&gt;
| mad || MAD || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-high-stakes Need for Speed 4: High Stakes]&lt;br /&gt;
| mad || MAD || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-porsche-unleashed Need for Speed 5: Porsche]&lt;br /&gt;
| mad || MAD || SCHl/PT/adpcm_ea_r1 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-hot-pursuit-2 Need for Speed 6: Hot Pursuit 2]&lt;br /&gt;
| mad || MAD || SCHl/PT/adpcm_ea_r1 || le&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot;| [http://www.mobygames.com/game/nba-live-2003 NBA Live 2003]&lt;br /&gt;
| mad || MAD || pcm_s16le_planar || le&lt;br /&gt;
|-&lt;br /&gt;
| asf || none || SCHl/PT/mp3 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/fifa-soccer-2005 FIFA 2004]&lt;br /&gt;
| mad || ? || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/fifa-soccer-2005 FIFA 2005]&lt;br /&gt;
| mad || MAD || SCHl/PT/adpcm_ea_r1, SCHl/PT/adpcm_ea_r3 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/windows/simcity-4-rush-hour Sim City 4: Rush Hour]&lt;br /&gt;
| mad || MAD || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/sims-2 The Sims 2]&lt;br /&gt;
| mad || MAD || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-underground-2 Need for Speed: Underground 2]&lt;br /&gt;
| vp6 || VP6 || SCHl/GSTR/adpcm_ea_r3 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-most-wanted Need for Speed: Most Wanted]&lt;br /&gt;
| vp6 || VP6 || SCHl/GSTR/adpcm_ea_r3 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-carbon Need for Speed: Carbon]&lt;br /&gt;
| vp6 || VP6 || SCHl/GSTR/adpcm_ea_r3 || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/windows/lord-of-the-rings-the-battle-for-middle-earth The Lord of the Rings: The Battle for Middle Earth]&lt;br /&gt;
| vp6 || VP6 || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/lord-of-the-rings-the-battle-for-middle-earth-ii The Lord of the Rings: The Battle for Middle Earth II]&lt;br /&gt;
| vp6 || VP6 || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/windows/lord-of-the-rings-the-battle-for-middle-earth-ii-the-rise-of-the The Lord of the Rings: The Battle for Middle Earth II - The Rise of the Witch-King]&lt;br /&gt;
| vp6 || VP6 || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| Command &amp;amp; Conquer: Tiberium Wars&lt;br /&gt;
| vp6/snd || VP6 || adpcm_ea_r3 || le&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In addition to FMV, the EA audio chunk types are frequently used throughout Electronic Arts games for music tracks, audio effects and speech. Older titles use the .ASF file extension for individual music tracks, whereas newer titles store multiple audio sequentially within the one file (hence rational for the ending chunk types) and use a variety of file extensions. &lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Aurel</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Electronic_Arts_Formats&amp;diff=8833</id>
		<title>Electronic Arts Formats</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Electronic_Arts_Formats&amp;diff=8833"/>
		<updated>2007-10-26T17:53:28Z</updated>

		<summary type="html">&lt;p&gt;Aurel: specify NFSC audio format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Extensions: ASF, CMV, DCT, SND, TGI, TGV, TGQ, WVE, UV, UV2, MAD, VP6&lt;br /&gt;
* Company: [[Electronic Arts]]&lt;br /&gt;
&lt;br /&gt;
Electronic Arts, the video game publishing empire, and the various constituent development houses under its umbrella, have deployed a number of multimedia formats in its games.&lt;br /&gt;
&lt;br /&gt;
EA multimedia formats are comprised of a series of blocks with the following format:&lt;br /&gt;
&lt;br /&gt;
 bytes 0-3    block type [[FourCC]]&lt;br /&gt;
 bytes 4-7    block size (including this 8-byte preamble)&lt;br /&gt;
 bytes 8..    block payload&lt;br /&gt;
&lt;br /&gt;
It is important to note that there is no consistent byte order for multi-byte numbers. However, order is optimized for target platform.&lt;br /&gt;
&lt;br /&gt;
== Chunk Types ==&lt;br /&gt;
&lt;br /&gt;
* Audio&lt;br /&gt;
** [[Electronic Arts SEAD]]: SEAD, SNDC, SEND&lt;br /&gt;
** [[Electronic Arts 1SNx]]: 1SNh, 1SNd, 1SNl, 1SNe&lt;br /&gt;
** [[Electronic Arts SCxl]]: SCHl, SCCl, SCDl, SCLl, SCEl&lt;br /&gt;
* Video&lt;br /&gt;
** [[Electronic Arts CMV]]: MVIh, MVIf, MVIe&lt;br /&gt;
** [[Electronic Arts TGV]]: kVGT, fVGT&lt;br /&gt;
** [[Electronic Arts DCT]]: mTCD&lt;br /&gt;
** [[Electronic Arts TGQ]]: pQTG, TGQs (rumored MUVf?)&lt;br /&gt;
** [[Electronic Arts TQI]]: pIQT, (rumored UV2f?)&lt;br /&gt;
** [[Electronic Arts MAD]]: MADk, MADm, MADe&lt;br /&gt;
** [[Electronic Arts VP6]]: MVhd, MV0K, MV0F&lt;br /&gt;
** [[Electronic Arts MPC]]: MPCh&lt;br /&gt;
&lt;br /&gt;
== Games Using Electronic Arts Multimedia Formats ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
! Name !! File Ext !! Video Codec !! Audio Codec || Byte Order&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/dos/nhl-95 NHL 95]&lt;br /&gt;
| cmv || CMV || none || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/dos/nhl-96 NHL 96]&lt;br /&gt;
| tgv || ? || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/dos/cybermage-darklight-awakening CyberMage: Darklight Awakening]&lt;br /&gt;
| tgv || TGV || 1SNx/EACS/pcm_s8 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed Need for Speed]&lt;br /&gt;
| tgv || TGV || 1SNx/EACS/pcm_s8 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/privateer-2-the-darkening Privateer 2: The Darkening]&lt;br /&gt;
| tgv || TGV || SEAD/adpcm_ima_ea_sead || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/dos/nba-live-96 NBA Live 96]&lt;br /&gt;
| tgv || TGV || 1SNh/EACS/adpcm_ima_ea_eacs || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-ii Need for Speed 2]&lt;br /&gt;
| dct || DCT || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-ii Need for Speed 2 (Demo)]&lt;br /&gt;
| uv || TGQ || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/saturn/warcraft-ii-the-dark-saga Warcraft II: The Dark Saga (Sega Saturn)]&lt;br /&gt;
| tgq || TGQ || ? || be&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/superbike-2001 Superbike 2001]&lt;br /&gt;
| tgq || ? || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/saturn/crusader-no-remorse Crusader: No Remorse (Sega Saturn)]&lt;br /&gt;
| tgq || TGQ || 1SNh/EACS/mulaw || be&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/harry-potter-quidditch-world-cup Harry Potter: Quidditch World Cup]&lt;br /&gt;
| tgq || TQI (not a typo) || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/windows/wing-commander-prophecy Wing Commander: Prophecy]&lt;br /&gt;
| wve || TQI || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/windows/the-sims The Sims]&lt;br /&gt;
| wve || TQI || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/nba-live-99 NBA Live 99]&lt;br /&gt;
| mad || MAD || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-iii-hot-pursuit Need for Speed 3: Hot Pursuit]&lt;br /&gt;
| mad || MAD || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-high-stakes Need for Speed 4: High Stakes]&lt;br /&gt;
| mad || MAD || SCHl/PT/adpcm_ea || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-porsche-unleashed Need for Speed 5: Porsche]&lt;br /&gt;
| mad || MAD || SCHl/PT/adpcm_ea_r1 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-hot-pursuit-2 Need for Speed 6: Hot Pursuit 2]&lt;br /&gt;
| mad || MAD || SCHl/PT/adpcm_ea_r1 || le&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot;| [http://www.mobygames.com/game/nba-live-2003 NBA Live 2003]&lt;br /&gt;
| mad || MAD || pcm_s16le_planar || le&lt;br /&gt;
|-&lt;br /&gt;
| asf || none || SCHl/PT/mp3 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/fifa-soccer-2005 FIFA 2004]&lt;br /&gt;
| mad || ? || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/fifa-soccer-2005 FIFA 2005]&lt;br /&gt;
| mad || MAD || SCHl/PT/adpcm_ea_r1, SCHl/PT/adpcm_ea_r3 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/windows/simcity-4-rush-hour Sim City 4: Rush Hour]&lt;br /&gt;
| mad || MAD || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/sims-2 The Sims 2]&lt;br /&gt;
| mad || MAD || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-underground-2 Need for Speed: Underground 2]&lt;br /&gt;
| vp6 || VP6 || SCHl/GSTR/ealayer3 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-most-wanted Need for Speed: Most Wanted]&lt;br /&gt;
| vp6 || VP6 || SCHl/GSTR/ealayer3 || le&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/need-for-speed-carbon Need for Speed: Carbon]&lt;br /&gt;
| vp6 || VP6 || SCHl/GSTR/adpcm_ea_r3 || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/windows/lord-of-the-rings-the-battle-for-middle-earth The Lord of the Rings: The Battle for Middle Earth]&lt;br /&gt;
| vp6 || VP6 || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/lord-of-the-rings-the-battle-for-middle-earth-ii The Lord of the Rings: The Battle for Middle Earth II]&lt;br /&gt;
| vp6 || VP6 || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mobygames.com/game/windows/lord-of-the-rings-the-battle-for-middle-earth-ii-the-rise-of-the The Lord of the Rings: The Battle for Middle Earth II - The Rise of the Witch-King]&lt;br /&gt;
| vp6 || VP6 || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| Command &amp;amp; Conquer: Tiberium Wars&lt;br /&gt;
| vp6/snd || VP6 || adpcm_ea_r3 || le&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In addition to FMV, the EA audio chunk types are frequently used throughout Electronic Arts games for music tracks, audio effects and speech. Older titles use the .ASF file extension for individual music tracks, whereas newer titles store multiple audio sequentially within the one file (hence rational for the ending chunk types) and use a variety of file extensions. &lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Aurel</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=On2_VP6&amp;diff=8706</id>
		<title>On2 VP6</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=On2_VP6&amp;diff=8706"/>
		<updated>2007-10-14T22:54:20Z</updated>

		<summary type="html">&lt;p&gt;Aurel: Alternative coding is in fact huffman&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* FOURCCs: VP60, VP61, VP62&lt;br /&gt;
* Company: [[On2]]&lt;br /&gt;
* Whitepaper: [http://www.on2.com/cms-data/pdf/1125607149174329.pdf http://www.on2.com/cms-data/pdf/1125607149174329.pdf]&lt;br /&gt;
* Samples: [http://samples.mplayerhq.hu/V-codecs/VP6/ http://samples.mplayerhq.hu/V-codecs/VP6/]&lt;br /&gt;
&lt;br /&gt;
== Implementations ==&lt;br /&gt;
&lt;br /&gt;
An early open source implementation could be found at http://libvp62.sourceforge.net/, but&lt;br /&gt;
was driven underground by On2 on copyright infringement claims.&lt;br /&gt;
&lt;br /&gt;
This specification is said to be incomplete with regard to the On2 VP6 specification.&lt;br /&gt;
&lt;br /&gt;
A decoder implementation may be found in the FFMPEG source file [http://svn.mplayerhq.hu/ffmpeg/trunk/libavcodec/vp6.c?view=markup vp6.c]&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
The aim here is to open this standard with a full description of the bitstream format and decoding process.  Contributors from On2 especially encouraged here, but it is anticipated that this section will be completed through reverse engineering and by people who saw libvp62 source code before it was censored.  &lt;br /&gt;
&lt;br /&gt;
Please do not submit any copyrighted text or code here.&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
VP6 uses unidirectional (&amp;quot;P-frame&amp;quot;) and intra-frame (within the current frame) prediction. Entropy coding is performed using arithmetic  (range?) coding and an 8x8 iDCT is used.  The format supports dynamic adjustment of encoded video resolution. There are three variants of the VP6 codec, VP60 (Simple Profile), VP62 (Advanced Profile) and VP62 (Heightened Sharpness Profile).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Macroblocks ===&lt;br /&gt;
&lt;br /&gt;
Each video frame is composed of an array of 16x16 macroblocks, just like [[MPEG-2]], [[MPEG-4]] parts 2 and 10.  Each [[MB]] (macroblock) takes one of the following modes (&amp;quot;[[MV]]&amp;quot; means &amp;quot;motion vector&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
* Intra MB&lt;br /&gt;
* Inter MB, null MV, previous frame reference&lt;br /&gt;
* Inter MB, differential MV, previous frame reference&lt;br /&gt;
* Inter MB, four MVs, previous frame reference&lt;br /&gt;
* Inter MB, MV 1, previous frame reference&lt;br /&gt;
* Inter MB, MV 2, previous frame reference&lt;br /&gt;
* Inter MB, null MV, bookmarked frame reference&lt;br /&gt;
* Inter MB, differential MV, bookmarked frame reference&lt;br /&gt;
* Inter MB, MV 1, bookmarked frame reference&lt;br /&gt;
* Inter MB, MV 2, bookmarked frame reference&lt;br /&gt;
&lt;br /&gt;
=== Frame Header ===&lt;br /&gt;
&lt;br /&gt;
The frame header commences with a section that is encoded using conventional big-endian bit packing.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Syntax !! Number of bits !! Type !! Semantics&lt;br /&gt;
|- &lt;br /&gt;
| frame_mode || 1 || Enum || 0x0 signifies an intra frame&lt;br /&gt;
|-&lt;br /&gt;
| qp || 6 || Unsigned || Quantization parameter valid range 0..63&lt;br /&gt;
|-&lt;br /&gt;
| marker || 1 || Constant || 0=VP61/62, 1=VP60&lt;br /&gt;
|-&lt;br /&gt;
| if (frame_mode == 0) { || || ||0 equals to INTRA_FRAME&lt;br /&gt;
|-&lt;br /&gt;
| version || 5 || Constant || 6=VP60/61, 7=VP60(Electronic Arts), 8=VP62&lt;br /&gt;
|-&lt;br /&gt;
| version2 || 2 || Constant || 0=VP60, 3=VP61/62&lt;br /&gt;
|-&lt;br /&gt;
| interlace || 1 || Boolean || true (1) means interlace will be used&lt;br /&gt;
|-&lt;br /&gt;
| if (marker==1 or version2==0) {&lt;br /&gt;
|-&lt;br /&gt;
| offset || 16 || Unsigned || secondary buffer offset (bytes releative to start of buffer)&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| dim_y || 8 || Unsigned || Macroblock height of video &lt;br /&gt;
|-&lt;br /&gt;
| dim_x || 8 || Unsigned || Macroblock width of video &lt;br /&gt;
|-&lt;br /&gt;
| render_y || 8 || Unsigned || Display height of video &lt;br /&gt;
|-&lt;br /&gt;
| render_x || 8 || Unsigned || Display width of video&lt;br /&gt;
|-&lt;br /&gt;
| }else{&lt;br /&gt;
|-&lt;br /&gt;
| if (marker==1 or version2==0) {&lt;br /&gt;
|-&lt;br /&gt;
| offset || 16 || Unsigned || secondary buffer offset (bytes releative to start of buffer)&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If dim_x or dim_y have values different from the previous intra frame, then the resolution of the encoded image has changed.&lt;br /&gt;
&lt;br /&gt;
Arithmetic coding commences at the next bit (which should be on a byte boundary):&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Syntax !! Type !! Semantics&lt;br /&gt;
|-&lt;br /&gt;
| if (frame_mode == 0) {&lt;br /&gt;
|-&lt;br /&gt;
| marker1 || Equiprobable 2-bit || Ignored&lt;br /&gt;
|-&lt;br /&gt;
| } else {&lt;br /&gt;
|-&lt;br /&gt;
| bookmark || Equiprobable 1-bit || bookmark == 0x1 means this frame will be the next bookmark frame&lt;br /&gt;
|-&lt;br /&gt;
| filter1 || Equiprobable 1-bit || &lt;br /&gt;
|-&lt;br /&gt;
| if (filter1 == 0x1) {&lt;br /&gt;
|-&lt;br /&gt;
| filter2 || Equiprobable 1-bit || &lt;br /&gt;
|-&lt;br /&gt;
| } &lt;br /&gt;
|-&lt;br /&gt;
| filter_info || Equiprobable 1-bit ||&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| if (frame_mode == 0 &amp;lt;nowiki&amp;gt;||&amp;lt;/nowiki&amp;gt; filter_info == 0x1) {&lt;br /&gt;
|-&lt;br /&gt;
| filter_mode1 || Equiprobable 1-bit ||&lt;br /&gt;
|-&lt;br /&gt;
| if (filter_mode1 == 0x1) {&lt;br /&gt;
|-&lt;br /&gt;
| filter_threshold1 || Equiprobable 5-bit ||&lt;br /&gt;
|-&lt;br /&gt;
| filter_motion_param || Equiprobable 3-bit ||&lt;br /&gt;
|-&lt;br /&gt;
| } else {&lt;br /&gt;
|-&lt;br /&gt;
| filter_mode2 || Equiprobable 1-bit ||&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| filter_mode3 || Equiprobable 4-bit ||&lt;br /&gt;
|-&lt;br /&gt;
| } &lt;br /&gt;
|-&lt;br /&gt;
| marker2 || Equiprobable 1-bit || Secondary buffer encoding algorithm. 0=Range coding, 1=Huffman coding.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If the secondary buffer is present, coeffient symbols are read from the secondary buffer using the algorithm indicated by marker2. VP60 has &amp;quot;the ability to switch to a faster entropy encoding strategy to ensure smooth playback&amp;quot; and &amp;quot;the ability to decode different parts of the bitstream on different sub-processors (for instance the vlx and the core), to ensure better overall system utilization&amp;quot; [http://www.on2.com/cms-data/pdf/1125607149174329.pdf].&lt;br /&gt;
&lt;br /&gt;
=== Entropy Coding ===&lt;br /&gt;
&lt;br /&gt;
Described here is the decoding process for the arithmetically-coded (AC) parts of the bitstream.  VP6 uses a 16-bit [http://en.wikipedia.org/wiki/Range_encoding range coding] scheme to code binary symbols.&lt;br /&gt;
&lt;br /&gt;
The AC decoder maintains three state variables:  ''code'', ''mask'' and ''high''.  &lt;br /&gt;
&lt;br /&gt;
====Initialization====&lt;br /&gt;
&lt;br /&gt;
At initialization, the first two bytes of the AC bitstream are shifted into ''code''.  The variable ''high'' is set to 0xff00.  The variable ''mask'' is set to 0xffff.&lt;br /&gt;
&lt;br /&gt;
====Decoding a Binary Value====&lt;br /&gt;
&lt;br /&gt;
Each binary symbol has an associated probability ''p'' in the range 0 to 0xff.  &lt;br /&gt;
&lt;br /&gt;
A threshold, ''t'', is computed thus:&lt;br /&gt;
&lt;br /&gt;
: ''t'' = 0x100 + ( 0xff00 &amp;amp; ( ( (''high''-0x100) * ''p'' ) &amp;gt;&amp;gt; 8 ) )&lt;br /&gt;
&lt;br /&gt;
Equiprobable binary symbols are treated somewhat differently:&lt;br /&gt;
&lt;br /&gt;
: ''t'' = 0xff00 &amp;amp; ( (''high''+0x100) &amp;gt;&amp;gt; 1 )&lt;br /&gt;
&lt;br /&gt;
The binary value may then be decoded by comparing ''code'' and ''t''.  If ''code'' is less than ''t'', the binary value is decoded as 0.  If ''code'' is equal to or greater than ''t'', the binary value is decoded as 1.&lt;br /&gt;
&lt;br /&gt;
If a 1 was decoded, then&lt;br /&gt;
&lt;br /&gt;
: ''high'' = ''high'' - ''t''&lt;br /&gt;
: ''code'' = ''code'' - ''t''&lt;br /&gt;
&lt;br /&gt;
If a 0 was decoded, then&lt;br /&gt;
&lt;br /&gt;
: ''high'' = ''t''&lt;br /&gt;
&lt;br /&gt;
The following renormalization is now repeated while (''high'' &amp;amp; 0x8000) is non-zero.&lt;br /&gt;
&lt;br /&gt;
: ''high'' = 2 * ''high''&lt;br /&gt;
: ''code'' = 2 * ''code''&lt;br /&gt;
: ''mask'' = 2 * ''mask''&lt;br /&gt;
: if ((''mask'' &amp;amp; 0xff) == 0x00) {&lt;br /&gt;
:: ''code'' = ''code'' | &amp;lt;i&amp;gt;next byte from bitstream&amp;lt;/i&amp;gt;&lt;br /&gt;
:: ''mask'' = ''mask'' | 0xff&lt;br /&gt;
:}&lt;br /&gt;
&lt;br /&gt;
====Decoding an Equiprobable n-bit Integer Value====&lt;br /&gt;
&lt;br /&gt;
Integer values are coded as a big-endian sequence of equiprobable binary values.  To decode an n-bit equiprobable integer value, n equiprobable binary values should be decoded using the sequence above and left-shifted into an integral result variable.&lt;br /&gt;
&lt;br /&gt;
=== Inverse DCT ===&lt;br /&gt;
&lt;br /&gt;
Inverse DCT is performed on 8x8 blocks of pixels. The algorithm used is the same (or a small variation) of the one used for the [[On2 VP3|VP3]] decoder in [[FFmpeg]] [http://www1.mplayerhq.hu/cgi-bin/cvsweb.cgi/ffmpeg/libavcodec/vp3dsp.c?rev=1.9&amp;amp;content-type=text/x-cvsweb-markup&amp;amp;cvsroot=FFMpeg], the original vp3 iDCT code is here [http://svn.xiph.org/trunk/vp32/CoreLibs/CDXV/Vp31/dx/generic/IDctPart.c].&lt;br /&gt;
&lt;br /&gt;
[[Category:Video Codecs]]&lt;br /&gt;
[[Category:Incomplete Video Codecs]]&lt;/div&gt;</summary>
		<author><name>Aurel</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=FFmpeg_Summer_Of_Code_2007&amp;diff=7151</id>
		<title>FFmpeg Summer Of Code 2007</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=FFmpeg_Summer_Of_Code_2007&amp;diff=7151"/>
		<updated>2007-03-07T21:45:36Z</updated>

		<summary type="html">&lt;p&gt;Aurel: /* Matroska Muxer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://www.google.com/ Google] is sponsoring their third annual Summer of Code for the summer of 2007. This entails sponsoring students to work on assorted open source projects as well as sponsoring mentors in those same projects. Everyone wins.&lt;br /&gt;
&lt;br /&gt;
[[FFmpeg]] was a Summer of Code participant in the summer of 2006 (here is the [[FFmpeg Summer Of Code|corresponding Wiki page]]) and hopes to be accepted again this year.&lt;br /&gt;
&lt;br /&gt;
[[User:Multimedia Mike|Mike Melanson]] (mike -at- multimedia.cx) is the administrator and main point of contact for matters relating to the FFmpeg Summer of Code.&lt;br /&gt;
&lt;br /&gt;
== How to apply ==&lt;br /&gt;
&lt;br /&gt;
Before you can apply make sure you are qualified enough to apply. Last year 50% of the applicants weren't qualified for the task they applied for.&lt;br /&gt;
&lt;br /&gt;
* You have to know how to program in C fairly well.&lt;br /&gt;
* We would like you to submit a patch that fixes a bug or adds a feature to FFmpeg. By doing that we will know that you are qualified for the task or not. On this page there is a list of [[Summer Of Code 2007#Small_tasks|Small Tasks]] that can be done. But you are free to submit anything you feel might be of value to FFmpeg.&lt;br /&gt;
* Submit a good application.&lt;br /&gt;
&lt;br /&gt;
== Current Status ==&lt;br /&gt;
* March 5-12, 2007: Application period for mentoring organizations.&lt;br /&gt;
* March 6, 2007: Mike Melanson submitted FFmpeg mentoring application.&lt;br /&gt;
Waiting for acceptance...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Proposals ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
Qualifications for a good Summer of Code proposal:&lt;br /&gt;
* discrete, well-defined, modular&lt;br /&gt;
* comprised of a series of measurable sub-goals&lt;br /&gt;
* based on open specs that are available free of charge&lt;br /&gt;
* based on complete specs&lt;br /&gt;
An example of a good proposal is the implementation of a decoder or demuxer for an as yet unsupported multimedia format, or an encoder or muxer for a format that can already be demuxed/decoded by FFmpeg.&lt;br /&gt;
&lt;br /&gt;
An example of a less desirable proposal is one that's not as measurable, such as refactoring APIs. Bad proposals tend to be ones that would require touching a lot of core code.&lt;br /&gt;
&lt;br /&gt;
To re-iterate:&lt;br /&gt;
* Localized/isolated code projects = ''good''&lt;br /&gt;
* Global code refactoring = ''bad''&lt;br /&gt;
&lt;br /&gt;
=== JPEG2000 ===&lt;br /&gt;
* Specifications: [http://www.itu.int/rec/T-REC-T/e As ITU-T recommendations], [http://isotc.iso.org/livelink/livelink/fetch/2000/2489/Ittf_Home/PubliclyAvailableStandards.htm ISO publicly available standards]&lt;br /&gt;
* Sources: [http://www.ece.uvic.ca/~mdadams/jasper/ JasPer], [http://www.openjpeg.org/ OpenJpeg], [http://jj2000.epfl.ch/ JJ2000 (in Java)]&lt;br /&gt;
* Samples: [http://samples.mplayerhq.hu/jpeg2000/ http://samples.mplayerhq.hu/jpeg2000/]&lt;br /&gt;
&lt;br /&gt;
=== Monkey's Audio Decoder ===&lt;br /&gt;
* Sources: [http://www.monkeysaudio.com/files/MAC_SDK_399.zip original sources], [http://sourceforge.net/projects/mac-port/ original sources port for non-win32 platforms], [http://jmac.sourceforge.net/ LGPLed Java implementation]&lt;br /&gt;
&lt;br /&gt;
=== QCELP Decoder ===&lt;br /&gt;
&lt;br /&gt;
* Specification: QCELP decoder [http://www.3gpp2.org/Public_html/specs/alltsgscfm.cfm spec] is c.s0020 and source is c.r0020&lt;br /&gt;
* Sample files: http://samples.mplayerhq.hu/A-codecs/qclp/&lt;br /&gt;
&lt;br /&gt;
''Mentor: Benjamin Larsson''&lt;br /&gt;
&lt;br /&gt;
=== E-AC3 Decoder ===&lt;br /&gt;
* Specification: [http://www.atsc.org/standards/a_52b.pdf http://www.atsc.org/standards/a_52b.pdf]&lt;br /&gt;
* Samples: [http://samples.mplayerhq.hu/evob/MAININTRO.EVO http://samples.mplayerhq.hu/evob/MAININTRO.EVO]&lt;br /&gt;
&lt;br /&gt;
=== GSM Decoder ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Dirac Decoder ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Dirac Encoder ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== i263 Decoder ===&lt;br /&gt;
* Specification: [[I263 | I263 Format Specification at MultimediaWiki]]&lt;br /&gt;
* Sources: [http://multimedia.cx/I263Src.zip  GPLed I263 decoder]&lt;br /&gt;
* Sample files: [http://samples.mplayerhq.hu/V-codecs/I263/ http://samples.mplayerhq.hu/V-codecs/I263/]&lt;br /&gt;
&lt;br /&gt;
=== VP6 Encoder ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NUT Muxer ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Matroska Muxer ===&lt;br /&gt;
&lt;br /&gt;
* Specification: http://www.matroska.org/technical/specs/index.html&lt;br /&gt;
* Sample files: http://samples.mplayerhq.hu/Matroska/&lt;br /&gt;
&lt;br /&gt;
''Mentor: Aurelien Jacobs; Backup mentors: Steve Lhomme, Ronald S. Bultje''&lt;br /&gt;
&lt;br /&gt;
=== MPEG TS/DVB Muxer ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== PAFF decoding for H.264/AVC ===&lt;br /&gt;
* Specification: [http://www.itu.int/rec/T-REC-H.264-200503-I/en ITU-T]&lt;br /&gt;
* Sample files: [http://samples.mplayerhq.hu/V-codecs/h264/PAFF http://samples.mplayerhq.hu/V-codecs/h264/PAFF]&lt;br /&gt;
&lt;br /&gt;
=== MXF Muxer ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Finish AAC decoder and land it in FFmpeg ===&lt;br /&gt;
* Code: http://svn.mplayerhq.hu/aac/&lt;br /&gt;
&lt;br /&gt;
=== RV30/RV40 decoders ===&lt;br /&gt;
''(contingent on near-term reverse engineering efforts)''&lt;br /&gt;
&lt;br /&gt;
== Small tasks ==&lt;br /&gt;
&lt;br /&gt;
=== TGA encoder ===&lt;br /&gt;
* Specification: http://www.dca.fee.unicamp.br/~martino/disciplinas/ea978/tgaffs.pdf&lt;br /&gt;
* Samples: http://www.openquicktime.org/files.php//aletrek/&lt;br /&gt;
&lt;br /&gt;
=== TIFF encoder ===&lt;br /&gt;
* Specification: http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf&lt;br /&gt;
* Samples: http://samples.mplayerhq.hu/mov/tiff/&lt;br /&gt;
&lt;br /&gt;
=== Bethsoft VID demuxer ===&lt;br /&gt;
&lt;br /&gt;
=== Vivo demuxer ===&lt;br /&gt;
* Specification: look at the mplayer vivo demuxer [http://svn.mplayerhq.hu/mplayer/trunk/libmpdemux/demux_viv.c?revision=22301&amp;amp;view=markup]&lt;br /&gt;
* Samples: http://samples.mplayerhq.hu/vivo/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== IFF/8SVX 8-bit audio demuxer ===&lt;br /&gt;
* Specification: http://netghost.narod.ru/gff/vendspec/iff/iff.txt, http://sox.sourceforge.net/AudioFormats-11.html, and [http://xine.cvs.sourceforge.net/xine/xine-lib/src/demuxers/demux_iff.c?view=markup xine demuxer]&lt;br /&gt;
* Samples: http://aminet.net/mods/smpl&lt;br /&gt;
&lt;br /&gt;
=== Optimize some code ===&lt;br /&gt;
Do you think some code in ffmpeg could run faster? We would love to get some faster decoders or encoders.&lt;br /&gt;
&lt;br /&gt;
This requires some ASM skills and using timer code to benchmark.&lt;br /&gt;
&lt;br /&gt;
Speedups needed in:&lt;br /&gt;
h264 decoder&lt;br /&gt;
&lt;br /&gt;
=== Review/fix some FFmpeg patches ===&lt;br /&gt;
insert FFmpeg patch list here.&lt;/div&gt;</summary>
		<author><name>Aurel</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=FFmpeg_codec_HOWTO&amp;diff=7062</id>
		<title>FFmpeg codec HOWTO</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=FFmpeg_codec_HOWTO&amp;diff=7062"/>
		<updated>2007-02-24T14:31:31Z</updated>

		<summary type="html">&lt;p&gt;Aurel: /* libavcodec/allcodecs.c */ upgrade to new structure of this file&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is meant as an introduction to the internal codec API in [[FFmpeg]].&lt;br /&gt;
It will also show how the codecs are connected with the demuxers. This is by&lt;br /&gt;
no means a complete guide but enough to understand how to add a codec to FFmpeg.&lt;br /&gt;
Cook is used as an example throughout.&lt;br /&gt;
&lt;br /&gt;
== libavcodec/avcodec.h ==&lt;br /&gt;
The first thing to look at is the AVCodec struct.&lt;br /&gt;
&lt;br /&gt;
 typedef struct AVCodec {&lt;br /&gt;
     const char *name;&lt;br /&gt;
     enum CodecType type;&lt;br /&gt;
     enum CodecID id;&lt;br /&gt;
     int priv_data_size;&lt;br /&gt;
     int (*init)(AVCodecContext *);&lt;br /&gt;
     int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);&lt;br /&gt;
     int (*close)(AVCodecContext *);&lt;br /&gt;
     int (*decode)(AVCodecContext *, void *outdata, int *outdata_size,&lt;br /&gt;
                   uint8_t *buf, int buf_size);&lt;br /&gt;
     int capabilities;&lt;br /&gt;
     struct AVCodec *next;&lt;br /&gt;
     void (*flush)(AVCodecContext *);&lt;br /&gt;
     const AVRational *supported_framerates; ///array of supported framerates, or NULL if any, array is terminated by {0,0}&lt;br /&gt;
     const enum PixelFormat *pix_fmts;       ///array of supported pixel formats, or NULL if unknown, array is terminanted by -1&lt;br /&gt;
 } AVCodec;&lt;br /&gt;
&lt;br /&gt;
Here we can see that we have some elements to name the codec, what type it is (audio/video), the supported pixel formats and some function&lt;br /&gt;
pointers for init/encode/decode and close. Now lets see how it is used.&lt;br /&gt;
&lt;br /&gt;
== libavcodec/cook.c ==&lt;br /&gt;
If we look in this file at the bottom we can see this code:&lt;br /&gt;
&lt;br /&gt;
 AVCodec cook_decoder =&lt;br /&gt;
 {&lt;br /&gt;
     .name = &amp;quot;cook&amp;quot;,&lt;br /&gt;
     .type = CODEC_TYPE_AUDIO,&lt;br /&gt;
     .id = CODEC_ID_COOK,&lt;br /&gt;
     .priv_data_size = sizeof(COOKContext),&lt;br /&gt;
     .init = cook_decode_init,&lt;br /&gt;
     .close = cook_decode_close,&lt;br /&gt;
     .decode = cook_decode_frame,&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
First we get an AVCodec struct named cook_decoder. And then we set the variables of cook_decoder. Note that we only set the variables that are needed. Currently there is no encoder so we don't set any. If we now look at the id variable we can see that CODEC_ID_COOK isn't defined in libavcodec/cook.c. It is declared in avcodec.h.&lt;br /&gt;
&lt;br /&gt;
== libavcodec/avcodec.h ==&lt;br /&gt;
&lt;br /&gt;
Here we will find the CodecID enumeration.&lt;br /&gt;
&lt;br /&gt;
 enum CodecID {&lt;br /&gt;
 ...&lt;br /&gt;
 CODEC_ID_GSM,&lt;br /&gt;
 CODEC_ID_QDM2,&lt;br /&gt;
 CODEC_ID_COOK,&lt;br /&gt;
 CODEC_ID_TRUESPEECH,&lt;br /&gt;
 CODEC_ID_TTA,&lt;br /&gt;
 ...&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
CODEC_ID_COOK is there in the list. This is the list of all supported codecs in FFmpeg, the list is fixed and used internally to id every codec. Changing the order would break binary compatibility.&lt;br /&gt;
&lt;br /&gt;
This is all enough to declare a codec. Now we must register them for internal use also. This is done at runtime.&lt;br /&gt;
&lt;br /&gt;
== libavcodec/allcodecs.c ==&lt;br /&gt;
In this file we have the avcodec_register_all() function, it has entries like this for all codecs.&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
    REGISTER_DECODER(COOK, cook);&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
This macro expands to a register_avcodec() call which registers a codec for internal use.&lt;br /&gt;
Note that register_avcodec() will only be called when CONFIG_COOK_DECODER is defined.&lt;br /&gt;
This allows to not compile the decoder code for a specific codec.&lt;br /&gt;
But where is it defined? This is extracted by configure with this command line:&lt;br /&gt;
&lt;br /&gt;
 sed -n 's/^[^#]*DEC.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c&lt;br /&gt;
&lt;br /&gt;
So adding a REGISTER_DECODER(NEW, new) entry in allcodecs.c and reconfigure is enough to add the needed define.&lt;br /&gt;
One more thing to note is that cook.c isn't included in allcodecs.c so the symbol cook_decoder can't be&lt;br /&gt;
found. Thus it has to be declared somewhere, that happens in avcodec.h and it is declared as an external symbol.&lt;br /&gt;
&lt;br /&gt;
Now we have everything to hookup a codec now we will see how the codec. For this we look into libavformat.&lt;br /&gt;
&lt;br /&gt;
== libavformat/rm.c ==&lt;br /&gt;
If we think of an imaginary rm file that ffmpeg is about to process, the first thing that happens is that it is identified&lt;br /&gt;
as a rm file. It is passed on to the rm demuxer (rm.c). The rm demuxer looks through the file and finds out that it is a&lt;br /&gt;
cook file.&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 } else if (!strcmp(buf, &amp;quot;cook&amp;quot;)) {&lt;br /&gt;
 st-&amp;gt;codec-&amp;gt;codec_id = CODEC_ID_COOK;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Now ffmpeg knows what codec to init and where to send the payload from the container. So back to cook.c and the initialization process.&lt;br /&gt;
&lt;br /&gt;
== libavcodec/cook.c Init ==&lt;br /&gt;
After ffmpeg knows what codec to use, it calls the declared initialization function pointer declared in the codecs AVCodec struct. In&lt;br /&gt;
cook.c it is called cook_decode_init. Here we setup as much as we can before we start decoding. The following things should be handled in the init, vlc table initialization, table generation, memory allocation and extradata parsing.&lt;br /&gt;
&lt;br /&gt;
== libavcodec/cook.c Close ==&lt;br /&gt;
The cook_decode_close function is the codec clean-up call. All memory, vlc tables, etc. should be freed here.&lt;br /&gt;
&lt;br /&gt;
== libavcodec/cook.c Decode ==&lt;br /&gt;
In cook.c the name of the decode call is cook_decode_frame.&lt;br /&gt;
&lt;br /&gt;
 static int cook_decode_frame(AVCodecContext *avctx,&lt;br /&gt;
             void *data, int *data_size,&lt;br /&gt;
             uint8_t *buf, int buf_size) {&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
The function has 5 arguments:&lt;br /&gt;
* avctx is a pointer to a AVCodecContext&lt;br /&gt;
* data is the pointer to the outbuffer&lt;br /&gt;
* data_size is a variable that should be set to the outbuffer size in bytes&lt;br /&gt;
* buf is the pointer to the inbuffer&lt;br /&gt;
* buf_size is the size of the inbuffer&lt;br /&gt;
&lt;br /&gt;
The decode function shall return the amount of bytes consumed from the inbuffer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's how it works without too much detail.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The Glue codec template ==&lt;br /&gt;
The imaginary Glue audio codec will serve as a base to exhibit bitstream reading, vlc decoding and other things.&lt;br /&gt;
The code is purely fictional and is sometimes written purely for the sake of example. No attempt is made to prevent invalid&lt;br /&gt;
data manipulation.&lt;br /&gt;
&lt;br /&gt;
The Glue codec follows.&lt;br /&gt;
&lt;br /&gt;
 /* First we include some default includes */&lt;br /&gt;
 #include &amp;lt;math.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stddef.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 /* The following includes have the bitstream reader, various dsp functions and the various defaults */&lt;br /&gt;
 #define ALT_BITSTREAM_READER&lt;br /&gt;
 #include &amp;quot;avcodec.h&amp;quot;&lt;br /&gt;
 #include &amp;quot;bitstream.h&amp;quot;&lt;br /&gt;
 #include &amp;quot;dsputil.h&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 /* This includes the tables needed for the Glue codec template */&lt;br /&gt;
 #include &amp;quot;gluedata.h&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 /* Here we declare the struct used for the codec private data */&lt;br /&gt;
 typedef struct {&lt;br /&gt;
     GetBitContext       gb;&lt;br /&gt;
     FFTContext          fft_ctx;&lt;br /&gt;
     VLC                 vlc_table;&lt;br /&gt;
     MDCTContext         mdct_ctx;&lt;br /&gt;
     float*              sample_buffer;&lt;br /&gt;
 } GLUEContext;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 /* The init function */&lt;br /&gt;
 static int glue_decode_init(AVCodecContext *avctx)&lt;br /&gt;
 {&lt;br /&gt;
     GLUEContext *q = avctx-&amp;gt;priv_data;&lt;br /&gt;
 &lt;br /&gt;
     /* This imaginary codec uses one fft, one mdct and one vlc table. */&lt;br /&gt;
     ff_mdct_init(&amp;amp;q-&amp;gt;mdct_ctx, 10, 1);    // 2^10 == size of mdct, 1 == inverse mdct&lt;br /&gt;
     ff_fft_init(&amp;amp;q-&amp;gt;fft_ctx, 9, 1);       // 2^9 == size of fft, 0 == inverse fft&lt;br /&gt;
     init_vlc (&amp;amp;q-&amp;gt;vlc_table, 9, 24,&lt;br /&gt;
            vlctable_huffbits, 1, 1,&lt;br /&gt;
            vlctable_huffcodes, 2, 2, 0);  // look in bitstream.h for the meaning of the arguments&lt;br /&gt;
 &lt;br /&gt;
     /* We also need to allocate a sample buffer */&lt;br /&gt;
     q-&amp;gt;sample_buffer = av_mallocz(sizeof(float)*1024);  // here we used av_mallocz instead of av_malloc&lt;br /&gt;
                                                         // av_mallocz memsets the whole buffer to 0&lt;br /&gt;
 &lt;br /&gt;
     /* Check if the allocation was successful */&lt;br /&gt;
     if(q-&amp;gt;sample_buffer == NULL)&lt;br /&gt;
         return -1;&lt;br /&gt;
 &lt;br /&gt;
     /* return 0 for a successful init, -1 for failure */&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 /* This is the main decode function */&lt;br /&gt;
 static int glue_decode_frame(AVCodecContext *avctx,&lt;br /&gt;
            void *data, int *data_size,&lt;br /&gt;
            uint8_t *buf, int buf_size)&lt;br /&gt;
 {&lt;br /&gt;
     GLUEContext *q = avctx-&amp;gt;priv_data;&lt;br /&gt;
     int16_t *outbuffer = data;&lt;br /&gt;
 &lt;br /&gt;
     /* We know what the arguments for this function are from above&lt;br /&gt;
        now we just have to decode this imaginary codec, the made up&lt;br /&gt;
        bitstream format is as follows:&lt;br /&gt;
        12 bits representing the amount of samples&lt;br /&gt;
        1 bit fft or mdct coded coeffs, 0 for fft/1 for mdct&lt;br /&gt;
          read 13 bits representing the amount of vlc coded fft data coeffs&lt;br /&gt;
          read 10 bits representing the amount of vlc coded mdct data coeffs&lt;br /&gt;
        (...bits representing the coeffs...)&lt;br /&gt;
        5 bits of dummy data that should be ignored&lt;br /&gt;
        32 bits the hex value 0x12345678, used for integrity check&lt;br /&gt;
     */&lt;br /&gt;
 &lt;br /&gt;
     /* Declare the needed variables */&lt;br /&gt;
     int samples, coeffs, i, fft;&lt;br /&gt;
     float mdct_tmp[1024];&lt;br /&gt;
 &lt;br /&gt;
     /* Now we init the bitstream reader, we start at the beginning of the inbuffer */&lt;br /&gt;
     init_get_bits(&amp;amp;q-&amp;gt;gb, buf, buf_size*8);  //the buf_size is in bytes but we need bits&lt;br /&gt;
 &lt;br /&gt;
     /* Now we take 12 bits to get the amount of samples the current frame has */&lt;br /&gt;
     samples = get_bits(&amp;amp;q-&amp;gt;gb, 12);&lt;br /&gt;
     &lt;br /&gt;
     /* Now we check if we have fft or mdct coeffs */&lt;br /&gt;
     fft = get_bits1(&amp;amp;q-&amp;gt;gb);&lt;br /&gt;
     if (fft) {&lt;br /&gt;
         //fft coeffs, get how many&lt;br /&gt;
         coeffs = get_bits(&amp;amp;q-&amp;gt;gb, 13);&lt;br /&gt;
     } else {&lt;br /&gt;
         //mdct coeffs, get how many&lt;br /&gt;
         coeffs = get_bits(&amp;amp;q-&amp;gt;gb, 10);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     /* Now decode the vlc coded coeffs to the sample_buffer */&lt;br /&gt;
     for (i=0 ; i&amp;lt;coeffs ; i++)&lt;br /&gt;
         q-&amp;gt;sample_buffer[i] = get_vlc2(&amp;amp;q-&amp;gt;gb, q-&amp;gt;vlc_table.table, vlc_table.bits, 3);  //read about the arguments in bitstream.h&lt;br /&gt;
 &lt;br /&gt;
     /* Now we need to transform the coeffs to samples */&lt;br /&gt;
     if (fft) {&lt;br /&gt;
         //The fft is done inplace&lt;br /&gt;
         ff_fft_permute(&amp;amp;q-&amp;gt;fft_ctx, (FFTComplex *) q-&amp;gt;sample_buffer);&lt;br /&gt;
         ff_fft_calc(&amp;amp;q-&amp;gt;fft_ctx, (FFTComplex *) q-&amp;gt;sample_buffer);&lt;br /&gt;
     } else {&lt;br /&gt;
         //And we pretend that the mdct is also inplace&lt;br /&gt;
         ff_imdct_calc(&amp;amp;q-&amp;gt;mdct_ctx, q-&amp;gt;sample_buffer, q-&amp;gt;sample_buffer, mdct_tmp);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     /* To make it easy the stream can only be 16 bits mono, so let's convert it to that */&lt;br /&gt;
     for (i=0 ; i&amp;lt;samples ; i++)&lt;br /&gt;
         outbuffer[i] = (int16_t)q-&amp;gt;sample_buffer[i];&lt;br /&gt;
 &lt;br /&gt;
     /* Report how many samples we got */&lt;br /&gt;
     *data_size = samples;&lt;br /&gt;
 &lt;br /&gt;
     /* Skip the dummy data bits */&lt;br /&gt;
     skip_bits(&amp;amp;q-&amp;gt;gb, 5);&lt;br /&gt;
 &lt;br /&gt;
     /* Check if the buffer was consumed ok */&lt;br /&gt;
     if (get_bits(&amp;amp;q-&amp;gt;gb,32) != 0x12345678) {&lt;br /&gt;
         av_log(avctx,AV_LOG_ERROR,&amp;quot;Stream error, integrity check failed!\n&amp;quot;);&lt;br /&gt;
         return -1;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     /* Return the amount of bytes consumed if everything was ok */&lt;br /&gt;
     return *data_size*sizeof(int16_t);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 /* the uninit function, here we just do the inverse of the init */ &lt;br /&gt;
 static int glue_decode_close(AVCodecContext *avctx)&lt;br /&gt;
 {&lt;br /&gt;
     GLUEContext *q = avctx-&amp;gt;priv_data;&lt;br /&gt;
 &lt;br /&gt;
     /* Free allocated memory buffer */&lt;br /&gt;
     av_free(q-&amp;gt;sample_buffer);&lt;br /&gt;
 &lt;br /&gt;
     /* Free the fft transform */&lt;br /&gt;
     ff_fft_end(&amp;amp;q-&amp;gt;fft_ctx);&lt;br /&gt;
 &lt;br /&gt;
     /* Free the mdct transform */&lt;br /&gt;
     ff_mdct_end(&amp;amp;q-&amp;gt;mdct_ctx);&lt;br /&gt;
 &lt;br /&gt;
     /* Free the vlc table */&lt;br /&gt;
     free_vlc(&amp;amp;q-&amp;gt;vlc_table);&lt;br /&gt;
 &lt;br /&gt;
     /* Return 0 if everything is ok, -1 if not */&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 AVCodec glue_decoder =&lt;br /&gt;
 {&lt;br /&gt;
     .name = &amp;quot;glue&amp;quot;,&lt;br /&gt;
     .type = CODEC_TYPE_AUDIO,&lt;br /&gt;
     .id = CODEC_ID_GLUE,&lt;br /&gt;
     .priv_data_size = sizeof(GLUEContext),&lt;br /&gt;
     .init = glue_decode_init,&lt;br /&gt;
     .close = glue_decode_close,&lt;br /&gt;
     .decode = glue_decode_frame,&lt;br /&gt;
 };&lt;/div&gt;</summary>
		<author><name>Aurel</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=AVS&amp;diff=6881</id>
		<title>AVS</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=AVS&amp;diff=6881"/>
		<updated>2007-01-29T23:29:29Z</updated>

		<summary type="html">&lt;p&gt;Aurel: fix samples link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is also new format from China called [[Chinese AVS]]&lt;br /&gt;
&lt;br /&gt;
''This page is based on the document 'Description of the AVS Format' by Mike Melanson and Vladimir &amp;quot;VAG&amp;quot; Gneushev found at [http://multimedia.cx/avs-format.txt http://multimedia.cx/avs-format.txt]''.&lt;br /&gt;
&lt;br /&gt;
* Samples: [http://samples.mplayerhq.hu/game-formats/avs/ http://samples.mplayerhq.hu/game-formats/avs/]&lt;br /&gt;
&lt;br /&gt;
AVS is a full motion video (FMV) file format that is used in the game [http://www.mobygames.com/game/creature-shock Creature Shock] developed by [[Argonaut Games]] and published by [[Virgin Interactive]] in 1994. The game is an FMV-based shooting game that relies on this file format for much of its graphics.&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
All multi-byte numbers are little-endian.&lt;br /&gt;
&lt;br /&gt;
An AVS file starts with a header and is followed by a series of frames. The file header has the following layout:&lt;br /&gt;
&lt;br /&gt;
 bytes 0-1    file signature - 0x77 0x57&lt;br /&gt;
 bytes 2-3    size of main header (should be 0x0010)&lt;br /&gt;
 bytes 4-5    frame width&lt;br /&gt;
 bytes 6-7    frame height&lt;br /&gt;
 bytes 8-9    color depth? (always 8)&lt;br /&gt;
 bytes 10-11  frames per second&lt;br /&gt;
 bytes 12-15  frame count&lt;br /&gt;
&lt;br /&gt;
After the file header is a series of frames. Each frame has the following layout:&lt;br /&gt;
&lt;br /&gt;
 bytes 0-1    data present; if this is zero then the file is finished;&lt;br /&gt;
              otherwise, there is data in the payload&lt;br /&gt;
 bytes 2-3    length of entire frame, including this 4-byte preamble&lt;br /&gt;
   block 1&lt;br /&gt;
     ..&lt;br /&gt;
     ..&lt;br /&gt;
   block n&lt;br /&gt;
&lt;br /&gt;
Each block has the following layout:&lt;br /&gt;
&lt;br /&gt;
 bytes 0-1    block type&lt;br /&gt;
 bytes 2-3    block length (including this 4-byte preamble)&lt;br /&gt;
 bytes 4..    block payload&lt;br /&gt;
&lt;br /&gt;
Keep processing blocks until the entire frame is depleted. These are the various block types:&lt;br /&gt;
&lt;br /&gt;
 0x0100: video intraframe (keyframe) with 3x3 vectors&lt;br /&gt;
 0x0101: video interframe with 3x3 vectors&lt;br /&gt;
 0x0102: video interframe with 2x2 vectors&lt;br /&gt;
 0x0103: video interframe with 2x3 vectors&lt;br /&gt;
 0x0200: audio frame&lt;br /&gt;
 0x0300: palette&lt;br /&gt;
 0x0400: game-related data; disregard&lt;br /&gt;
 0x0401: game-related data; disregard&lt;br /&gt;
&lt;br /&gt;
The next sections describe the video and audio formats in detail.&lt;br /&gt;
&lt;br /&gt;
== Palette Format ==&lt;br /&gt;
&lt;br /&gt;
Block type 0x0300 denotes a palette chunk. The decoder maintains a 256-element array of palette entries. Each palette entry consists of a red value, a green value, and a blue value. Each of these R, G, and B &lt;br /&gt;
components is a 6-bit VGA value with a range limited to 0..63. This is important to understand if the video will be decoded and rendered in more common formats that expect 8-bit components (0..255).&lt;br /&gt;
&lt;br /&gt;
Palette data has the following format:&lt;br /&gt;
&lt;br /&gt;
 bytes 0-1    index of first palette entry to replace&lt;br /&gt;
 bytes 2-3    number of palette entries to replace&lt;br /&gt;
 bytes 4..    RGB byte triplets&lt;br /&gt;
&lt;br /&gt;
For example, if the index of the first entry is 0x0001 and the number of palette entries to replace is 0x0077 then the decoder would iterate through palette indices 1..0x77 and read the RGB entries out of the &lt;br /&gt;
encoded palette.&lt;br /&gt;
&lt;br /&gt;
== Video Format ==&lt;br /&gt;
&lt;br /&gt;
AVS uses a very simplistic vector quantizer video coding scheme. Possible vector sizes include 2x2, 2x3, and 3x3 depending on block type.  The codec was designed to operate on the standard IBM VGA 320x200&lt;br /&gt;
256-color video mode. However, the videos always appear to be encoded at a resolution of 318x198. Each of the video modes specifies that only one vector size is used. This is the total number of vectors comprising a frame for each vector size:&lt;br /&gt;
&lt;br /&gt;
 vector size    vectors in a 318x198 frame&lt;br /&gt;
 -----------    --------------------------&lt;br /&gt;
     2x2                  15741&lt;br /&gt;
     2x3                  10494&lt;br /&gt;
     3x3                   6996&lt;br /&gt;
&lt;br /&gt;
An intraframe is always painted with 3x3 vectors. An encoded intraframe consists of a 256-entry vector codebook followed by a vector map instructing the decoder where to place the vectors in the final frame. &lt;br /&gt;
In fact, an intraframe will always have the same size: 9300 (0x2454) bytes. This is the intraframe layout:&lt;br /&gt;
&lt;br /&gt;
 bytes 0..2303     256 9-pixel vectors&lt;br /&gt;
 bytes 2304..9299  6996 codebook indices&lt;br /&gt;
&lt;br /&gt;
An interframe is painted with varying vector sizes depending on the block type:&lt;br /&gt;
&lt;br /&gt;
 type 0x0101    3x3 vectors&lt;br /&gt;
 type 0x0102    2x2 vectors&lt;br /&gt;
 type 0x0103    2x3 vectors&lt;br /&gt;
&lt;br /&gt;
An encoded interframe has the following layout:&lt;br /&gt;
&lt;br /&gt;
 vector codebook&lt;br /&gt;
 vector change bitmap&lt;br /&gt;
 codebook indices&lt;br /&gt;
&lt;br /&gt;
The vector codebook consists of 256 pixel vectors. The size of each vector (either 4, 6, or 9 bytes) depends on which size vector the current interframe type uses.  The size of the vector change bitmap is&lt;br /&gt;
defined as:&lt;br /&gt;
&lt;br /&gt;
 size_of_change_bitmap = ((319 / vector_width + 7) / 8) * &lt;br /&gt;
     (199 / vector_height)&lt;br /&gt;
&lt;br /&gt;
The interframe decoding algorithm is:&lt;br /&gt;
&lt;br /&gt;
 initialize pointers to the codebook, change bitmap, and indices&lt;br /&gt;
 read the next byte from the change bitmap&lt;br /&gt;
 for each vector position in image, left -&amp;gt; right, top -&amp;gt; bottom&lt;br /&gt;
   if bit 7 of change byte is 1 then&lt;br /&gt;
     read next codebook index from index portion of stream&lt;br /&gt;
     copy the vector at codebook[index] into the current vector position&lt;br /&gt;
   if bit 7 of change byte is 0 then&lt;br /&gt;
     vector is unchanged from previous frame&lt;br /&gt;
   shift the change byte left by 1&lt;br /&gt;
   if the change byte has been exhausted (shifted 8 times)&lt;br /&gt;
     read the next byte from the change bitmap&lt;br /&gt;
&lt;br /&gt;
== Audio Format ==&lt;br /&gt;
&lt;br /&gt;
The AVS audio format is actually taken from the [[Creative_Voice|Creative VOC format]]. A VOC chunk has the following layout:&lt;br /&gt;
&lt;br /&gt;
 byte  0    chunk type (should be 1)&lt;br /&gt;
 bytes 1-3  chunk length (including 4-byte payload but not next 2 bytes)&lt;br /&gt;
 byte  4    frequency divisor&lt;br /&gt;
 byte  5    data packing field (should be 0 which indicates unpacked)&lt;br /&gt;
 bytes 6..  audio data&lt;br /&gt;
&lt;br /&gt;
The caveat when processing audio blocks (type 0x0200) is that the block may or be a complete VOC chunk (with a header and complete data), or may be the beginning of a VOC chunk (with header and some data), or a continuation of a VOC chunk started in a previous frame along with the start of a new VOC chunk. For example, one audio block may contain an entire VOC chunk:&lt;br /&gt;
&lt;br /&gt;
 frame&lt;br /&gt;
  block 0x200, length = 8196&lt;br /&gt;
   voc-header, chunk_length = 8188&lt;br /&gt;
   samples -&amp;gt; 8188 samples&lt;br /&gt;
 frame&lt;br /&gt;
  block 0x200, length = 50&lt;br /&gt;
   voc-header, chunk_length = 90&lt;br /&gt;
   samples -&amp;gt; to the end of the subblock (50 - 6 VOC header bytes)&lt;br /&gt;
 ...&lt;br /&gt;
 frame&lt;br /&gt;
  block 0x200, length = 50&lt;br /&gt;
   samples -&amp;gt; the rest of the data as counted by previous chunk_length &lt;br /&gt;
     (90 - (50-6))&lt;br /&gt;
   voc-header&lt;br /&gt;
   samples&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
The frequency divisor, which should ideally remain constant through playback, is an unsigned byte that is fed directly into the classic Creative Sound Blaster to initialize the DAC for digital audio output. &lt;br /&gt;
The formula to calculate the playback sample rate is:&lt;br /&gt;
&lt;br /&gt;
 sample_rate = 1000000 / (256 - frequency_divisor)&lt;br /&gt;
&lt;br /&gt;
A common divisor is 0xA6/166 which yields a sample rate of 11111 Hz.&lt;br /&gt;
&lt;br /&gt;
The audio data is single-channel, unsigned, 8-bit, [[PCM]] audio data.&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;br /&gt;
[[Category:Video Codecs]]&lt;/div&gt;</summary>
		<author><name>Aurel</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=On2_VP5&amp;diff=5916</id>
		<title>On2 VP5</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=On2_VP5&amp;diff=5916"/>
		<updated>2006-09-03T15:06:39Z</updated>

		<summary type="html">&lt;p&gt;Aurel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* FourCC: VP50&lt;br /&gt;
* Company: [[On2]]&lt;br /&gt;
* Samples: http://samples.mplayerhq.hu/V-codecs/VP5/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
The aim here is to open this standard with a full description of the bitstream format and decoding process.  Contributors from On2 especially encouraged here, but it is anticipated that this section will be completed through reverse engineering.&lt;br /&gt;
&lt;br /&gt;
Please do not submit any copyrighted text or code here.&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
VP5 uses unidirectional (&amp;quot;P-frame&amp;quot;) and intra-frame (within the current frame) prediction. Entropy coding is performed using range coding and an 8x8 iDCT is used.  The format supports dynamic adjustment of encoded video resolution.&lt;br /&gt;
&lt;br /&gt;
=== Macroblock types ===&lt;br /&gt;
&lt;br /&gt;
Each video frame is composed of an array of 16x16 macroblocks, just like [[MPEG-2]], [[MPEG-4]] parts 2 and 10.  Each [[MB]] (macroblock) takes one of the following modes (&amp;quot;[[MV]]&amp;quot; means &amp;quot;motion vector&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;mb_intra&amp;quot;&amp;gt;INTRA (1)&amp;lt;/span&amp;gt;: Intra [[MB]]&lt;br /&gt;
* &amp;lt;span id=&amp;quot;mb_inter_novec_pf&amp;quot;&amp;gt;INTER_NOVEC_PF (0)&amp;lt;/span&amp;gt;: Inter [[MB]], null [[MV]], previous frame reference&lt;br /&gt;
* &amp;lt;span id=&amp;quot;mb_inter_delta_pf&amp;quot;&amp;gt;INTER_DELTA_PF (2)&amp;lt;/span&amp;gt;: Inter [[MB]], differential [[MV]], previous frame reference&lt;br /&gt;
* &amp;lt;span id=&amp;quot;mb_inter_4v&amp;quot;&amp;gt;INTER_4V (7)&amp;lt;/span&amp;gt;: Inter [[MB]], four [[MV]]s, previous frame reference&lt;br /&gt;
* &amp;lt;span id=&amp;quot;mb_inter_v1_pf&amp;quot;&amp;gt;INTER_V1_PF (3)&amp;lt;/span&amp;gt;: Inter [[MB]], [[MV]] 1, previous frame reference&lt;br /&gt;
* &amp;lt;span id=&amp;quot;mb_inter_v2_pf&amp;quot;&amp;gt;INTER_V2_PF (4)&amp;lt;/span&amp;gt;: Inter [[MB]], [[MV]] 2, previous frame reference&lt;br /&gt;
* &amp;lt;span id=&amp;quot;mb_inter_novec_gf&amp;quot;&amp;gt;INTER_NOVEC_GF (5)&amp;lt;/span&amp;gt;: Inter [[MB]], null [[MV]], golden frame reference&lt;br /&gt;
* &amp;lt;span id=&amp;quot;mb_inter_delta_gf&amp;quot;&amp;gt;INTER_DELTA_GF (6)&amp;lt;/span&amp;gt;: Inter [[MB]], differential [[MV]], golden frame reference&lt;br /&gt;
* &amp;lt;span id=&amp;quot;mb_inter_v1_gf&amp;quot;&amp;gt;INTER_V1_GF (8)&amp;lt;/span&amp;gt;: Inter [[MB]], [[MV]] 1, golden frame reference&lt;br /&gt;
* &amp;lt;span id=&amp;quot;mb_inter_v2_gf&amp;quot;&amp;gt;INTER_V2_GF (9)&amp;lt;/span&amp;gt;: Inter [[MB]], [[MV]] 2, golden frame reference&lt;br /&gt;
&lt;br /&gt;
=== Frame Header ===&lt;br /&gt;
&lt;br /&gt;
Range coding commences at the very begining of this frame header.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Syntax !! Number of bits !! Probability || Semantics&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span id=&amp;quot;frame_mode&amp;quot;&amp;gt;frame_mode&amp;lt;/span&amp;gt; || 1 || 128 || 0 signifies an intra frame&lt;br /&gt;
|-&lt;br /&gt;
| value0 || 1 || 128 || unused&lt;br /&gt;
|-&lt;br /&gt;
| qp || 6 || 128 || Quantization parameter valid range 0..63&lt;br /&gt;
|-&lt;br /&gt;
| if ([[#frame_mode|frame_mode]] == 0) { || || || 0 signifies intra frame&lt;br /&gt;
|-&lt;br /&gt;
| version_minor || 8 || 128 || should be 0&lt;br /&gt;
|-&lt;br /&gt;
| version_major || 5 || 128 || should be 5&lt;br /&gt;
|-&lt;br /&gt;
| value3 || 2 || 128 || unknown&lt;br /&gt;
|-&lt;br /&gt;
| interlace || 1 || 128 || true (1) means interlace will be used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span id=&amp;quot;dim_y&amp;quot;&amp;gt;dim_y&amp;lt;/span&amp;gt; || 8 || 128 || Macroblock height of video &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span id=&amp;quot;dim_x&amp;quot;&amp;gt;dim_x&amp;lt;/span&amp;gt; || 8 || 128 || Macroblock width of video &lt;br /&gt;
|-&lt;br /&gt;
| render_y || 8 || 128 || Displayed macroblock height of video &lt;br /&gt;
|-&lt;br /&gt;
| render_x || 8 || 128 || Displayed macroblock width of video&lt;br /&gt;
|-&lt;br /&gt;
| value4 || 2 || 128 || unknown&lt;br /&gt;
|-&lt;br /&gt;
| } || || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If dim_x or dim_y have values different from the previous intra frame, then the resolution of the encoded image has changed.&lt;br /&gt;
&lt;br /&gt;
=== Model for macroblock type parsing ===&lt;br /&gt;
&lt;br /&gt;
This section allows to calculate a model used to parse macroblock type. This model is stored in the mb_type_model[3][10][10] table. To calculate this model, an intermediate table (mb_types_stats[3][10][2]) is extracted from the input stream. The macroblock type model is useful only for non-key frames (ie. frames which can contain macroblock type other than intra). So this procedure is not used for intra frame, which instead reset the value of mb_types_stats to the content of [[#def_mb_types_stats|def_mb_types_stats]].&lt;br /&gt;
&lt;br /&gt;
So first here is how the input stream must be parsed:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Syntax !! Number of bits !! Probability || Semantics&lt;br /&gt;
|-&lt;br /&gt;
| for (ctx=0; ctx&amp;lt;3; ctx++) {&lt;br /&gt;
|-&lt;br /&gt;
| if (flag1) { || 1 || 174 ||&lt;br /&gt;
|-&lt;br /&gt;
| index || 4 || 128 ||&lt;br /&gt;
|-&lt;br /&gt;
| mb_types_stats[ctx] = [[#pre_def_mb_type_stats|pre_def_mb_type_stats]][index][ctx]&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| if (flag2) { || 1 || 254 ||&lt;br /&gt;
|-&lt;br /&gt;
| for (type=0; type&amp;lt;10; type++) {&lt;br /&gt;
|-&lt;br /&gt;
| for(i=0; i&amp;lt;2; i++) {&lt;br /&gt;
|-&lt;br /&gt;
| if (flag3) { || 1 || 205 ||&lt;br /&gt;
|-&lt;br /&gt;
| sign || 1 || 128 ||&lt;br /&gt;
|-&lt;br /&gt;
| if (flag4) { || 1 || 171 ||&lt;br /&gt;
|-&lt;br /&gt;
| if (flag5) { || 1 || 199 ||&lt;br /&gt;
|-&lt;br /&gt;
| delta || 7 || 128 || quater of delta...&lt;br /&gt;
|-&lt;br /&gt;
| } else if (flag6) { || 1 || 140 ||&lt;br /&gt;
|-&lt;br /&gt;
| delta = 12&lt;br /&gt;
|-&lt;br /&gt;
| } else if (flag7) { || 1 || 125 ||&lt;br /&gt;
|-&lt;br /&gt;
| delta = 16&lt;br /&gt;
|-&lt;br /&gt;
| } else if (flag8) { || 1 || 104 ||&lt;br /&gt;
|-&lt;br /&gt;
| delta = 20&lt;br /&gt;
|-&lt;br /&gt;
| } else {&lt;br /&gt;
|-&lt;br /&gt;
| delta = 24&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| } else {&lt;br /&gt;
|-&lt;br /&gt;
| if (flag9) { || 1 || 83 ||&lt;br /&gt;
|-&lt;br /&gt;
| delta = 4&lt;br /&gt;
|-&lt;br /&gt;
| } else {&lt;br /&gt;
|-&lt;br /&gt;
| delta = 8&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| if (sign) {&lt;br /&gt;
|-&lt;br /&gt;
| delta = -delta&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| mb_types_stats[ctx][type][i] += delta&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;span id=&amp;quot;mb_type_model&amp;quot;&amp;gt;mb_type_model&amp;lt;/span&amp;gt; is derived from mb_types_stats. The first index of mb_type_model is the number of predictors (0, 1 or 2). The second index is the type of the previous macroblock. A probablity is associated to each value of the third index as follow:&lt;br /&gt;
&lt;br /&gt;
* 0 : probability for [[MB]] type to be the same as previous [[MB]] type&lt;br /&gt;
* 1 : probability for [[MB]] type to be in {[[#mb_inter_novec_pf|INTER_NOVEC_PF]], [[#mb_inter_delta_pf|INTER_DELTA_PF]], [[#mb_inter_v1_pf|INTER_V1_PF]], [[#mb_inter_v2_pf|INTER_V2_PF]]}&lt;br /&gt;
* 2 : probability for [[MB]] type to be in {[[#mb_inter_novec_pf|INTER_NOVEC_PF]], [[#mb_inter_delta_pf|INTER_DELTA_PF]]} knowing it's in {[[#mb_inter_novec_pf|INTER_NOVEC_PF]], [[#mb_inter_delta_pf|INTER_DELTA_PF]], [[#mb_inter_v1_pf|INTER_V1_PF]], [[#mb_inter_v2_pf|INTER_V2_PF]]}&lt;br /&gt;
* 3 : probability for [[MB]] type to be in {[[#mb_intra|INTRA]], [[#mb_inter_4v|INTER_4V]]} knowing it's in {[[#mb_intra|INTRA]], [[#mb_inter_novec_gf|INTER_NOVEC_GF]], [[#mb_inter_delta_gf|INTER_DELTA_GF]], [[#mb_inter_4v|INTER_4V]], [[#mb_inter_v1_gf|INTER_V1_GF]], [[#mb_inter_v2_gf|INTER_V2_GF]]}&lt;br /&gt;
* 4 : probability for [[MB]] type to be in {[[#mb_inter_novec_pf|INTER_NOVEC_PF]]} knowing it's in {[[#mb_inter_novec_pf|INTER_NOVEC_PF]], [[#mb_inter_delta_pf|INTER_DELTA_PF]]}&lt;br /&gt;
* 5 : probability for [[MB]] type to be in {[[#mb_inter_v1_pf|INTER_V1_PF]]} knowing it's in {[[#mb_inter_v1_pf|INTER_V1_PF]], [[#mb_inter_v2_pf|INTER_V2_PF]]}&lt;br /&gt;
* 6 : probability for [[MB]] type to be in {[[#mb_intra|INTRA]]} knowing it's in {[[#mb_intra|INTRA]], [[#mb_inter_4v|INTER_4V]]}&lt;br /&gt;
* 7 : probability for [[MB]] type to be in {[[#mb_inter_novec_gf|INTER_NOVEC_GF]], [[#mb_inter_delta_gf|INTER_DELTA_GF]]} knowing it's in {[[#mb_inter_novec_gf|INTER_NOVEC_GF]], [[#mb_inter_delta_gf|INTER_DELTA_GF]], [[#mb_inter_v1_gf|INTER_V1_GF]], [[#mb_inter_v2_gf|INTER_V2_GF]]}&lt;br /&gt;
* 8 : probability for [[MB]] type to be in {[[#mb_inter_novec_gf|INTER_NOVEC_GF]]} knowing it's in {[[#mb_inter_novec_gf|INTER_NOVEC_GF]], [[#mb_inter_delta_gf|INTER_DELTA_GF]]}&lt;br /&gt;
* 9 : probability for [[MB]] type to be in {[[#mb_inter_v1_gf|INTER_V1_GF]]} knowing it's in {[[#mb_inter_v1_gf|INTER_V1_GF]], [[#mb_inter_v2_gf|INTER_V2_GF]]}&lt;br /&gt;
&lt;br /&gt;
mb_type_model[ctx][type][0] is calculated with the following formula:&lt;br /&gt;
  255 - (255 * mb_types_stats[ctx][type][0]) / (1 + mb_types_stats[ctx][type][0] + mb_types_stats[ctx][type][1])&lt;br /&gt;
&lt;br /&gt;
All the other probabilities are conditional probabilities noted P(A|B) and are calculated with:&lt;br /&gt;
  1 + 255 * P(A) / (1+P(B))&lt;br /&gt;
&lt;br /&gt;
For each macroblock type, it's probability is noted P(A) and calculated with:&lt;br /&gt;
  100 * mb_types_stats[ctx][type][1]&lt;br /&gt;
with one exception: when calculating mb_type_model[ctx][type][i], P(type) is 0.&lt;br /&gt;
&lt;br /&gt;
=== Models for macroblock type parsing ===&lt;br /&gt;
&lt;br /&gt;
This header contains various models used to parse motion vectors. It is only present in non-key frames. For key frames, all those modeles are filled with 0x80 instead, except vector_model_pdi[comp][0] which is filled with 0x55.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Syntax !! Number of bits !! Probability || Semantics&lt;br /&gt;
|-&lt;br /&gt;
| for (comp=0; comp&amp;lt;2; comp++) {&lt;br /&gt;
|-&lt;br /&gt;
| if (flag1) { || 1 || [[#vmc_pct|vmc_pct]][comp][0] ||&lt;br /&gt;
|-&lt;br /&gt;
| vector_model_dct[comp] || 7 || 128 ||&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| if (flag2) { || 1 || [[#vmc_pct|vmc_pct]][comp][1] ||&lt;br /&gt;
|-&lt;br /&gt;
| vector_model_sig[comp] || 7 || 128 ||&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| if (flag3) { || 1 || [[#vmc_pct|vmc_pct]][comp][2] ||&lt;br /&gt;
|-&lt;br /&gt;
| vector_model_pdi[comp][0] || 7 || 128 ||&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| if (flag4) { || 1 || [[#vmc_pct|vmc_pct]][comp][3] ||&lt;br /&gt;
|-&lt;br /&gt;
| vector_model_pdi[comp][1] || 7 || 128 ||&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| for (comp=0; comp&amp;lt;2; comp++) {&lt;br /&gt;
|-&lt;br /&gt;
| for (node=0; node&amp;lt;7; node++) {&lt;br /&gt;
|-&lt;br /&gt;
| if (flag5) { || 1 || [[#vmc_pct|vmc_pct]][comp][4+node] ||&lt;br /&gt;
|-&lt;br /&gt;
| vector_model_pdv[comp][node] || 7 || 128 ||&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All the value in thoses models must be multiplied by 2. Those models can't contain a 0 value, so every 0 must then be replaced by a 1.&lt;br /&gt;
&lt;br /&gt;
=== Models for DCT coefficient parsing ===&lt;br /&gt;
&lt;br /&gt;
This header contains various models used to parse DCT coefficient. Theses parsing are using a default_probability table which is initially filled with 0x80. The value read from the bitstream must be multiplied by 2. If the value is 0, it must be replaced by 1.&lt;br /&gt;
The last two models are derived from the first two.&lt;br /&gt;
&lt;br /&gt;
==== DC coefficient model ====&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Syntax !! Number of bits !! Probability || Semantics&lt;br /&gt;
|-&lt;br /&gt;
| for (pt=0; pt&amp;lt;2; pt++) {&lt;br /&gt;
|-&lt;br /&gt;
| for (node=0; node&amp;lt;11; node++) {&lt;br /&gt;
|-&lt;br /&gt;
| if (flag1) { || 1 || [[#dccv_pct|dccv_pct]][pt][node] ||&lt;br /&gt;
|-&lt;br /&gt;
| coeff_model_dccv[pt][node] = default_probability[node] || 7 || 128 ||&lt;br /&gt;
|-&lt;br /&gt;
| } else if ([[#frame_mode|frame_mode]] == 0) {&lt;br /&gt;
|-&lt;br /&gt;
| coeff_model_dccv[pt][node] = default_probability[node]&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== AC coefficient model ====&lt;br /&gt;
&lt;br /&gt;
The value read from the bitstream must be multiplied by 2. If the value is 0, it must be replaced by 1.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Syntax !! Number of bits !! Probability || Semantics&lt;br /&gt;
|-&lt;br /&gt;
| for (ct=0; ct&amp;lt;3; ct++) {&lt;br /&gt;
|-&lt;br /&gt;
| for (pt=0; pt&amp;lt;2; pt++) {&lt;br /&gt;
|-&lt;br /&gt;
| for (cg=0; cg&amp;lt;6; cg++) {&lt;br /&gt;
|-&lt;br /&gt;
| for (node=0; node&amp;lt;11; node++) {&lt;br /&gt;
|-&lt;br /&gt;
| if (flag1) { || 1 || [[#ract_pct|ract_pct]][ct][pt][cg][node] ||&lt;br /&gt;
|-&lt;br /&gt;
| coeff_model_ract[pt][ct][cg][node] = default_probability[node] || 7 || 128 ||&lt;br /&gt;
|-&lt;br /&gt;
| } else if ([[#frame_mode|frame_mode]] == 0) {&lt;br /&gt;
|-&lt;br /&gt;
| coeff_model_ract[pt][ct][cg][node] = default_probability[node]&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== DC coefficient coding type model ====&lt;br /&gt;
&lt;br /&gt;
Every value in this model is calculated with the folowing formula:&lt;br /&gt;
&lt;br /&gt;
  coeff_model_dcct[pt][ctx][node] = ceil((coeff_model_dccv[pt][node] * [[#dccv_lc|dccv_lc]][node][ctx][0]) / 256)&lt;br /&gt;
                                    + [[#dccv_lc|dccv_lc]][node][ctx][1];&lt;br /&gt;
&lt;br /&gt;
All the values in this model must be clipped between 1 and 254.&lt;br /&gt;
&lt;br /&gt;
==== AC coefficient coding type  model ====&lt;br /&gt;
&lt;br /&gt;
Every value in this model is calculated with the folowing formula:&lt;br /&gt;
&lt;br /&gt;
  coeff_model_act[pt][ct][cg][ctx][node] = ceil((coeff_model_ract[pt][ct][cg][node] * [[#ract_lc|ract_lc]][ct][cg][node][ctx][0]) / 256)&lt;br /&gt;
                                           + [[#ract_lc|ract_lc]][ct][cg][node][ctx][1];&lt;br /&gt;
&lt;br /&gt;
All the values in this model must be clipped between 1 and 254.&lt;br /&gt;
&lt;br /&gt;
=== Macroblocks ===&lt;br /&gt;
&lt;br /&gt;
Here starts the main macroblocks parsing loop. Macroblocks are coded from left to right and from top to bottom of the final picture.&lt;br /&gt;
&lt;br /&gt;
==== MB type ====&lt;br /&gt;
&lt;br /&gt;
For non-key frames, [[MB]] parsing begin with the decoding of the type of the [[MB]].&lt;br /&gt;
&lt;br /&gt;
First we need to get the ctx value from [[#vector_predictor|vector_predictor]] with frame_type set to FRAME_PREVIOUS. Then we select the proper model which is [[#mb_type_model|mb_type_model]][ctx][prev_type] (prev_type is the type of the [[MB]] which was parsed just before this one).&lt;br /&gt;
The [[MB]] type parsing itself is done according to the selected mb_type_model which defines a binary tree of probabilities. This tree is described right below. In this tree, each [x] means get 1 bit in the input stream using mb_type_model[x] as probability for this bit. If bit is 0, go to the top branch, if it's 1, go to the bottom branch. The leaf indicate the final type of this MB.&lt;br /&gt;
&lt;br /&gt;
                                        +-- [[#mb_inter_novec_pf|INTER_NOVEC_PF]]&lt;br /&gt;
                                        |&lt;br /&gt;
                              +-- [4] --+&lt;br /&gt;
                              |         |&lt;br /&gt;
                              |         +-- [[#mb_inter_delta_pf|INTER_DELTA_PF]]&lt;br /&gt;
                              |&lt;br /&gt;
                    +-- [2] --+&lt;br /&gt;
                    |         |&lt;br /&gt;
                    |         |         +-- [[#mb_inter_v1_pf|INTER_V1_PF]]&lt;br /&gt;
                    |         |         |&lt;br /&gt;
                    |         +-- [5] --+&lt;br /&gt;
                    |                   |&lt;br /&gt;
                    |                   +-- [[#mb_inter_v2_pf|INTER_V2_PF]]&lt;br /&gt;
                    |&lt;br /&gt;
          +-- [1] --+&lt;br /&gt;
          |         |&lt;br /&gt;
          |         |                   +-- [[#mb_intra|INTRA]]&lt;br /&gt;
          |         |                   |&lt;br /&gt;
          |         |         +-- [6] --+&lt;br /&gt;
          |         |         |         |&lt;br /&gt;
          |         |         |         +-- [[#mb_inter_4v|INTER_4V]]&lt;br /&gt;
          |         |         |&lt;br /&gt;
          |         +-- [3] --+&lt;br /&gt;
          |                   |&lt;br /&gt;
          |                   |                   +-- [[#mb_inter_novec_gf|INTER_NOVEC_GF]]&lt;br /&gt;
          |                   |                   |&lt;br /&gt;
          |                   |         +-- [8] --+&lt;br /&gt;
          |                   |         |         |&lt;br /&gt;
          |                   |         |         +-- [[#mb_inter_delta_gf|INTER_DELTA_GF]]&lt;br /&gt;
          |                   |         |&lt;br /&gt;
          |                   +-- [7] --+&lt;br /&gt;
          |                             |&lt;br /&gt;
          |                             |         +-- [[#mb_inter_v1_gf|INTER_V1_GF]]&lt;br /&gt;
          |                             |         |&lt;br /&gt;
          |                             +-- [9] --+&lt;br /&gt;
          |                                       |&lt;br /&gt;
          |                                       +-- [[#mb_inter_v2_gf|INTER_V2_GF]]&lt;br /&gt;
          |&lt;br /&gt;
 -- [0] --+&lt;br /&gt;
          |&lt;br /&gt;
          +-- prev_type&lt;br /&gt;
&lt;br /&gt;
==== Motion vector ====&lt;br /&gt;
&lt;br /&gt;
The motion vector applies to all the blocks in the [[MB]] except in the case of [[#Four motion vectors|four motion vectors]]&lt;br /&gt;
There are different kind of [[MV]] decoding depending on [[MB]] type :&lt;br /&gt;
&lt;br /&gt;
===== Straight vector candidate =====&lt;br /&gt;
Apply to the following [[MB]] types: [[#mb_inter_v1_pf|INTER_V1_PF]], [[#mb_inter_v2_pf|INTER_V2_PF]], [[#mb_inter_v1_gf|INTER_V1_GF]], [[#mb_inter_v2_gf|INTER_V2_GF]]&lt;br /&gt;
&lt;br /&gt;
The motion vector is the first (for V1) or second (for V2) candidate from [[#vector_predictor|vector_predictor]] with frame_type set either to FRAME_PREVIOUS (for PF) or to FRAME_GOLDEN (for GF).&lt;br /&gt;
&lt;br /&gt;
===== Delta vector =====&lt;br /&gt;
Apply to the following [[MB]] types: [[#mb_inter_delta_pf|INTER_DELTA_PF]], [[#mb_inter_delta_gf|INTER_DELTA_GF]]&lt;br /&gt;
&lt;br /&gt;
Default delta, di1, di2 and neg value is 0.&lt;br /&gt;
You then need to apply the following parsing first with comp = 0 (for component x of the vector) and then with comp = 1 (for component y of the vector):&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Syntax !! Number of bits !! Probability || Semantics&lt;br /&gt;
|-&lt;br /&gt;
| if (flag1) { || 1 || vector_model_dct[comp] ||&lt;br /&gt;
|-&lt;br /&gt;
| neg || 1 || vector_model_sig[comp] ||&lt;br /&gt;
|-&lt;br /&gt;
| di1 || 1 || vector_model_pdi[comp][0] ||&lt;br /&gt;
|-&lt;br /&gt;
| di2 || 1 || vector_model_pdi[comp][1] ||&lt;br /&gt;
|-&lt;br /&gt;
| delta || || || here a binary tree parsing happens (see below)&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The delta parsing itself is done according to vector_model_pdv[comp] which defines a binary tree of probabilities. This tree is described right below. In this tree, each [x] means get 1 bit in the input stream using vector_model_pdv[comp][x] as probability for this bit. If bit is 0, go to the top branch, if it's 1, go to the bottom branch. The leaf indicate the final value of delta.&lt;br /&gt;
&lt;br /&gt;
                              +-- 0&lt;br /&gt;
                    +-- [2] --+&lt;br /&gt;
                    |         +-- 1&lt;br /&gt;
          +-- [1] --+&lt;br /&gt;
          |         |         +-- 2&lt;br /&gt;
          |         +-- [3] --+&lt;br /&gt;
          |                   +-- 3&lt;br /&gt;
 -- [0] --+&lt;br /&gt;
          |                   +-- 4&lt;br /&gt;
          |         +-- [5] --+&lt;br /&gt;
          |         |         +-- 5&lt;br /&gt;
          +-- [4] --+&lt;br /&gt;
                    |         +-- 6&lt;br /&gt;
                    +-- [6] --+&lt;br /&gt;
                              +-- 7&lt;br /&gt;
&lt;br /&gt;
When the value of delta, di1, di2 and neg are parsed, the value of the current vector component can be calculated this way:&lt;br /&gt;
  component = (1-2*neg) * (di1 | (di2 &amp;lt;&amp;lt; 1) | (delta &amp;lt;&amp;lt; 2))&lt;br /&gt;
&lt;br /&gt;
===== Four motion vectors =====&lt;br /&gt;
Apply to the following [[MB]] types: [[#mb_inter_4v|INTER_4V]]&lt;br /&gt;
&lt;br /&gt;
For this type of [[MB]] each of the 4 luma block of the [[MB]] use a different [[MV]]. So each of this 4 luma block has it's own block type. This block type can only be one which refers to PREVIOUS_FRAME (ie. [[#mb_inter_v1_pf|INTER_V1_PF]], [[#mb_inter_v2_pf|INTER_V2_PF]], [[#mb_inter_delta_pf|INTER_DELTA_PF]], [[#mb_inter_novec_pf|INTER_NOVEC_PF]]).&lt;br /&gt;
&lt;br /&gt;
Those 4 block types should be parsed this way:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Syntax !! Number of bits !! Probability || Semantics&lt;br /&gt;
|-&lt;br /&gt;
| for (block=0; block&amp;lt;4; block++) {&lt;br /&gt;
|-&lt;br /&gt;
| type[block] || 2 || 128 ||&lt;br /&gt;
|-&lt;br /&gt;
| if (type[block] != INTER_NOVEC_PF) {&lt;br /&gt;
|-&lt;br /&gt;
| type[block]++&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then for each of the 4 luma blocks it's [[MV]] is calculated the same way as if it were a full [[MB]], according to it's block type.&lt;br /&gt;
&lt;br /&gt;
The [[MV]] of the 2 chroma block is then calculated as the average of the 4 luma [[MV]].&lt;br /&gt;
&lt;br /&gt;
===== Zero vector =====&lt;br /&gt;
Apply to all the other [[MB]] types.&lt;br /&gt;
&lt;br /&gt;
This is simply a null vector.&lt;br /&gt;
&lt;br /&gt;
==== MB coefficients ====&lt;br /&gt;
&lt;br /&gt;
This is the real content of the [[MB]], ie. the data which will be feeded to the [[#Inverse DCT|Inverse DCT]].&lt;br /&gt;
&lt;br /&gt;
This procedure is repeated 6 times (for each block in the [[MB]], with block_num being the num of the block in the [[MB]] between 0 and 5). It uses several initialized variables :&lt;br /&gt;
* ct: code type, initialized to 1&lt;br /&gt;
* pt: plane type, initialized to 0 for luma blocks and 1 for chroma blocks&lt;br /&gt;
* ctx_last: initialized to the maximum coeff_idx of previous block on the same row and normalized to a maximal value of 24 (initialized to 24 at the start of a row).&lt;br /&gt;
* above_block_ndc: initialized to 0 if the DC coefficient of the block just above the current one is null, 1 else&lt;br /&gt;
* bi: initialized to 0 for blocks 0 and 1, 1 for blocks 2 and 3, 2 for block 4, and 3 for block 5&lt;br /&gt;
* coeff_ctx: this array is filled with 0 at the begining of each macroblock row&lt;br /&gt;
&lt;br /&gt;
  for (coeff_idx=0; coeff_idx&amp;lt;64; coeff_idx++) {&lt;br /&gt;
      /* select the correct models */&lt;br /&gt;
      if (coeff_idx == 0) {  /* DC coeff */&lt;br /&gt;
          ctx = 6*coeff_ctx[bi][0] + above_block_ndc;&lt;br /&gt;
          m1 = coeff_model_dccv[pt];&lt;br /&gt;
          m2 = coeff_model_dcct[pt][ctx];&lt;br /&gt;
      } else {               /* AC coeff */&lt;br /&gt;
          int cg = coeff_groups[coeff_idx];&lt;br /&gt;
          ctx = coeff_ctx[bi][coeff_idx];&lt;br /&gt;
          m1 = coeff_model_ract[pt][ct][cg];&lt;br /&gt;
          m2 = cg &amp;gt; 2 ? model : coeff_model_act[pt][ct][cg][ctx];&lt;br /&gt;
      }&lt;br /&gt;
      &lt;br /&gt;
      /*&lt;br /&gt;
       * Here applies a binary tree parssing as defined below.&lt;br /&gt;
       */&lt;br /&gt;
      &lt;br /&gt;
      block_coeff[block_num][coeff_idx] = (coeff ^ -sign) + sign;&lt;br /&gt;
      coeff_ctx[bi][coeff_idx] = cctx;&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  if (coeff_idx &amp;lt; ctx_last) {&lt;br /&gt;
      for (i=coeff_idx; i&amp;lt;=ctx_last; i++)&lt;br /&gt;
          coeff_ctx[bi][i] = 5;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The following binary tree parsing allows to extract coefficients of the block plus other parameters useful for the decoding procedure itself. In this tree, each m1[x] or m2[x] means get 1 bit in the input stream using m1[x] or m2[x] as probability for this bit. If bit is 0, go to the top branch, if it's 1, go to the bottom branch. The leaf indicate the value extracted at the end of this tree parsing.&lt;br /&gt;
&lt;br /&gt;
                    +-- end of this block (break out of the loop)&lt;br /&gt;
                    |&lt;br /&gt;
          +- m2[1] -+&lt;br /&gt;
          |         |&lt;br /&gt;
          | if !ct  |&lt;br /&gt;
          +---------+-- ct=0, cctx=0&lt;br /&gt;
          |&lt;br /&gt;
 - m2[0] -+&lt;br /&gt;
          |&lt;br /&gt;
          |         +-- ct=1, cctx=1, sign=get_bit(), coeff=1&lt;br /&gt;
          |         |&lt;br /&gt;
          +- m2[2] -+&lt;br /&gt;
                    |                   +-- ct=2, cctx=2, sign=get_bit(), coeff=2&lt;br /&gt;
                    |                   |&lt;br /&gt;
                    |         +- m2[4] -+&lt;br /&gt;
                    |         |         |         +-- ct=2, cctx=3, sign=get_bit(), coeff=3&lt;br /&gt;
                    |         |         |         |&lt;br /&gt;
                    |         |         +- m2[5] -+&lt;br /&gt;
                    |         |                   |&lt;br /&gt;
                    |         |                   +-- ct=2, cctx=3, sign=get_bit(), coeff=4&lt;br /&gt;
                    +- m2[3] -+&lt;br /&gt;
                              |&lt;br /&gt;
                              |&lt;br /&gt;
                              |                   +-- ct=2, cctx=4, sign=get_bit(), coeff=[[#coeff_parse|coeff_parse]](0)&lt;br /&gt;
                              |                   |&lt;br /&gt;
                              |         +- m1[7] -+&lt;br /&gt;
                              |         |         |&lt;br /&gt;
                              |         |         +-- ct=2, cctx=4, sign=get_bit(), coeff=[[#coeff_parse|coeff_parse]](1)&lt;br /&gt;
                              |         |&lt;br /&gt;
                              +- m1[6] -+&lt;br /&gt;
                                        |&lt;br /&gt;
                                        |                   +-- ct=2, cctx=4, sign=get_bit(), coeff=[[#coeff_parse|coeff_parse]](2)&lt;br /&gt;
                                        |                   |&lt;br /&gt;
                                        |         +- m1[9] -+&lt;br /&gt;
                                        |         |         |&lt;br /&gt;
                                        |         |         +-- ct=2, cctx=4, sign=get_bit(), coeff=[[#coeff_parse|coeff_parse]](3)&lt;br /&gt;
                                        |         |&lt;br /&gt;
                                        +- m1[8] -+&lt;br /&gt;
                                                  |&lt;br /&gt;
                                                  |         +-- ct=2, cctx=4, sign=get_bit(), coeff=[[#coeff_parse|coeff_parse]](4)&lt;br /&gt;
                                                  |         |&lt;br /&gt;
                                                  +- m1[10] +&lt;br /&gt;
                                                            |&lt;br /&gt;
                                                            +-- ct=2, cctx=4, sign=get_bit(), coeff=[[#coeff_parse|coeff_parse]](5)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span id=&amp;quot;coeff_parse&amp;quot;&amp;gt;coeff_parse&amp;lt;/span&amp;gt; algorithm used by the previous binary tree parsing takes one parameter called idx and behave like this :&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Syntax !! Number of bits !! Probability || Semantics&lt;br /&gt;
|-&lt;br /&gt;
| coeff = [[#coeff_bias|coeff_bias]][idx]&lt;br /&gt;
|-&lt;br /&gt;
| for (i=[[#coeff_bit_length|coeff_bit_length]][idx]; i&amp;gt;=0; i--) {&lt;br /&gt;
|-&lt;br /&gt;
| v || 1 || [[#coeff_parse_table|coeff_parse_table]][idx][i] ||&lt;br /&gt;
|-&lt;br /&gt;
| coeff += v &amp;lt;&amp;lt; i&lt;br /&gt;
|-&lt;br /&gt;
| }&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Algorithms ==&lt;br /&gt;
&lt;br /&gt;
=== Entropy Coding ===&lt;br /&gt;
&lt;br /&gt;
Described here is the decoding process for the arithmetically-coded (AC) parts of the bitstream.  VP5 uses a 16-bit [http://en.wikipedia.org/wiki/Range_encoding range coding] scheme to code binary symbols.&lt;br /&gt;
&lt;br /&gt;
The AC decoder maintains three state variables:  ''code'', ''mask'' and ''high''.  &lt;br /&gt;
&lt;br /&gt;
==== Initialization ====&lt;br /&gt;
&lt;br /&gt;
At initialization, the first two bytes of the AC bitstream are shifted into ''code''.  The variable ''high'' is set to 0xff00.  The variable ''mask'' is set to 0xffff.&lt;br /&gt;
&lt;br /&gt;
==== Decoding a Binary Value ====&lt;br /&gt;
&lt;br /&gt;
Each binary symbol has an associated probability ''p'' in the range 0 to 0xff.  &lt;br /&gt;
&lt;br /&gt;
A threshold, ''t'', is computed thus:&lt;br /&gt;
&lt;br /&gt;
: ''t'' = 0x100 + ( 0xff00 &amp;amp; ( ( (''high''-0x100) * ''p'' ) &amp;gt;&amp;gt; 8 ) )&lt;br /&gt;
&lt;br /&gt;
Equiprobable binary symbols are treated somewhat differently:&lt;br /&gt;
&lt;br /&gt;
: ''t'' = 0xff00 &amp;amp; ( (''high''+0x100) &amp;gt;&amp;gt; 1 )&lt;br /&gt;
&lt;br /&gt;
The binary value may then be decoded by comparing ''code'' and ''t''.  If ''code'' is less than ''t'', the binary value is decoded as 0.  If ''code'' is equal to or greater than ''t'', the binary value is decoded as 1.&lt;br /&gt;
&lt;br /&gt;
If a 1 was decoded, then&lt;br /&gt;
&lt;br /&gt;
: ''high'' = ''high'' - ''t''&lt;br /&gt;
: ''code'' = ''code'' - ''t''&lt;br /&gt;
&lt;br /&gt;
If a 0 was decoded, then&lt;br /&gt;
&lt;br /&gt;
: ''high'' = ''t''&lt;br /&gt;
&lt;br /&gt;
The following renormalization is now repeated while (''high'' &amp;amp; 0x8000) is non-zero.&lt;br /&gt;
&lt;br /&gt;
: ''high'' = 2 * ''high''&lt;br /&gt;
: ''code'' = 2 * ''code''&lt;br /&gt;
: ''mask'' = 2 * ''mask''&lt;br /&gt;
: if ((''mask'' &amp;amp; 0xff) == 0x00) {&lt;br /&gt;
:: ''code'' = ''code'' | &amp;lt;i&amp;gt;next byte from bitstream&amp;lt;/i&amp;gt;&lt;br /&gt;
:: ''mask'' = ''mask'' | 0xff&lt;br /&gt;
:}&lt;br /&gt;
&lt;br /&gt;
==== Decoding an Equiprobable n-bit Integer Value ====&lt;br /&gt;
&lt;br /&gt;
Integer values are coded as a big-endian sequence of equiprobable binary values.  To decode an n-bit equiprobable integer value, n equiprobable binary values should be decoded using the sequence above and left-shifted into an integral result variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Inverse DCT ===&lt;br /&gt;
&lt;br /&gt;
Inverse DCT is performed on 8x8 blocks of pixels. The algorithm used is the same than the one used for the [[On2 VP3|VP3]] decoder in [[FFmpeg]] [http://svn.mplayerhq.hu/ffmpeg/trunk/libavcodec/vp3dsp.c?view=markup], the original vp3 iDCT code is here [http://svn.xiph.org/trunk/vp32/CoreLibs/CDXV/Vp31/dx/generic/IDctPart.c].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== vector_predictor ===&lt;br /&gt;
&lt;br /&gt;
This algorithm allows to get the valid candidate [[MV]] for current [[MB]] regarding frame_type (which is a parameter of this algorithm).&lt;br /&gt;
&lt;br /&gt;
It checks all the candidate macroblocks for motion compensation. Store in nb_predictor the number of candidate [[MB]] whose last type was refering to frame_type and whose last [[MV]] was not null (no need to check for more than 2 valid candidate). The first 2 valid candidate [[MV]] are stored in the vector_candidate table.&lt;br /&gt;
&lt;br /&gt;
ctx is then derived from nb_predictor with the following formula:&lt;br /&gt;
&lt;br /&gt;
  ctx = (nb_predictor + 1) % 3&lt;br /&gt;
&lt;br /&gt;
The candidate [MB]] are defined as (x,y) positions relative to current [[MB]]. All those possible relative position are defined in [[#candidate_predictor_pos|candidate_predictor_pos]].&lt;br /&gt;
&lt;br /&gt;
The last [[MB]] type and [[MV]] are stored in an array of size [[#dim_x|dim_x]] by [[#dim_y|dim_y]]. This array is updated as soon a we parse a new [[MB]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data tables ==&lt;br /&gt;
&lt;br /&gt;
=== def_mb_types_stats ===&lt;br /&gt;
  { { {  69, 42 }, {   1,  2 }, {  1,   7 }, {  44, 42 }, {  6, 22 },&lt;br /&gt;
      {   1,  3 }, {   0,  2 }, {  1,   5 }, {   0,  1 }, {  0,  0 }, },&lt;br /&gt;
    { { 229,  8 }, {   1,  1 }, {  0,   8 }, {   0,  0 }, {  0,  0 },&lt;br /&gt;
      {   1,  2 }, {   0,  1 }, {  0,   0 }, {   1,  1 }, {  0,  0 }, },&lt;br /&gt;
    { { 122, 35 }, {   1,  1 }, {  1,   6 }, {  46, 34 }, {  0,  0 },&lt;br /&gt;
      {   1,  2 }, {   0,  1 }, {  0,   1 }, {   1,  1 }, {  0,  0 }, }, }&lt;br /&gt;
&lt;br /&gt;
=== pre_def_mb_type_stats ===&lt;br /&gt;
  { { { {   9, 15 }, {  32, 25 }, {  7,  19 }, {   9, 21 }, {  1, 12 },&lt;br /&gt;
        {  14, 12 }, {   3, 18 }, { 14,  23 }, {   3, 10 }, {  0,  4 }, },&lt;br /&gt;
      { {  41, 22 }, {   1,  0 }, {  1,  31 }, {   0,  0 }, {  0,  0 },&lt;br /&gt;
        {   0,  1 }, {   1,  7 }, {  0,   1 }, {  98, 25 }, {  4, 10 }, },&lt;br /&gt;
      { {   2,  3 }, {   2,  3 }, {  0,   2 }, {   0,  2 }, {  0,  0 },&lt;br /&gt;
        {  11,  4 }, {   1,  4 }, {  0,   2 }, {   3,  2 }, {  0,  4 }, }, },&lt;br /&gt;
    { { {  48, 39 }, {   1,  2 }, { 11,  27 }, {  29, 44 }, {  7, 27 },&lt;br /&gt;
        {   1,  4 }, {   0,  3 }, {  1,   6 }, {   1,  2 }, {  0,  0 }, },&lt;br /&gt;
      { { 123, 37 }, {   6,  4 }, {  1,  27 }, {   0,  0 }, {  0,  0 },&lt;br /&gt;
        {   5,  8 }, {   1,  7 }, {  0,   1 }, {  12, 10 }, {  0,  2 }, },&lt;br /&gt;
      { {  49, 46 }, {   3,  4 }, {  7,  31 }, {  42, 41 }, {  0,  0 },&lt;br /&gt;
        {   2,  6 }, {   1,  7 }, {  1,   4 }, {   2,  4 }, {  0,  1 }, }, },&lt;br /&gt;
    { { {  21, 32 }, {   1,  2 }, {  4,  10 }, {  32, 43 }, {  6, 23 },&lt;br /&gt;
        {   2,  3 }, {   1, 19 }, {  1,   6 }, {  12, 21 }, {  0,  7 }, },&lt;br /&gt;
      { {  26, 14 }, {  14, 12 }, {  0,  24 }, {   0,  0 }, {  0,  0 },&lt;br /&gt;
        {  55, 17 }, {   1,  9 }, {  0,  36 }, {   5,  7 }, {  1,  3 }, },&lt;br /&gt;
      { {  26, 25 }, {   1,  1 }, {  2,  10 }, {  67, 39 }, {  0,  0 },&lt;br /&gt;
        {   1,  1 }, {   0, 14 }, {  0,   2 }, {  31, 26 }, {  1,  6 }, }, },&lt;br /&gt;
    { { {  69, 83 }, {   0,  0 }, {  0,   2 }, {  10, 29 }, {  3, 12 },&lt;br /&gt;
        {   0,  1 }, {   0,  3 }, {  0,   3 }, {   2,  2 }, {  0,  0 }, },&lt;br /&gt;
      { { 209,  5 }, {   0,  0 }, {  0,  27 }, {   0,  0 }, {  0,  0 },&lt;br /&gt;
        {   0,  1 }, {   0,  1 }, {  0,   1 }, {   0,  0 }, {  0,  0 }, },&lt;br /&gt;
      { { 103, 46 }, {   1,  2 }, {  2,  10 }, {  33, 42 }, {  0,  0 },&lt;br /&gt;
        {   1,  4 }, {   0,  3 }, {  0,   1 }, {   1,  3 }, {  0,  0 }, }, },&lt;br /&gt;
    { { {  11, 20 }, {   1,  4 }, { 18,  36 }, {  43, 48 }, { 13, 35 },&lt;br /&gt;
        {   0,  2 }, {   0,  5 }, {  3,  12 }, {   1,  2 }, {  0,  0 }, },&lt;br /&gt;
      { {   2,  5 }, {   4,  5 }, {  0, 121 }, {   0,  0 }, {  0,  0 },&lt;br /&gt;
        {   0,  3 }, {   2,  4 }, {  1,   4 }, {   2,  2 }, {  0,  1 }, },&lt;br /&gt;
      { {  14, 31 }, {   9, 13 }, { 14,  54 }, {  22, 29 }, {  0,  0 },&lt;br /&gt;
        {   2,  6 }, {   4, 18 }, {  6,  13 }, {   1,  5 }, {  0,  1 }, }, },&lt;br /&gt;
    { { {  70, 44 }, {   0,  1 }, {  2,  10 }, {  37, 46 }, {  8, 26 },&lt;br /&gt;
        {   0,  2 }, {   0,  2 }, {  0,   2 }, {   0,  1 }, {  0,  0 }, },&lt;br /&gt;
      { { 175,  5 }, {   0,  1 }, {  0,  48 }, {   0,  0 }, {  0,  0 },&lt;br /&gt;
        {   0,  2 }, {   0,  1 }, {  0,   2 }, {   0,  1 }, {  0,  0 }, },&lt;br /&gt;
      { {  85, 39 }, {   0,  0 }, {  1,   9 }, {  69, 40 }, {  0,  0 },&lt;br /&gt;
        {   0,  1 }, {   0,  3 }, {  0,   1 }, {   2,  3 }, {  0,  0 }, }, },&lt;br /&gt;
    { { {   8, 15 }, {   0,  1 }, {  8,  21 }, {  74, 53 }, { 22, 42 },&lt;br /&gt;
        {   0,  1 }, {   0,  2 }, {  0,   3 }, {   1,  2 }, {  0,  0 }, },&lt;br /&gt;
      { {  83,  5 }, {   2,  3 }, {  0, 102 }, {   0,  0 }, {  0,  0 },&lt;br /&gt;
        {   1,  3 }, {   0,  2 }, {  0,   1 }, {   0,  0 }, {  0,  0 }, },&lt;br /&gt;
      { {  31, 28 }, {   0,  0 }, {  3,  14 }, { 130, 34 }, {  0,  0 },&lt;br /&gt;
        {   0,  1 }, {   0,  3 }, {  0,   1 }, {   3,  3 }, {  0,  1 }, }, },&lt;br /&gt;
    { { { 141, 42 }, {   0,  0 }, {  1,   4 }, {  11, 24 }, {  1, 11 },&lt;br /&gt;
        {   0,  1 }, {   0,  1 }, {  0,   2 }, {   0,  0 }, {  0,  0 }, },&lt;br /&gt;
      { { 233,  6 }, {   0,  0 }, {  0,   8 }, {   0,  0 }, {  0,  0 },&lt;br /&gt;
        {   0,  1 }, {   0,  1 }, {  0,   0 }, {   0,  1 }, {  0,  0 }, },&lt;br /&gt;
      { { 171, 25 }, {   0,  0 }, {  1,   5 }, {  25, 21 }, {  0,  0 },&lt;br /&gt;
        {   0,  1 }, {   0,  1 }, {  0,   0 }, {   0,  0 }, {  0,  0 }, }, },&lt;br /&gt;
    { { {   8, 19 }, {   4, 10 }, { 24,  45 }, {  21, 37 }, {  9, 29 },&lt;br /&gt;
        {   0,  3 }, {   1,  7 }, { 11,  25 }, {   0,  2 }, {  0,  1 }, },&lt;br /&gt;
      { {  34, 16 }, { 112, 21 }, {  1,  28 }, {   0,  0 }, {  0,  0 },&lt;br /&gt;
        {   6,  8 }, {   1,  7 }, {  0,   3 }, {   2,  5 }, {  0,  2 }, },&lt;br /&gt;
      { {  17, 21 }, {  68, 29 }, {  6,  15 }, {  13, 22 }, {  0,  0 },&lt;br /&gt;
        {   6, 12 }, {   3, 14 }, {  4,  10 }, {   1,  7 }, {  0,  3 }, }, },&lt;br /&gt;
    { { {  46, 42 }, {   0,  1 }, {  2,  10 }, {  54, 51 }, { 10, 30 },&lt;br /&gt;
        {   0,  2 }, {   0,  2 }, {  0,   1 }, {   0,  1 }, {  0,  0 }, },&lt;br /&gt;
      { { 159, 35 }, {   2,  2 }, {  0,  25 }, {   0,  0 }, {  0,  0 },&lt;br /&gt;
        {   3,  6 }, {   0,  5 }, {  0,   1 }, {   4,  4 }, {  0,  1 }, },&lt;br /&gt;
      { {  51, 39 }, {   0,  1 }, {  2,  12 }, {  91, 44 }, {  0,  0 },&lt;br /&gt;
        {   0,  2 }, {   0,  3 }, {  0,   1 }, {   2,  3 }, {  0,  1 }, }, },&lt;br /&gt;
    { { {  28, 32 }, {   0,  0 }, {  3,  10 }, {  75, 51 }, { 14, 33 },&lt;br /&gt;
        {   0,  1 }, {   0,  2 }, {  0,   1 }, {   1,  2 }, {  0,  0 }, },&lt;br /&gt;
      { {  75, 39 }, {   5,  7 }, {  2,  48 }, {   0,  0 }, {  0,  0 },&lt;br /&gt;
        {   3, 11 }, {   2, 16 }, {  1,   4 }, {   7, 10 }, {  0,  2 }, },&lt;br /&gt;
      { {  81, 25 }, {   0,  0 }, {  2,   9 }, { 106, 26 }, {  0,  0 },&lt;br /&gt;
        {   0,  1 }, {   0,  1 }, {  0,   1 }, {   1,  1 }, {  0,  0 }, }, },&lt;br /&gt;
    { { { 100, 46 }, {   0,  1 }, {  3,   9 }, {  21, 37 }, {  5, 20 },&lt;br /&gt;
        {   0,  1 }, {   0,  2 }, {  1,   2 }, {   0,  1 }, {  0,  0 }, },&lt;br /&gt;
      { { 212, 21 }, {   0,  1 }, {  0,   9 }, {   0,  0 }, {  0,  0 },&lt;br /&gt;
        {   1,  2 }, {   0,  2 }, {  0,   0 }, {   2,  2 }, {  0,  0 }, },&lt;br /&gt;
      { { 140, 37 }, {   0,  1 }, {  1,   8 }, {  24, 33 }, {  0,  0 },&lt;br /&gt;
        {   1,  2 }, {   0,  2 }, {  0,   1 }, {   1,  2 }, {  0,  0 }, }, },&lt;br /&gt;
    { { {  27, 29 }, {   0,  1 }, {  9,  25 }, {  53, 51 }, { 12, 34 },&lt;br /&gt;
        {   0,  1 }, {   0,  3 }, {  1,   5 }, {   0,  2 }, {  0,  0 }, },&lt;br /&gt;
      { {   4,  2 }, {   0,  0 }, {  0, 172 }, {   0,  0 }, {  0,  0 },&lt;br /&gt;
        {   0,  1 }, {   0,  2 }, {  0,   0 }, {   2,  0 }, {  0,  0 }, },&lt;br /&gt;
      { {  14, 23 }, {   1,  3 }, { 11,  53 }, {  90, 31 }, {  0,  0 },&lt;br /&gt;
        {   0,  3 }, {   1,  5 }, {  2,   6 }, {   1,  2 }, {  0,  0 }, }, },&lt;br /&gt;
    { { {  80, 38 }, {   0,  0 }, {  1,   4 }, {  69, 33 }, {  5, 16 },&lt;br /&gt;
        {   0,  1 }, {   0,  1 }, {  0,   0 }, {   0,  1 }, {  0,  0 }, },&lt;br /&gt;
      { { 187, 22 }, {   1,  1 }, {  0,  17 }, {   0,  0 }, {  0,  0 },&lt;br /&gt;
        {   3,  6 }, {   0,  4 }, {  0,   1 }, {   4,  4 }, {  0,  1 }, },&lt;br /&gt;
      { { 123, 29 }, {   0,  0 }, {  1,   7 }, {  57, 30 }, {  0,  0 },&lt;br /&gt;
        {   0,  1 }, {   0,  1 }, {  0,   1 }, {   0,  1 }, {  0,  0 }, }, },&lt;br /&gt;
    { { {  16, 20 }, {   0,  0 }, {  2,   8 }, { 104, 49 }, { 15, 33 },&lt;br /&gt;
        {   0,  1 }, {   0,  1 }, {  0,   1 }, {   1,  1 }, {  0,  0 }, },&lt;br /&gt;
      { { 133,  6 }, {   1,  2 }, {  1,  70 }, {   0,  0 }, {  0,  0 },&lt;br /&gt;
        {   0,  2 }, {   0,  4 }, {  0,   3 }, {   1,  1 }, {  0,  0 }, },&lt;br /&gt;
      { {  13, 14 }, {   0,  0 }, {  4,  20 }, { 175, 20 }, {  0,  0 },&lt;br /&gt;
        {   0,  1 }, {   0,  1 }, {  0,   1 }, {   1,  1 }, {  0,  0 }, }, },&lt;br /&gt;
    { { { 194, 16 }, {   0,  0 }, {  1,   1 }, {   1,  9 }, {  1,  3 },&lt;br /&gt;
        {   0,  0 }, {   0,  1 }, {  0,   1 }, {   0,  0 }, {  0,  0 }, },&lt;br /&gt;
      { { 251,  1 }, {   0,  0 }, {  0,   2 }, {   0,  0 }, {  0,  0 },&lt;br /&gt;
        {   0,  0 }, {   0,  0 }, {  0,   0 }, {   0,  0 }, {  0,  0 }, },&lt;br /&gt;
      { { 202, 23 }, {   0,  0 }, {  1,   3 }, {   2,  9 }, {  0,  0 },&lt;br /&gt;
        {   0,  1 }, {   0,  1 }, {  0,   1 }, {   0,  0 }, {  0,  0 }, }, }, }&lt;br /&gt;
&lt;br /&gt;
=== vmc_pct ===&lt;br /&gt;
  { { 243, 220, 251, 253, 237, 232, 241, 245, 247, 251, 253 },&lt;br /&gt;
    { 235, 211, 246, 249, 234, 231, 248, 249, 252, 252, 254 }, }&lt;br /&gt;
&lt;br /&gt;
=== dccv_pct ===&lt;br /&gt;
  { { 146, 197, 181, 207, 232, 243, 238, 251, 244, 250, 249 },&lt;br /&gt;
    { 179, 219, 214, 240, 250, 254, 244, 254, 254, 254, 254 }, }&lt;br /&gt;
&lt;br /&gt;
=== ract_pct ===&lt;br /&gt;
  { { { { 227, 246, 230, 247, 244, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 202, 254, 209, 231, 231, 249, 249, 253, 254, 254, 254 },&lt;br /&gt;
        { 206, 254, 225, 242, 241, 251, 253, 254, 254, 254, 254 },&lt;br /&gt;
        { 235, 254, 241, 253, 252, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 234, 254, 248, 254, 254, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, },&lt;br /&gt;
      { { 240, 254, 248, 254, 254, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 238, 254, 240, 253, 254, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 244, 254, 251, 254, 254, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, }, },&lt;br /&gt;
    { { { 206, 203, 227, 239, 247, 254, 253, 254, 254, 254, 254 },&lt;br /&gt;
        { 207, 199, 220, 236, 243, 252, 252, 254, 254, 254, 254 },&lt;br /&gt;
        { 212, 219, 230, 243, 244, 253, 252, 254, 254, 254, 254 },&lt;br /&gt;
        { 236, 237, 247, 252, 253, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 240, 240, 248, 254, 254, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, },&lt;br /&gt;
      { { 230, 233, 249, 254, 254, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 238, 238, 250, 254, 254, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 248, 251, 254, 254, 254, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, }, },&lt;br /&gt;
    { { { 225, 239, 227, 231, 244, 253, 243, 254, 254, 253, 254 },&lt;br /&gt;
        { 232, 234, 224, 228, 242, 249, 242, 252, 251, 251, 254 },&lt;br /&gt;
        { 235, 249, 238, 240, 251, 254, 249, 254, 253, 253, 254 },&lt;br /&gt;
        { 249, 253, 251, 250, 254, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 251, 250, 249, 254, 254, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, },&lt;br /&gt;
      { { 243, 244, 250, 250, 254, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 249, 248, 250, 253, 254, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 253, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },&lt;br /&gt;
        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, }, }, }&lt;br /&gt;
&lt;br /&gt;
=== dccv_lc ===&lt;br /&gt;
  { { {154,  61}, {141,  54}, { 90,  45}, { 54,  34}, { 54,  13}, {128, 109},&lt;br /&gt;
      {136,  54}, {148,  45}, { 92,  41}, { 54,  33}, { 51,  15}, { 87, 113},&lt;br /&gt;
      { 87,  44}, { 97,  40}, { 67,  36}, { 46,  29}, { 41,  15}, { 64,  80},&lt;br /&gt;
      { 59,  33}, { 61,  31}, { 51,  28}, { 44,  22}, { 33,  12}, { 49,  63},&lt;br /&gt;
      { 69,  12}, { 59,  16}, { 46,  14}, { 31,  13}, { 26,   6}, { 92,  26},&lt;br /&gt;
      {128, 108}, { 77, 119}, { 54,  84}, { 26,  71}, { 87,  19}, { 95, 155}, },&lt;br /&gt;
    { {154,   4}, {182,   0}, {159,  -8}, {128,  -5}, {143,  -5}, {187,  55},&lt;br /&gt;
      {182,   0}, {228,  -3}, {187,  -7}, {174,  -9}, {189, -11}, {169,  79},&lt;br /&gt;
      {161,  -9}, {192,  -8}, {187,  -9}, {169, -10}, {136,  -9}, {184,  40},&lt;br /&gt;
      {164, -11}, {179, -10}, {174, -10}, {161, -10}, {115,  -7}, {197,  20},&lt;br /&gt;
      {195, -11}, {195, -11}, {146, -10}, {110,  -6}, { 95,  -4}, {195,  39},&lt;br /&gt;
      {182,  55}, {172,  77}, {177,  37}, {169,  29}, {172,  52}, { 92, 162}, },&lt;br /&gt;
    { {174,  80}, {164,  80}, { 95,  80}, { 46,  66}, { 56,  24}, { 36, 193},&lt;br /&gt;
      {164,  80}, {166,  77}, {105,  76}, { 49,  68}, { 46,  31}, { 49, 186},&lt;br /&gt;
      { 97,  78}, {110,  74}, { 72,  72}, { 44,  60}, { 33,  30}, { 69, 131},&lt;br /&gt;
      { 61,  61}, { 69,  63}, { 51,  57}, { 31,  48}, { 26,  27}, { 64,  89},&lt;br /&gt;
      { 67,  23}, { 51,  32}, { 36,  33}, { 26,  28}, { 20,  12}, { 44,  68},&lt;br /&gt;
      { 26, 197}, { 41, 189}, { 61, 129}, { 28, 103}, { 49,  52}, {-12, 245}, },&lt;br /&gt;
    { {102, 141}, { 79, 166}, { 72, 162}, { 97, 125}, {179,   4}, {307,   0},&lt;br /&gt;
      { 72, 168}, { 69, 175}, { 84, 160}, {105, 127}, {148,  34}, {310,   0},&lt;br /&gt;
      { 84, 151}, { 82, 161}, { 87, 153}, { 87, 135}, {115,  51}, {317,   0},&lt;br /&gt;
      { 97, 125}, {102, 131}, {105, 125}, { 87, 122}, { 84,  64}, { 54, 184},&lt;br /&gt;
      {166,  18}, {146,  43}, {125,  51}, { 90,  64}, { 95,   7}, { 38, 154},&lt;br /&gt;
      {294,   0}, { 13, 225}, { 10, 225}, { 67, 168}, {  0, 167}, {161,  94}, },&lt;br /&gt;
    { {172,  76}, {172,  75}, {136,  80}, { 64,  98}, { 74,  67}, {315,   0},&lt;br /&gt;
      {169,  76}, {207,  56}, {164,  66}, { 97,  80}, { 67,  72}, {328,   0},&lt;br /&gt;
      {136,  80}, {187,  53}, {154,  62}, { 72,  85}, { -2, 105}, {305,   0},&lt;br /&gt;
      { 74,  91}, {128,  64}, {113,  64}, { 61,  77}, { 41,  75}, {259,   0},&lt;br /&gt;
      { 46,  84}, { 51,  81}, { 28,  89}, { 31,  78}, { 23,  77}, {202,   0},&lt;br /&gt;
      {323,   0}, {323,   0}, {300,   0}, {236,   0}, {195,   0}, {328,   0}, }, }&lt;br /&gt;
&lt;br /&gt;
=== ract_lc ===&lt;br /&gt;
  { { { { {276,  0}, {238,  0}, {195,  0}, {156,  0}, {113,  0}, {274,  0} },&lt;br /&gt;
        { {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1} },&lt;br /&gt;
        { {192, 59}, {182, 50}, {141, 48}, {110, 40}, { 92, 19}, {125,128} },&lt;br /&gt;
        { {169, 87}, {169, 83}, {184, 62}, {220, 16}, {184,  0}, {264,  0} },&lt;br /&gt;
        { {212, 40}, {212, 36}, {169, 49}, {174, 27}, {  8,120}, {182, 71} }, },&lt;br /&gt;
      { { {259, 10}, {197, 19}, {143, 22}, {123, 16}, {110,  8}, {133, 88} },&lt;br /&gt;
        { {  0,  1}, {256,  0}, {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1} },&lt;br /&gt;
        { {207, 46}, {187, 50}, { 97, 83}, { 23,100}, { 41, 56}, { 56,188} },&lt;br /&gt;
        { {166, 90}, {146,108}, {161, 88}, {136, 95}, {174,  0}, {266,  0} },&lt;br /&gt;
        { {264,  7}, {243, 18}, {184, 43}, {-14,154}, { 20,112}, { 20,199} }, },&lt;br /&gt;
      { { {230, 26}, {197, 22}, {159, 20}, {146, 12}, {136,  4}, { 54,162} },&lt;br /&gt;
        { {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1} },&lt;br /&gt;
        { {192, 59}, {156, 72}, { 84,101}, { 49,101}, { 79, 47}, { 79,167} },&lt;br /&gt;
        { {138,115}, {136,116}, {166, 80}, {238,  0}, {195,  0}, {261,  0} },&lt;br /&gt;
        { {225, 33}, {205, 42}, {159, 61}, { 79, 96}, { 92, 66}, { 28,195} }, },&lt;br /&gt;
    }, {&lt;br /&gt;
      { { {200, 37}, {197, 18}, {159, 13}, {143,  7}, {102,  5}, {123,126} },&lt;br /&gt;
        { {197,  3}, {220, -9}, {210,-12}, {187, -6}, {151, -2}, {174, 80} },&lt;br /&gt;
        { {200, 53}, {187, 47}, {159, 40}, {118, 38}, {100, 18}, {141,111} },&lt;br /&gt;
        { {179, 78}, {166, 86}, {197, 50}, {207, 27}, {187,  0}, {115,139} },&lt;br /&gt;
        { {218, 34}, {220, 29}, {174, 46}, {128, 61}, { 54, 89}, {187, 65} }, },&lt;br /&gt;
      { { {238, 14}, {197, 18}, {125, 26}, { 90, 25}, { 82, 13}, {161, 86} },&lt;br /&gt;
        { {189,  1}, {205, -2}, {156, -4}, {143, -4}, {146, -4}, {172, 72} },&lt;br /&gt;
        { {230, 31}, {192, 45}, {102, 76}, { 38, 85}, { 56, 41}, { 64,173} },&lt;br /&gt;
        { {166, 91}, {141,111}, {128,116}, {118,109}, {177,  0}, { 23,222} },&lt;br /&gt;
        { {253, 14}, {236, 21}, {174, 49}, { 33,118}, { 44, 93}, { 23,187} }, },&lt;br /&gt;
      { { {218, 28}, {179, 28}, {118, 35}, { 95, 30}, { 72, 24}, {128,108} },&lt;br /&gt;
        { {187,  1}, {174, -1}, {125, -1}, {110, -1}, {108, -1}, {202, 52} },&lt;br /&gt;
        { {197, 53}, {146, 75}, { 46,118}, { 33,103}, { 64, 50}, {118,126} },&lt;br /&gt;
        { {138,114}, {128,122}, {161, 86}, {243, -6}, {195,  0}, { 38,210} },&lt;br /&gt;
        { {215, 39}, {179, 58}, { 97,101}, { 95, 85}, { 87, 70}, { 69,152} }, },&lt;br /&gt;
    }, {&lt;br /&gt;
      { { {236, 24}, {205, 18}, {172, 12}, {154,  6}, {125,  1}, {169, 75} },&lt;br /&gt;
        { {187,  4}, {230, -2}, {228, -4}, {236, -4}, {241, -2}, {192, 66} },&lt;br /&gt;
        { {200, 46}, {187, 42}, {159, 34}, {136, 25}, {105, 10}, {179, 62} },&lt;br /&gt;
        { {207, 55}, {192, 63}, {192, 54}, {195, 36}, {177,  1}, {143, 98} },&lt;br /&gt;
        { {225, 27}, {207, 34}, {200, 30}, {131, 57}, { 97, 60}, {197, 45} }, },&lt;br /&gt;
      { { {271,  8}, {218, 13}, {133, 19}, { 90, 19}, { 72,  7}, {182, 51} },&lt;br /&gt;
        { {179,  1}, {225, -1}, {154, -2}, {110, -1}, { 92,  0}, {195, 41} },&lt;br /&gt;
        { {241, 26}, {189, 40}, { 82, 64}, { 33, 60}, { 67, 17}, {120, 94} },&lt;br /&gt;
        { {192, 68}, {151, 94}, {146, 90}, {143, 72}, {161,  0}, {113,128} },&lt;br /&gt;
        { {256, 12}, {218, 29}, {166, 48}, { 44, 99}, { 31, 87}, {148, 78} }, },&lt;br /&gt;
      { { {238, 20}, {184, 22}, {113, 27}, { 90, 22}, { 74,  9}, {192, 37} },&lt;br /&gt;
        { {184,  0}, {215, -1}, {141, -1}, { 97,  0}, { 49,  0}, {264, 13} },&lt;br /&gt;
        { {182, 51}, {138, 61}, { 95, 63}, { 54, 59}, { 64, 25}, {200, 45} },&lt;br /&gt;
        { {179, 75}, {156, 87}, {174, 65}, {177, 44}, {174,  0}, {164, 85} },&lt;br /&gt;
        { {195, 45}, {148, 65}, {105, 79}, { 95, 72}, { 87, 60}, {169, 63} }, }, }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
=== coeff_groups ===&lt;br /&gt;
  { -1, 0, 1, 1, 2, 1, 1, 2,&lt;br /&gt;
     2, 1, 1, 2, 2, 2, 1, 2,&lt;br /&gt;
     2, 2, 2, 2, 1, 1, 2, 2,&lt;br /&gt;
     3, 3, 4, 3, 4, 4, 4, 3,&lt;br /&gt;
     3, 3, 3, 3, 4, 3, 3, 3,&lt;br /&gt;
     4, 4, 4, 4, 4, 3, 3, 4,&lt;br /&gt;
     4, 4, 3, 4, 4, 4, 4, 4,&lt;br /&gt;
     4, 4, 5, 5, 5, 5, 5, 5, }&lt;br /&gt;
&lt;br /&gt;
=== coeff_bias ===&lt;br /&gt;
  { 5, 7, 11, 19, 35, 67 }&lt;br /&gt;
&lt;br /&gt;
=== coeff_bit_length ===&lt;br /&gt;
  { 0, 1, 2, 3, 4, 10 }&lt;br /&gt;
&lt;br /&gt;
=== coeff_parse_table ===&lt;br /&gt;
  { { 159,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0 },&lt;br /&gt;
    { 145, 165,   0,   0,   0,   0,   0,   0,   0,   0,   0 },&lt;br /&gt;
    { 140, 148, 173,   0,   0,   0,   0,   0,   0,   0,   0 },&lt;br /&gt;
    { 135, 140, 155, 176,   0,   0,   0,   0,   0,   0,   0 },&lt;br /&gt;
    { 130, 134, 141, 157, 180,   0,   0,   0,   0,   0,   0 },&lt;br /&gt;
    { 129, 130, 133, 140, 153, 177, 196, 230, 243, 254, 254 }, }&lt;br /&gt;
&lt;br /&gt;
=== candidate_predictor_pos ===&lt;br /&gt;
  { {  0, -1 },&lt;br /&gt;
    { -1,  0 },&lt;br /&gt;
    { -1, -1 },&lt;br /&gt;
    {  1, -1 },&lt;br /&gt;
    {  0, -2 },&lt;br /&gt;
    { -2,  0 },&lt;br /&gt;
    { -2, -1 },&lt;br /&gt;
    { -1, -2 },&lt;br /&gt;
    {  1, -2 },&lt;br /&gt;
    {  2, -1 },&lt;br /&gt;
    { -2, -2 },&lt;br /&gt;
    {  2, -2 }, }&lt;br /&gt;
&lt;br /&gt;
[[Category:Video Codecs]]&lt;/div&gt;</summary>
		<author><name>Aurel</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Indeo_5&amp;diff=2380</id>
		<title>Indeo 5</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Indeo_5&amp;diff=2380"/>
		<updated>2006-02-21T00:46:10Z</updated>

		<summary type="html">&lt;p&gt;Aurel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* FOURCCs: IV50&lt;br /&gt;
* Company: [[Intel]], then [[Ligos]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General description ==&lt;br /&gt;
&lt;br /&gt;
=== Frame layout ===&lt;br /&gt;
&lt;br /&gt;
The general indeo5 frames layout is composed of one global header, followed by the content of the three YUV plans.&lt;br /&gt;
&lt;br /&gt;
In this document, the global header is split into 3 parts:&lt;br /&gt;
* [[#Frame_header|Frame header]]: describe the kind of frame (I/P/B)&lt;br /&gt;
* [[#GOP_header|GOP header]]: some data which is true for all the frame in this GOP (present only in the first (I) frame of the GOP)&lt;br /&gt;
* [[#More_header|More header]]: some more data which is true only for this single frame&lt;br /&gt;
&lt;br /&gt;
Each YUV plan begin with a [[#Plan_header|Plan header]], containing values which are valid only for this single plan.&lt;br /&gt;
&lt;br /&gt;
=== Encoding ===&lt;br /&gt;
&lt;br /&gt;
This codec is based on the slant transform. Other used standard techniques are huffman coding and motion compensation.&lt;br /&gt;
&lt;br /&gt;
=== Conventions ===&lt;br /&gt;
&lt;br /&gt;
Headers are described in some tables. Each row of those tables describes a value which may be read from the frame. Those tables and rows are presented in the order of appearance in the frame.&lt;br /&gt;
&lt;br /&gt;
Here are the meaning of each columns:&lt;br /&gt;
* '''size''': The size of this value in bits. Bits are counted in MSB to LSB order. As an example, with the byte 01110000b, reading 3 bits then 5 bits will return 011b then 10000b.&lt;br /&gt;
* '''name''': Kind of variable name, used to reference the value. When a value is named valueX, it generally means we don't know it's purpose. Lines named alignmentX means that bits reader need to skip bits until next byte boundary.&lt;br /&gt;
* '''condition''': The value is present in the frame only if this condition is matched. No condition means that the value is always present.&lt;br /&gt;
* '''nb times''': How many times the value is repeated.&lt;br /&gt;
* '''comments''': Some details about the content of the value. It may also explain that a value is repeated until a certain condition is reached.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Headers ==&lt;br /&gt;
&lt;br /&gt;
=== Frame header ===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;border-collapse: collapse; border-style: dashed; border-color: #2f6fab;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#f0f0f0&amp;quot; |&lt;br /&gt;
! size !! name !! condition !! nb times !! comments&lt;br /&gt;
|-&lt;br /&gt;
| 3  || frame_flags || || ||&lt;br /&gt;
* frame_flags &amp;amp; 0x01 =&amp;gt; backward predictive&lt;br /&gt;
* frame_flags &amp;amp; 0x02 =&amp;gt; forward predictive&lt;br /&gt;
* frame_flags &amp;amp; 0x04 =&amp;gt; null frame&lt;br /&gt;
common values:&lt;br /&gt;
* 0 =&amp;gt; I frame&lt;br /&gt;
* 1 =&amp;gt; P frame&lt;br /&gt;
* 3 =&amp;gt; B frame&lt;br /&gt;
|-&lt;br /&gt;
| 5 || const1 || || || = 0x1F always&lt;br /&gt;
|-&lt;br /&gt;
| 8 || id_in_gop || || || frame number in GOP (0 for I frame)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
null frames don't contain anything else than this header.&lt;br /&gt;
&lt;br /&gt;
=== GOP header ===&lt;br /&gt;
&lt;br /&gt;
This header is present in I frames only. The values in this header are valid during the whole GOP starting at this frame.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;border-collapse: collapse; border-style: dashed; border-color: #2f6fab;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#f0f0f0&amp;quot; |&lt;br /&gt;
! size !! name !! condition !! nb times !! comments&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  8 || &amp;lt;span id=&amp;quot;gh_flags&amp;quot;&amp;gt;gh_flags&amp;lt;/span&amp;gt; || || || [[#gh_flags|gh_flags]] &amp;amp; 0x02 =&amp;gt; YV12 (default YVU9)&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; | 16 || &amp;lt;span id=&amp;quot;value1&amp;quot;&amp;gt;value1&amp;lt;/span&amp;gt; || [[#gh_flags|gh_flags]] &amp;amp; 0x01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; | 32 || &amp;lt;span id=&amp;quot;value2&amp;quot;&amp;gt;value2&amp;lt;/span&amp;gt; || [[#gh_flags|gh_flags]] &amp;amp; 0x20 || ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  2 || &amp;lt;span id=&amp;quot;value3&amp;quot;&amp;gt;value3&amp;lt;/span&amp;gt; || [[#gh_flags|gh_flags]] &amp;amp; 0x40 || ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  3 || &amp;lt;span id=&amp;quot;value4&amp;quot;&amp;gt;value4&amp;lt;/span&amp;gt; || || ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  4 || &amp;lt;span id=&amp;quot;res_id&amp;quot;&amp;gt;res_id&amp;lt;/span&amp;gt; || || || see [[#Resolution_table|Resolution table]]&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; | 13 || &amp;lt;span id=&amp;quot;height&amp;quot;&amp;gt;height&amp;lt;/span&amp;gt; || rowspan=&amp;quot;2&amp;quot; | [[#res_id|res_id]] == 15 || || frame height&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; | 13 || &amp;lt;span id=&amp;quot;width&amp;quot;&amp;gt;width&amp;lt;/span&amp;gt; || || frame width&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  6 || &amp;lt;span id=&amp;quot;value5&amp;quot;&amp;gt;value5&amp;lt;/span&amp;gt; || || rowspan=&amp;quot;2&amp;quot; | 2*n (n == 1 always?) ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  2 || &amp;lt;span id=&amp;quot;value6&amp;quot;&amp;gt;value6&amp;lt;/span&amp;gt; || [[#value5|value5]] &amp;gt;&amp;gt; 3 || need to be = 0&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  4 || &amp;lt;span id=&amp;quot;value7&amp;quot;&amp;gt;value7&amp;lt;/span&amp;gt; || rowspan=&amp;quot;2&amp;quot; | [[#gh_flags|gh_flags]] &amp;amp; 0x08 || ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; | 24 || &amp;lt;span id=&amp;quot;value8&amp;quot;&amp;gt;value8&amp;lt;/span&amp;gt; || ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; | ?? || &amp;lt;span id=&amp;quot;alignment1&amp;quot;&amp;gt;alignment1&amp;lt;/span&amp;gt; || || || align bits reader on next byte&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; | 24 || &amp;lt;span id=&amp;quot;value9&amp;quot;&amp;gt;value9&amp;lt;/span&amp;gt; || || ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; | 16 || &amp;lt;span id=&amp;quot;value10&amp;quot;&amp;gt;value10&amp;lt;/span&amp;gt; || [[#value9|value9]] &amp;amp; 0x800000 || || loops while value10 &amp;amp; 0x8000 (probably some kind of VLC ?)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== More header ===&lt;br /&gt;
&lt;br /&gt;
This header is present in all kinds of frame except null.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;border-collapse: collapse; border-style: dashed; border-color: #2f6fab;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#f0f0f0&amp;quot; |&lt;br /&gt;
! size !! name !! condition !! nb times !! comments&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  8 || &amp;lt;span id=&amp;quot;mh_flags&amp;quot;&amp;gt;mh_flags&amp;lt;/span&amp;gt; || || ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; | 24 || &amp;lt;span id=&amp;quot;frame_size&amp;quot;&amp;gt;frame_size&amp;lt;/span&amp;gt; || [[#mh_flags|mh_flags]] &amp;amp; 0x01 || || tolal size of frame data&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; | 16 || &amp;lt;span id=&amp;quot;value11&amp;quot;&amp;gt;value11&amp;lt;/span&amp;gt; || [[#mh_flags|mh_flags]] &amp;amp; 0x10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  8 || &amp;lt;span id=&amp;quot;counter1&amp;quot;&amp;gt;counter1&amp;lt;/span&amp;gt; || rowspan=&amp;quot;2&amp;quot; | [[#mh_flags|mh_flags]] &amp;amp; 0x20 || || rowspan=&amp;quot;2&amp;quot; | this whole block loops while [[#counter1|counter1]] != 0&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  8 || &amp;lt;span id=&amp;quot;value12&amp;quot;&amp;gt;value12&amp;lt;/span&amp;gt; || [[#counter1|counter1]]&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  3 || &amp;lt;span id=&amp;quot;value13&amp;quot;&amp;gt;value13&amp;lt;/span&amp;gt; || [[#mh_flags|mh_flags]] &amp;amp; 0x40 || ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  4 || &amp;lt;span id=&amp;quot;counter2&amp;quot;&amp;gt;counter2&amp;lt;/span&amp;gt; || rowspan=&amp;quot;2&amp;quot; | [[#value13|value13]] == 7 || ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  4 || &amp;lt;span id=&amp;quot;value14&amp;quot;&amp;gt;value14&amp;lt;/span&amp;gt; || [[#counter2|counter2]] ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  3 || &amp;lt;span id=&amp;quot;value15&amp;quot;&amp;gt;value15&amp;lt;/span&amp;gt; || || ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; | ?? || &amp;lt;span id=&amp;quot;alignment2&amp;quot;&amp;gt;alignment2&amp;lt;/span&amp;gt; || || || align bits reader on next byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Plan header ===&lt;br /&gt;
&lt;br /&gt;
This header is present at the beginning of every plan.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;border-collapse: collapse; border-style: dashed; border-color: #2f6fab;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#f0f0f0&amp;quot; |&lt;br /&gt;
! size !! name !! condition !! nb times !! comments&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  8 || &amp;lt;span id=&amp;quot;ph_flags&amp;quot;&amp;gt;ph_flags&amp;lt;/span&amp;gt; || || ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; | 24 || &amp;lt;span id=&amp;quot;plan_size&amp;quot;&amp;gt;plan_size&amp;lt;/span&amp;gt; || [[#mh_flags|mh_flags]] &amp;amp; 0x80 || || tolal size of plan data&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  8 || &amp;lt;span id=&amp;quot;counter3&amp;quot;&amp;gt;counter3&amp;lt;/span&amp;gt; || rowspan=&amp;quot;3&amp;quot; | [[#ph_flags|ph_flags]] &amp;amp; 0x10 || || must be &amp;lt; 0x3E&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  8 || &amp;lt;span id=&amp;quot;value16&amp;quot;&amp;gt;value16&amp;lt;/span&amp;gt; || rowspan=&amp;quot;2&amp;quot; | [[#counter3|counter3]] ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  8 || &amp;lt;span id=&amp;quot;value17&amp;quot;&amp;gt;value17&amp;lt;/span&amp;gt; ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  3 || &amp;lt;span id=&amp;quot;value18&amp;quot;&amp;gt;value18&amp;lt;/span&amp;gt; || [[#ph_flags|ph_flags]] &amp;amp; 0x40 || ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  3 || &amp;lt;span id=&amp;quot;table1_id&amp;quot;&amp;gt;table1_id&amp;lt;/span&amp;gt; || [[#ph_flags|ph_flags]] &amp;amp; 0x80 || || see [[#Table_1|Table 1]]&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  4 || &amp;lt;span id=&amp;quot;counter4&amp;quot;&amp;gt;counter4&amp;lt;/span&amp;gt; || rowspan=&amp;quot;2&amp;quot; | [[#table1_id|table1_id]] == 7 || || rowspan=&amp;quot;2&amp;quot; | used instead of [[#Table1|Table1]]&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  4 || &amp;lt;span id=&amp;quot;value19&amp;quot;&amp;gt;value19&amp;lt;/span&amp;gt; || [[#counter4|counter4]]&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  1 || &amp;lt;span id=&amp;quot;value20&amp;quot;&amp;gt;value20&amp;lt;/span&amp;gt; || || ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; | 16 || &amp;lt;span id=&amp;quot;value21&amp;quot;&amp;gt;value21&amp;lt;/span&amp;gt; || [[#value20|value20]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  5 || &amp;lt;span id=&amp;quot;value22&amp;quot;&amp;gt;value22&amp;lt;/span&amp;gt; || || ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; | ?? || &amp;lt;span id=&amp;quot;alignment3&amp;quot;&amp;gt;alignment3&amp;lt;/span&amp;gt; || || || align bits reader on next byte&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  8 || &amp;lt;span id=&amp;quot;counter5&amp;quot;&amp;gt;counter5&amp;lt;/span&amp;gt; || rowspan=&amp;quot;4&amp;quot; | [[#ph_flags|ph_flags]] &amp;amp; 0x20 || || rowspan=&amp;quot;3&amp;quot; | all of this is repeated as long as [[#value23|value23]] is true&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  8 || &amp;lt;span id=&amp;quot;skip1&amp;quot;&amp;gt;skip1&amp;lt;/span&amp;gt; || [[#counter5|counter5]]&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  1 || &amp;lt;span id=&amp;quot;value23&amp;quot;&amp;gt;value23&amp;lt;/span&amp;gt; ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; | ?? || &amp;lt;span id=&amp;quot;alignment4&amp;quot;&amp;gt;alignment4&amp;lt;/span&amp;gt; || || align bits reader on next byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Plan data ==&lt;br /&gt;
&lt;br /&gt;
This is where the actual data is, but this still need to be reverse engineered :-(&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;border-collapse: collapse; border-style: dashed; border-color: #2f6fab;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#f0f0f0&amp;quot; |&lt;br /&gt;
! size !! name !! condition !! nb times !! comments&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  1 || &amp;lt;span id=&amp;quot;value24&amp;quot;&amp;gt;value24&amp;lt;/span&amp;gt; || || ||&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  1 || &amp;lt;span id=&amp;quot;value25&amp;quot;&amp;gt;value25&amp;lt;/span&amp;gt; || ! [[#value24|value24]] || || plan_data_size = value25&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; |  8 || &amp;lt;span id=&amp;quot;value26&amp;quot;&amp;gt;value26&amp;lt;/span&amp;gt; || [[#value25|value25]] == 1 || || plan_data_size = value26&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; | 24 || &amp;lt;span id=&amp;quot;value27&amp;quot;&amp;gt;value27&amp;lt;/span&amp;gt; || [[#value26|value26]] == 0xFF || || plan_data_size = value27&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;right&amp;quot; | ?? || ... || || || more data to analyze&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Annexes ==&lt;br /&gt;
&lt;br /&gt;
=== Resolution table ===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;border-collapse: collapse; border-style: dashed; border-color: #2f6fab;&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#f0f0f0&amp;quot; | res_id&lt;br /&gt;
| 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 || 11&lt;br /&gt;
|-&lt;br /&gt;
! bgcolor=&amp;quot;#f0f0f0&amp;quot; | width&lt;br /&gt;
| 640 || 320 || 160 || 704 || 352 || 352 || 176 || 240 || 640 || 704 || 80 || 88&lt;br /&gt;
|-&lt;br /&gt;
! bgcolor=&amp;quot;#f0f0f0&amp;quot; | height&lt;br /&gt;
| 480 || 240 || 120 || 224 || 240 || 288 || 144 || 180 || 240 || 240 || 60 || 72&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Table 1 ===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;border-collapse: collapse; border-style: dashed; border-color: #2f6fab;&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#f0f0f0&amp;quot; | table1_id&lt;br /&gt;
| 0 || 1 || 2 || 3 || 4 || 5 || 6 || default&lt;br /&gt;
|-&lt;br /&gt;
! bgcolor=&amp;quot;#f0f0f0&amp;quot; | counter4&lt;br /&gt;
| 10 || 11 || 12 || 13 || 11 || 13 || 13 || 9&lt;br /&gt;
|-&lt;br /&gt;
! valign=&amp;quot;top&amp;quot; bgcolor=&amp;quot;#f0f0f0&amp;quot; | value19&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
default is used when !([[#ph_flags|ph_flags]] &amp;amp; 0x80)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Undiscovered Video Codecs]]&lt;br /&gt;
[[Category:Video Codecs]]&lt;/div&gt;</summary>
		<author><name>Aurel</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Creative_ADPCM&amp;diff=2236</id>
		<title>Creative ADPCM</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Creative_ADPCM&amp;diff=2236"/>
		<updated>2006-02-14T00:53:23Z</updated>

		<summary type="html">&lt;p&gt;Aurel: confirm it is also used in Creative Voice&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Format tag: 0x200&lt;br /&gt;
* Company: [[Creative]]&lt;br /&gt;
&lt;br /&gt;
This is variation of [[IMA ADPCM]], which is also used in [[Creative Voice]].&lt;br /&gt;
&lt;br /&gt;
== Decoding Process ==&lt;br /&gt;
&lt;br /&gt;
  get new nibble from stream&lt;br /&gt;
  sign = nibble &amp;amp; 8&lt;br /&gt;
  delta = nibble &amp;amp; 7&lt;br /&gt;
  diff = ((2 * delta + 1) * step) / 8&lt;br /&gt;
  if sign &amp;gt; 0&lt;br /&gt;
    newval = (oldval * 254 / 256) - diff&lt;br /&gt;
  else&lt;br /&gt;
    newval = (oldval * 254 / 256) + diff&lt;br /&gt;
  step = (ct_table[delta] * step) &amp;gt;&amp;gt; 8&lt;br /&gt;
  step = clip(step, 511, 32767)&lt;br /&gt;
  newval = clip(newval, -32769, 32767)&lt;br /&gt;
  output newval as 16-bit sample&lt;br /&gt;
&lt;br /&gt;
And here is the table used in step modification:&lt;br /&gt;
&lt;br /&gt;
  const int ct_table[8] = {&lt;br /&gt;
    0x00E6, 0x00E6, 0x00E6, 0x00E6,&lt;br /&gt;
    0x0133, 0x0199, 0x0200, 0x0266&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
[[Category: Audio Codecs]]&lt;/div&gt;</summary>
		<author><name>Aurel</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Creative_8_bits_ADPCM&amp;diff=2234</id>
		<title>Creative 8 bits ADPCM</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Creative_8_bits_ADPCM&amp;diff=2234"/>
		<updated>2006-02-14T00:49:43Z</updated>

		<summary type="html">&lt;p&gt;Aurel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: [[Creative]]&lt;br /&gt;
&lt;br /&gt;
These ADPCM schemes are used in [[Creative_Voice|Creative VOC]] files. The only reference decoder is a hardware one: the Creative Sound Blaster (Pro). So this documentation is not based on reverse engineering. It's based on wild guessing and empirical tests but gives good enough results.&lt;br /&gt;
&lt;br /&gt;
There are three different variation of this codec, which pack samples to either 4, 2.6 or 2 bits. The 2.6 scheme means that every byte is composed of 3 samples of 3 bits for the first and the second and 2 bits for the last.&lt;br /&gt;
&lt;br /&gt;
The three different schemes use the same algorithm with different initial parameters.&lt;br /&gt;
&lt;br /&gt;
=== Initialization ===&lt;br /&gt;
&lt;br /&gt;
The first byte is a raw (not compressed) sample, used as the initial value for prdiction.&lt;br /&gt;
&lt;br /&gt;
step is initialized to 0.&lt;br /&gt;
&lt;br /&gt;
shift is initialized to 2 for 2 bits scheme and to 0 else.&lt;br /&gt;
&lt;br /&gt;
limit is initialized to 5 for 4 bits samples, 3 for 3 bits samples and 1 for 2 bits samples.&lt;br /&gt;
&lt;br /&gt;
=== Decoding ===&lt;br /&gt;
&lt;br /&gt;
Every packed sample is composed of a sign bit (the most significant bit), and a value (the other bits). Let's define sign as 1 when the sign bit is 0 and -1 when the sign bit is 1. Now you can decode a packed sample with the following operation&lt;br /&gt;
 sample = prediction + sign * (value &amp;lt;&amp;lt; (step + shift))&lt;br /&gt;
sample have to be clamped to fit into an unsigned byte.&lt;br /&gt;
&lt;br /&gt;
Then prediction is updated to the new sample value, and step is updated using this algorithm:&lt;br /&gt;
 if (value &amp;gt;= limit)&lt;br /&gt;
   step++;&lt;br /&gt;
 else if (value == 0)&lt;br /&gt;
   step--;&lt;br /&gt;
step must be clamped into the 0..3 range.&lt;br /&gt;
&lt;br /&gt;
[[Category:Audio Codecs]]&lt;/div&gt;</summary>
		<author><name>Aurel</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Creative_Voice&amp;diff=2233</id>
		<title>Creative Voice</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Creative_Voice&amp;diff=2233"/>
		<updated>2006-02-14T00:48:56Z</updated>

		<summary type="html">&lt;p&gt;Aurel: add links to codecs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Extension: voc&lt;br /&gt;
* Company: [[Creative]]&lt;br /&gt;
&lt;br /&gt;
The VOC file format was created by Creative and is generally associated with their 8-bit line of cards (Sound Blaster, Sound Blaster Pro).  While initially limited to unsigned 8-bit PCM and ADPCM data, the VOC format was eventually expanded to handle 16-bit formats with the introduction of Creative's 16-bit cards, as well as a-law and u-law companded formats.&lt;br /&gt;
&lt;br /&gt;
This file format is composed of a file header followed by one or more data block.&lt;br /&gt;
All integers are Little Endian.&lt;br /&gt;
&lt;br /&gt;
== Main header ==&lt;br /&gt;
&lt;br /&gt;
 bytes 0-18   Identifier string containing: Creative Voice File&lt;br /&gt;
 byte  19     0x1A (EOF). This is belived to be used to abort printing of file&lt;br /&gt;
 bytes 20-21  Total size of this main header (usually 0x001A)&lt;br /&gt;
 bytes 22-23  Version number, calculated as (major&amp;lt;&amp;lt;8)|minor&lt;br /&gt;
                major is usually 0x01&lt;br /&gt;
                minor is usually 0x0A or 0x14&lt;br /&gt;
 bytes 24-25  Validity check. This must be equal to ~version + 0x1234&lt;br /&gt;
&lt;br /&gt;
== Data blocks ==&lt;br /&gt;
&lt;br /&gt;
All the different data blocks begin with a common header:&lt;br /&gt;
&lt;br /&gt;
 byte  0      block type&lt;br /&gt;
 bytes 1-3    block size (NOT including this common header)&lt;br /&gt;
&lt;br /&gt;
The data following this common block header depends on the block type.&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x00: Terminator ===&lt;br /&gt;
&lt;br /&gt;
This is a special block type as it's common header don't contain any size field. It indicate the end of the file. It is not mandatory (you can reach EOF without encountering this block type).&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x01: Sound data ===&lt;br /&gt;
&lt;br /&gt;
 byte  0      frequency divisor&lt;br /&gt;
 byte  1      codec id&lt;br /&gt;
 bytes 2..n   the audio data&lt;br /&gt;
&lt;br /&gt;
The sample rate is defined as&lt;br /&gt;
 1000000/(256 - frequency_divisor)&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x02: Sound data continuation ===&lt;br /&gt;
&lt;br /&gt;
 bytes 2..n    the audio data&lt;br /&gt;
&lt;br /&gt;
This block uses the same codec parameters as the previous &amp;quot;Sound data&amp;quot; block.&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x03: Silence ===&lt;br /&gt;
&lt;br /&gt;
 bytes 0-1    length of the silence - 1 (unit is sample)&lt;br /&gt;
 byte  2      frequency divisor&lt;br /&gt;
&lt;br /&gt;
The sample rate is defined as&lt;br /&gt;
 1000000/(256 - frequency_divisor)&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x04: Marker ===&lt;br /&gt;
&lt;br /&gt;
 bytes 0-1    the mark value&lt;br /&gt;
&lt;br /&gt;
This can be used by the software to synchronize the sound with an animation.&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x05: Text ===&lt;br /&gt;
&lt;br /&gt;
 bytes 0..n   zero terminated string&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x06: Repeat start ===&lt;br /&gt;
&lt;br /&gt;
 bytes 0-1    repeat count - 1&lt;br /&gt;
&lt;br /&gt;
The sound data following this block and up to the next Repeat end block is repeated count+1 times.&lt;br /&gt;
When count == 0xFFFF this means endless repetitions.&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x07: Repeat end ===&lt;br /&gt;
&lt;br /&gt;
Empty block which terminate a repeat section.&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x08: Extra info ===&lt;br /&gt;
&lt;br /&gt;
 bytes 0-1    frequency divisor&lt;br /&gt;
 byte  2      codec id&lt;br /&gt;
 byte  3      channels number - 1&lt;br /&gt;
&lt;br /&gt;
The sample rate is defined as&lt;br /&gt;
 256000000/(nb_channels * (65536 - frequency_divisor))&lt;br /&gt;
&lt;br /&gt;
This block must be followed by a &amp;quot;Sound data&amp;quot; block, and it supercedes its codec parameters.&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x09: Sound data (New format) ===&lt;br /&gt;
&lt;br /&gt;
This block type is probably only valid in version 1.20 (0x0114) or greater files.&lt;br /&gt;
&lt;br /&gt;
 bytes 0-3    sample rate&lt;br /&gt;
 byte  4      bits per sample&lt;br /&gt;
 byte  5      channels number&lt;br /&gt;
 bytes 6-7    codec_id&lt;br /&gt;
 bytes 8-11   reserved&lt;br /&gt;
 bytes 12..n  the audio data&lt;br /&gt;
&lt;br /&gt;
== Supported codec ids ==&lt;br /&gt;
&lt;br /&gt;
   0x00  [[PCM|8 bits unsigned PCM]]&lt;br /&gt;
   0x01  [[Creative 8 bits ADPCM|4 bits to 8 bits Creative ADPCM]]&lt;br /&gt;
   0x02  [[Creative 8 bits ADPCM|3 bits to 8 bits Creative ADPCM]] (AKA 2.6 bits)&lt;br /&gt;
   0x03  [[Creative 8 bits ADPCM|2 bits to 8 bits Creative ADPCM]]&lt;br /&gt;
   0x04  [[PCM|16 bits signed PCM]]&lt;br /&gt;
   0x06  [[PCM#Logarithmic PCM|alaw]]&lt;br /&gt;
   0x07  [[PCM#Logarithmic PCM|ulaw]]&lt;br /&gt;
 0x0200  [[Creative ADPCM|4 bits to 16 bits Creative ADPCM]] (only valid in block type 0x09)&lt;br /&gt;
&lt;br /&gt;
[[Category:Container Formats]]&lt;/div&gt;</summary>
		<author><name>Aurel</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Creative_Voice&amp;diff=2154</id>
		<title>Creative Voice</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Creative_Voice&amp;diff=2154"/>
		<updated>2006-02-09T00:03:49Z</updated>

		<summary type="html">&lt;p&gt;Aurel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The VOC file format was created by Creative and is generally associated to their 8bits Sound Blaster Pro sound card.&lt;br /&gt;
This file format is composed of a file header followed by one or more data block.&lt;br /&gt;
All integers are Little Endian.&lt;br /&gt;
&lt;br /&gt;
== Main header ==&lt;br /&gt;
&lt;br /&gt;
 bytes 0-18   Identifier string containing: Creative Voice File&lt;br /&gt;
 byte  19     0x1A (EOF). This is belived to be used to abort printing of file&lt;br /&gt;
 bytes 20-21  Total size of this main header (usually 0x001A)&lt;br /&gt;
 bytes 22-23  Version number, calculated as (major&amp;lt;&amp;lt;8)|minor&lt;br /&gt;
                major is usually 0x01&lt;br /&gt;
                minor is usually 0x0A or 0x14&lt;br /&gt;
 bytes 24-25  Validity check. This must be equal to ~version + 0x1234&lt;br /&gt;
&lt;br /&gt;
== Data blocks ==&lt;br /&gt;
&lt;br /&gt;
All the different data blocks begin with a common header:&lt;br /&gt;
&lt;br /&gt;
 byte  0      block type&lt;br /&gt;
 bytes 1-3    block size (NOT including this common header)&lt;br /&gt;
&lt;br /&gt;
The data following this common block header depends on the block type.&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x00: Terminator ===&lt;br /&gt;
&lt;br /&gt;
This is a special block type as it's common header don't contain any size field. It indicate the end of the file. It is not mandatory (you can reach EOF without encountering this block type).&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x01: Sound data ===&lt;br /&gt;
&lt;br /&gt;
 byte  0      frequency divisor&lt;br /&gt;
 byte  1      codec id&lt;br /&gt;
 bytes 2..n   the audio data&lt;br /&gt;
&lt;br /&gt;
The sample rate is defined as&lt;br /&gt;
 1000000/(256 - frequency_divisor)&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x02: Sound data continuation ===&lt;br /&gt;
&lt;br /&gt;
 bytes 2..n    the audio data&lt;br /&gt;
&lt;br /&gt;
This block uses the same codec parameters as the previous &amp;quot;Sound data&amp;quot; block.&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x03: Silence ===&lt;br /&gt;
&lt;br /&gt;
 bytes 0-1    length of the silence - 1 (unit is sample)&lt;br /&gt;
 byte  2      frequency divisor&lt;br /&gt;
&lt;br /&gt;
The sample rate is defined as&lt;br /&gt;
 1000000/(256 - frequency_divisor)&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x04: Marker ===&lt;br /&gt;
&lt;br /&gt;
 bytes 0-1    the mark value&lt;br /&gt;
&lt;br /&gt;
This can be used by the software to synchronize the sound with an animation.&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x05: Text ===&lt;br /&gt;
&lt;br /&gt;
 bytes 0..n   zero terminated string&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x06: Repeat start ===&lt;br /&gt;
&lt;br /&gt;
 bytes 0-1    repeat count - 1&lt;br /&gt;
&lt;br /&gt;
The sound data following this block and up to the next Repeat end block is repeated count+1 times.&lt;br /&gt;
When count == 0xFFFF this means endless repetitions.&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x07: Repeat end ===&lt;br /&gt;
&lt;br /&gt;
Empty block which terminate a repeat section.&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x08: Extra info ===&lt;br /&gt;
&lt;br /&gt;
 bytes 0-1    frequency divisor&lt;br /&gt;
 byte  2      codec id&lt;br /&gt;
 byte  3      channels number - 1&lt;br /&gt;
&lt;br /&gt;
The sample rate is defined as&lt;br /&gt;
 256000000/(nb_channels * (65536 - frequency_divisor))&lt;br /&gt;
&lt;br /&gt;
This block must be followed by a &amp;quot;Sound data&amp;quot; block, and it super-seeds its codec parameters.&lt;br /&gt;
&lt;br /&gt;
=== Block type 0x09: Sound data (New format) ===&lt;br /&gt;
&lt;br /&gt;
This block type is probably only valid in version 1.20 (0x0114) or greater files.&lt;br /&gt;
&lt;br /&gt;
 bytes 0-3    sample rate&lt;br /&gt;
 byte  4      bits per sample&lt;br /&gt;
 byte  5      channels number&lt;br /&gt;
 bytes 6-7    codec_id&lt;br /&gt;
 bytes 8-11   reserved&lt;br /&gt;
 bytes 12..n  the audio data&lt;br /&gt;
&lt;br /&gt;
== Supported codec ids ==&lt;br /&gt;
&lt;br /&gt;
   0x00  8 bits unsigned PCM&lt;br /&gt;
   0x01  4 bits to 8 bits Creative ADPCM&lt;br /&gt;
   0x02  3 bits to 8 bits Creative ADPCM (AKA 2.6 bits)&lt;br /&gt;
   0x03  2 bits to 8 bits Creative ADPCM&lt;br /&gt;
   0x04  16 bits signed PCM&lt;br /&gt;
   0x06  alaw&lt;br /&gt;
   0x07  ulaw&lt;br /&gt;
 0x0200  4 bits to 16 bits Creative ADPCM (only valid in block type 0x09)&lt;/div&gt;</summary>
		<author><name>Aurel</name></author>
	</entry>
</feed>