Code produced during SoC by Robert Swain and Colin McQuillan. Originally committed as revision 21943 to svn://svn.ffmpeg.org/ffmpeg/trunk