Based on code by DivX, Inc., heavily changed by Björn Axelsson [gecko acc.umu.se] and me. Originally committed as revision 19222 to svn://svn.ffmpeg.org/ffmpeg/trunk