[SCM] ffmpeg/ubuntu.extra: remove all sources from branch and rely on libav-source package instead

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Mar 20 11:42:50 UTC 2011


The following commit has been merged in the ubuntu.extra branch:
commit 47af600b192e75b4f5aaf20b872d1cc13d2df76f
Author: Reinhard Tartler <siretart at tauware.de>
Date:   Sun Mar 20 11:29:19 2011 +0100

    remove all sources from branch and rely on libav-source package instead

diff --git a/.gitignore b/.gitignore
index 4ce575b..b408e6c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,46 +1 @@
 /.pc
-.config
-.version
-*.o
-*.d
-*.exe
-*.ho
-*-example
-*-test
-*_g
-config.*
-doc/*.1
-doc/*.html
-doc/*.pod
-doxy
-ffmpeg
-ffplay
-ffprobe
-ffserver
-libavcodec/libavcodec*
-libavcore/libavcore*
-libavdevice/libavdevice*
-libavfilter/libavfilter*
-libavformat/libavformat*
-libavutil/avconfig.h
-libavutil/libavutil*
-libpostproc/libpostproc*
-libswscale/libswscale*
-tests/audiogen
-tests/base64
-tests/data
-tests/rotozoom
-tests/seek_test
-tests/tiny_psnr
-tests/videogen
-tests/vsynth1
-tests/vsynth2
-tools/cws2fws
-tools/graph2dot
-tools/lavfi-showfiltfmts
-tools/pktdumper
-tools/probetest
-tools/qt-faststart
-tools/trasher
-tools/trasher*.d
-version.h
diff --git a/COPYING.GPLv2 b/COPYING.GPLv2
deleted file mode 100644
index d159169..0000000
--- a/COPYING.GPLv2
+++ /dev/null
@@ -1,339 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-                            NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License along
-    with this program; if not, write to the Free Software Foundation, Inc.,
-    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/COPYING.GPLv3 b/COPYING.GPLv3
deleted file mode 100644
index 94a9ed0..0000000
--- a/COPYING.GPLv3
+++ /dev/null
@@ -1,674 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/COPYING.LGPLv2.1 b/COPYING.LGPLv2.1
deleted file mode 100644
index 00b4fed..0000000
--- a/COPYING.LGPLv2.1
+++ /dev/null
@@ -1,504 +0,0 @@
-                  GNU LESSER GENERAL PUBLIC LICENSE
-                       Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL.  It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-                            Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
-  This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it.  You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
-  When we speak of free software, we are referring to freedom of use,
-not price.  Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
-  To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights.  These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
-  For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you.  You must make sure that they, too, receive or can get the source
-code.  If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it.  And you must show them these terms so they know their rights.
-
-  We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  To protect each distributor, we want to make it very clear that
-there is no warranty for the free library.  Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
-  Finally, software patents pose a constant threat to the existence of
-any free program.  We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder.  Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
-  Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License.  This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License.  We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
-  When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library.  The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom.  The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
-  We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License.  It also provides other free software developers Less
-of an advantage over competing non-free programs.  These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries.  However, the Lesser license provides advantages in certain
-special circumstances.
-
-  For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard.  To achieve this, non-free programs must be
-allowed to use the library.  A more frequent case is that a free
-library does the same job as widely used non-free libraries.  In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
-  In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software.  For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
-  Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.  Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library".  The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
-                  GNU LESSER GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
-  A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
-  The "Library", below, refers to any such software library or work
-which has been distributed under these terms.  A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language.  (Hereinafter, translation is
-included without limitation in the term "modification".)
-
-  "Source code" for a work means the preferred form of the work for
-making modifications to it.  For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
-  Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it).  Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
-  1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
-  You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
-  2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) The modified work must itself be a software library.
-
-    b) You must cause the files modified to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    c) You must cause the whole of the work to be licensed at no
-    charge to all third parties under the terms of this License.
-
-    d) If a facility in the modified Library refers to a function or a
-    table of data to be supplied by an application program that uses
-    the facility, other than as an argument passed when the facility
-    is invoked, then you must make a good faith effort to ensure that,
-    in the event an application does not supply such function or
-    table, the facility still operates, and performs whatever part of
-    its purpose remains meaningful.
-
-    (For example, a function in a library to compute square roots has
-    a purpose that is entirely well-defined independent of the
-    application.  Therefore, Subsection 2d requires that any
-    application-supplied function or table used by this function must
-    be optional: if the application does not supply it, the square
-    root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library.  To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License.  (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.)  Do not make any other change in
-these notices.
-
-  Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
-  This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
-  4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
-  If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library".  Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
-  However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library".  The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
-  When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library.  The
-threshold for this to be true is not precisely defined by law.
-
-  If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work.  (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
-  Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
-  6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
-  You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License.  You must supply a copy of this License.  If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License.  Also, you must do one
-of these things:
-
-    a) Accompany the work with the complete corresponding
-    machine-readable source code for the Library including whatever
-    changes were used in the work (which must be distributed under
-    Sections 1 and 2 above); and, if the work is an executable linked
-    with the Library, with the complete machine-readable "work that
-    uses the Library", as object code and/or source code, so that the
-    user can modify the Library and then relink to produce a modified
-    executable containing the modified Library.  (It is understood
-    that the user who changes the contents of definitions files in the
-    Library will not necessarily be able to recompile the application
-    to use the modified definitions.)
-
-    b) Use a suitable shared library mechanism for linking with the
-    Library.  A suitable mechanism is one that (1) uses at run time a
-    copy of the library already present on the user's computer system,
-    rather than copying library functions into the executable, and (2)
-    will operate properly with a modified version of the library, if
-    the user installs one, as long as the modified version is
-    interface-compatible with the version that the work was made with.
-
-    c) Accompany the work with a written offer, valid for at
-    least three years, to give the same user the materials
-    specified in Subsection 6a, above, for a charge no more
-    than the cost of performing this distribution.
-
-    d) If distribution of the work is made by offering access to copy
-    from a designated place, offer equivalent access to copy the above
-    specified materials from the same place.
-
-    e) Verify that the user has already received a copy of these
-    materials or that you have already sent this user a copy.
-
-  For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it.  However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
-  It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system.  Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
-  7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
-    a) Accompany the combined library with a copy of the same work
-    based on the Library, uncombined with any other library
-    facilities.  This must be distributed under the terms of the
-    Sections above.
-
-    b) Give prominent notice with the combined library of the fact
-    that part of it is a work based on the Library, and explaining
-    where to find the accompanying uncombined form of the same work.
-
-  8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License.  Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License.  However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-  9. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Library or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
-  10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
-  11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded.  In such case, this License incorporates the limitation as if
-written in the body of this License.
-
-  13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation.  If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
-  14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission.  For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this.  Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
-                            NO WARRANTY
-
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-                     END OF TERMS AND CONDITIONS
-
-           How to Apply These Terms to Your New Libraries
-
-  If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.  It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the library's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
-  <signature of Ty Coon>, 1 April 1990
-  Ty Coon, President of Vice
-
-That's all there is to it!
-
-
diff --git a/COPYING.LGPLv3 b/COPYING.LGPLv3
deleted file mode 100644
index 65c5ca8..0000000
--- a/COPYING.LGPLv3
+++ /dev/null
@@ -1,165 +0,0 @@
-                   GNU LESSER GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
-  This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
-  0. Additional Definitions.
-
-  As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
-  "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
-  An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
-  A "Combined Work" is a work produced by combining or linking an
-Application with the Library.  The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
-  The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
-  The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
-  1. Exception to Section 3 of the GNU GPL.
-
-  You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
-  2. Conveying Modified Versions.
-
-  If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
-   a) under this License, provided that you make a good faith effort to
-   ensure that, in the event an Application does not supply the
-   function or data, the facility still operates, and performs
-   whatever part of its purpose remains meaningful, or
-
-   b) under the GNU GPL, with none of the additional permissions of
-   this License applicable to that copy.
-
-  3. Object Code Incorporating Material from Library Header Files.
-
-  The object code form of an Application may incorporate material from
-a header file that is part of the Library.  You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
-   a) Give prominent notice with each copy of the object code that the
-   Library is used in it and that the Library and its use are
-   covered by this License.
-
-   b) Accompany the object code with a copy of the GNU GPL and this license
-   document.
-
-  4. Combined Works.
-
-  You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
-   a) Give prominent notice with each copy of the Combined Work that
-   the Library is used in it and that the Library and its use are
-   covered by this License.
-
-   b) Accompany the Combined Work with a copy of the GNU GPL and this license
-   document.
-
-   c) For a Combined Work that displays copyright notices during
-   execution, include the copyright notice for the Library among
-   these notices, as well as a reference directing the user to the
-   copies of the GNU GPL and this license document.
-
-   d) Do one of the following:
-
-       0) Convey the Minimal Corresponding Source under the terms of this
-       License, and the Corresponding Application Code in a form
-       suitable for, and under terms that permit, the user to
-       recombine or relink the Application with a modified version of
-       the Linked Version to produce a modified Combined Work, in the
-       manner specified by section 6 of the GNU GPL for conveying
-       Corresponding Source.
-
-       1) Use a suitable shared library mechanism for linking with the
-       Library.  A suitable mechanism is one that (a) uses at run time
-       a copy of the Library already present on the user's computer
-       system, and (b) will operate properly with a modified version
-       of the Library that is interface-compatible with the Linked
-       Version.
-
-   e) Provide Installation Information, but only if you would otherwise
-   be required to provide such information under section 6 of the
-   GNU GPL, and only to the extent that such information is
-   necessary to install and execute a modified version of the
-   Combined Work produced by recombining or relinking the
-   Application with a modified version of the Linked Version. (If
-   you use option 4d0, the Installation Information must accompany
-   the Minimal Corresponding Source and Corresponding Application
-   Code. If you use option 4d1, you must provide the Installation
-   Information in the manner specified by section 6 of the GNU GPL
-   for conveying Corresponding Source.)
-
-  5. Combined Libraries.
-
-  You may place library facilities that are a work based on the
-Library side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
-   a) Accompany the combined library with a copy of the same work based
-   on the Library, uncombined with any other library facilities,
-   conveyed under the terms of this License.
-
-   b) Give prominent notice with the combined library that part of it
-   is a work based on the Library, and explaining where to find the
-   accompanying uncombined form of the same work.
-
-  6. Revised Versions of the GNU Lesser General Public License.
-
-  The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
-  Each version is given a distinguishing version number. If the
-Library as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
-  If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library.
diff --git a/CREDITS b/CREDITS
deleted file mode 100644
index 4a53778..0000000
--- a/CREDITS
+++ /dev/null
@@ -1,55 +0,0 @@
-This file contains the names of some of the people who have contributed to
-Libav/FFmpeg. The names are sorted alphabetically by last name.  As this file is
-currently quite outdated and git serves as a much better tool for determining
-authorship, it remains here for historical reasons only.
-
-Dénes Balatoni
-Michel Bardiaux
-Fabrice Bellard
-Patrice Bensoussan
-Alex Beregszaszi
-BERO
-Thilo Borgmann
-Mario Brito
-Ronald Bultje
-Alex Converse
-Maarten Daniels
-Reimar Doeffinger
-Tim Ferguson
-Brian Foley
-Arpad Gereoffy
-Philip Gladstone
-Vladimir Gneushev
-Roine Gustafsson
-David Hammerton
-Wolfgang Hesseler
-Marc Hoffman
-Falk Hueffner
-Aurélien Jacobs
-Steven Johnson
-Zdenek Kabelac
-Robin Kay
-Todd Kirby
-Nick Kurshev
-Benjamin Larsson
-Loïc Le Loarer
-Daniel Maas
-Mike Melanson
-Loren Merritt
-Jeff Muizelaar
-Michael Niedermayer
-François Revol
-Peter Ross
-Måns Rullgård
-Stefano Sabatini
-Roman Shaposhnik
-Oded Shimon
-Dieter Shirley
-Konstantin Shishkov
-Juan J. Sierralta
-Ewald Snel
-Sascha Sommer
-Leon van Stuivenberg
-Roberto Togni
-Lionel Ulmer
-Reynaldo Verdejo
diff --git a/Changelog b/Changelog
deleted file mode 100644
index 2e0a99c..0000000
--- a/Changelog
+++ /dev/null
@@ -1,614 +0,0 @@
-Entries are sorted chronologically from oldest to youngest within each release,
-releases are sorted from youngest to oldest.
-
-version 0.6.2:
-
-- Fix invalid reads in VC-1 decoding (related to CVE-2011-0723)
-- Do not attempt to decode APE file with no frames
-  (adresses http://packetstorm.linuxsecurity.com/1103-exploits/vlc105-dos.txt)
-
-
-version 0.6.1:
-
-- fix autodetection of E-AC-3 substream samples
-- performance fix for seekable HTTP
-- backport AAC-HE v2 from trunk
-- add missing VP80 fourcc code for the VP8 codec
-- small documentation fixes
-- fix several potentially exploitable issues in the FLIC decoder
-  (addresses CVE-2010-3429)
-
-
-version 0.6:
-
-- PB-frame decoding for H.263
-- deprecated vhook subsystem removed
-- deprecated old scaler removed
-- VQF demuxer
-- alpha channel scaler
-- PCX encoder
-- RTP packetization of H.263
-- RTP packetization of AMR
-- RTP depacketization of Vorbis
-- CorePNG decoding support
-- Cook multichannel decoding support
-- introduced avlanguage helpers in libavformat
-- 8088flex TMV demuxer and decoder
-- per-stream language-tags extraction in asfdec
-- V210 decoder and encoder
-- remaining GPL parts in AC-3 decoder converted to LGPL
-- QCP demuxer
-- SoX native format muxer and demuxer
-- AMR-NB decoding/encoding, AMR-WB decoding via OpenCORE libraries
-- DPX image decoder
-- Electronic Arts Madcow decoder
-- DivX (XSUB) subtitle encoder
-- nonfree libamr support for AMR-NB/WB decoding/encoding removed
-- experimental AAC encoder
-- RTP depacketization of ASF and RTSP from WMS servers
-- RTMP support in libavformat
-- noX handling for OPT_BOOL X options
-- Wave64 demuxer
-- IEC-61937 compatible Muxer
-- TwinVQ decoder
-- Bluray (PGS) subtitle decoder
-- LPCM support in MPEG-TS (HDMV RID as found on Blu-ray disks)
-- WMA Pro decoder
-- Core Audio Format demuxer
-- Atrac1 decoder
-- MD STUDIO audio demuxer
-- RF64 support in WAV demuxer
-- MPEG-4 Audio Lossless Coding (ALS) decoder
-- -formats option split into -formats, -codecs, -bsfs, and -protocols
-- IV8 demuxer
-- CDG demuxer and decoder
-- R210 decoder
-- Auravision Aura 1 and 2 decoders
-- Deluxe Paint Animation playback system
-- SIPR decoder
-- Adobe Filmstrip muxer and demuxer
-- RTP depacketization of H.263
-- Bink demuxer and audio/video decoders
-- enable symbol versioning by default for linkers that support it
-- IFF PBM/ILBM bitmap decoder
-- concat protocol
-- Indeo 5 decoder
-- RTP depacketization of AMR
-- WMA Voice decoder
-- ffprobe tool
-- AMR-NB decoder
-- RTSP muxer
-- HE-AAC v1 decoder
-- Kega Game Video (KGV1) decoder
-- VorbisComment writing for FLAC, Ogg FLAC and Ogg Speex files
-- RTP depacketization of Theora
-- HTTP Digest authentication
-- RTMP/RTMPT/RTMPS/RTMPE/RTMPTE protocol support via librtmp
-- Psygnosis YOP demuxer and video decoder
-- spectral extension support in the E-AC-3 decoder
-- unsharp video filter
-- RTP hinting in the mov/3gp/mp4 muxer
-- Dirac in Ogg demuxing
-- seek to keyframes in Ogg
-- 4:2:2 and 4:4:4 Theora decoding
-- 35% faster VP3/Theora decoding
-- faster AAC decoding
-- faster H.264 decoding
-- WebM support in Matroska de/muxer
-- low overhead Ogg muxing
-- VP8 de/encoding via libvpx
-- CODEC_CAP_EXPERIMENTAL added
-
-
-
-version 0.5:
-
-- DV50 AKA DVCPRO50 encoder, decoder, muxer and demuxer
-- TechSmith Camtasia (TSCC) video decoder
-- IBM Ultimotion (ULTI) video decoder
-- Sierra Online audio file demuxer and decoder
-- Apple QuickDraw (qdrw) video decoder
-- Creative ADPCM audio decoder (16 bits as well as 8 bits schemes)
-- Electronic Arts Multimedia (WVE/UV2/etc.) file demuxer
-- Miro VideoXL (VIXL) video decoder
-- H.261 video encoder
-- QPEG video decoder
-- Nullsoft Video (NSV) file demuxer
-- Shorten audio decoder
-- LOCO video decoder
-- Apple Lossless Audio Codec (ALAC) decoder
-- Winnov WNV1 video decoder
-- Autodesk Animator Studio Codec (AASC) decoder
-- Indeo 2 video decoder
-- Fraps FPS1 video decoder
-- Snow video encoder/decoder
-- Sonic audio encoder/decoder
-- Vorbis audio decoder
-- Macromedia ADPCM decoder
-- Duck TrueMotion 2 video decoder
-- support for decoding FLX and DTA extensions in FLIC files
-- H.264 custom quantization matrices support
-- ffserver fixed, it should now be usable again
-- QDM2 audio decoder
-- Real Cooker audio decoder
-- TrueSpeech audio decoder
-- WMA2 audio decoder fixed, now all files should play correctly
-- RealAudio 14.4 and 28.8 decoders fixed
-- JPEG-LS decoder
-- build system improvements
-- tabs and trailing whitespace removed from the codebase
-- CamStudio video decoder
-- AIFF/AIFF-C audio format, encoding and decoding
-- ADTS AAC file reading and writing
-- Creative VOC file reading and writing
-- American Laser Games multimedia (*.mm) playback system
-- Zip Motion Blocks Video decoder
-- improved Theora/VP3 decoder
-- True Audio (TTA) decoder
-- AVS demuxer and video decoder
-- JPEG-LS encoder
-- Smacker demuxer and decoder
-- NuppelVideo/MythTV demuxer and RTjpeg decoder
-- KMVC decoder
-- MPEG-2 intra VLC support
-- MPEG-2 4:2:2 encoder
-- Flash Screen Video decoder
-- GXF demuxer
-- Chinese AVS decoder
-- GXF muxer
-- MXF demuxer
-- VC-1/WMV3/WMV9 video decoder
-- MacIntel support
-- AVISynth support
-- VMware video decoder
-- VP5 video decoder
-- VP6 video decoder
-- WavPack lossless audio decoder
-- Targa (.TGA) picture decoder
-- Vorbis audio encoder
-- Delphine Software .cin demuxer/audio and video decoder
-- Tiertex .seq demuxer/video decoder
-- MTV demuxer
-- TIFF picture encoder and decoder
-- GIF picture decoder
-- Intel Music Coder decoder
-- Zip Motion Blocks Video encoder
-- Musepack decoder
-- Flash Screen Video encoder
-- Theora encoding via libtheora
-- BMP encoder
-- WMA encoder
-- GSM-MS encoder and decoder
-- DCA decoder
-- DXA demuxer and decoder
-- DNxHD decoder
-- Gamecube movie (.THP) playback system
-- Blackfin optimizations
-- Interplay C93 demuxer and video decoder
-- Bethsoft VID demuxer and video decoder
-- CRYO APC demuxer
-- Atrac3 decoder
-- V.Flash PTX decoder
-- RoQ muxer, RoQ audio encoder
-- Renderware TXD demuxer and decoder
-- extern C declarations for C++ removed from headers
-- sws_flags command line option
-- codebook generator
-- RoQ video encoder
-- QTRLE encoder
-- OS/2 support removed and restored again
-- AC-3 decoder
-- NUT muxer
-- additional SPARC (VIS) optimizations
-- Matroska muxer
-- slice-based parallel H.264 decoding
-- Monkey's Audio demuxer and decoder
-- AMV audio and video decoder
-- DNxHD encoder
-- H.264 PAFF decoding
-- Nellymoser ASAO decoder
-- Beam Software SIFF demuxer and decoder
-- libvorbis Vorbis decoding removed in favor of native decoder
-- IntraX8 (J-Frame) subdecoder for WMV2 and VC-1
-- Ogg (Theora, Vorbis and FLAC) muxer
-- The "device" muxers and demuxers are now in a new libavdevice library
-- PC Paintbrush PCX decoder
-- Sun Rasterfile decoder
-- TechnoTrend PVA demuxer
-- Linux Media Labs MPEG-4 (LMLM4) demuxer
-- AVM2 (Flash 9) SWF muxer
-- QT variant of IMA ADPCM encoder
-- VFW grabber
-- iPod/iPhone compatible mp4 muxer
-- Mimic decoder
-- MSN TCP Webcam stream demuxer
-- RL2 demuxer / decoder
-- IFF demuxer
-- 8SVX audio decoder
-- non-recursive Makefiles
-- BFI demuxer
-- MAXIS EA XA (.xa) demuxer / decoder
-- BFI video decoder
-- OMA demuxer
-- MLP/TrueHD decoder
-- Electronic Arts CMV decoder
-- Motion Pixels Video decoder
-- Motion Pixels MVI demuxer
-- removed animated GIF decoder/demuxer
-- D-Cinema audio muxer
-- Electronic Arts TGV decoder
-- Apple Lossless Audio Codec (ALAC) encoder
-- AAC decoder
-- floating point PCM encoder/decoder
-- MXF muxer
-- DV100 AKA DVCPRO HD decoder and demuxer
-- E-AC-3 support added to AC-3 decoder
-- Nellymoser ASAO encoder
-- ASS and SSA demuxer and muxer
-- liba52 wrapper removed
-- SVQ3 watermark decoding support
-- Speex decoding via libspeex
-- Electronic Arts TGQ decoder
-- RV40 decoder
-- QCELP / PureVoice decoder
-- RV30 decoder
-- hybrid WavPack support
-- R3D REDCODE demuxer
-- ALSA support for playback and record
-- Electronic Arts TQI decoder
-- OpenJPEG based JPEG 2000 decoder
-- NC (NC4600) camera file demuxer
-- Gopher client support
-- MXF D-10 muxer
-- generic metadata API
-
-
-
-version 0.4.9-pre1:
-
-- DV encoder, DV muxer
-- Microsoft RLE video decoder
-- Microsoft Video-1 decoder
-- Apple Animation (RLE) decoder
-- Apple Graphics (SMC) decoder
-- Apple Video (RPZA) decoder
-- Cinepak decoder
-- Sega FILM (CPK) file demuxer
-- Westwood multimedia support (VQA & AUD files)
-- Id Quake II CIN playback support
-- 8BPS video decoder
-- FLIC playback support
-- RealVideo 2.0 (RV20) decoder
-- Duck TrueMotion v1 (DUCK) video decoder
-- Sierra VMD demuxer and video decoder
-- MSZH and ZLIB decoder support
-- SVQ1 video encoder
-- AMR-WB support
-- PPC optimizations
-- rate distortion optimal cbp support
-- rate distorted optimal ac prediction for MPEG-4
-- rate distorted optimal lambda->qp support
-- AAC encoding with libfaac
-- Sunplus JPEG codec (SP5X) support
-- use Lagrange multipler instead of QP for ratecontrol
-- Theora/VP3 decoding support
-- XA and ADX ADPCM codecs
-- export MPEG-2 active display area / pan scan
-- Add support for configuring with IBM XLC
-- floating point AAN DCT
-- initial support for zygo video (not complete)
-- RGB ffv1 support
-- new audio/video parser API
-- av_log() system
-- av_read_frame() and av_seek_frame() support
-- missing last frame fixes
-- seek by mouse in ffplay
-- noise reduction of DCT coefficients
-- H.263 OBMC & 4MV support
-- H.263 alternative inter vlc support
-- H.263 loop filter
-- H.263 slice structured mode
-- interlaced DCT support for MPEG-2 encoding
-- stuffing to stay above min_bitrate
-- MB type & QP visualization
-- frame stepping for ffplay
-- interlaced motion estimation
-- alternate scantable support
-- SVCD scan offset support
-- closed GOP support
-- SSE2 FDCT
-- quantizer noise shaping
-- G.726 ADPCM audio codec
-- MS ADPCM encoding
-- multithreaded/SMP motion estimation
-- multithreaded/SMP encoding for MPEG-1/MPEG-2/MPEG-4/H.263
-- multithreaded/SMP decoding for MPEG-2
-- FLAC decoder
-- Metrowerks CodeWarrior suppport
-- H.263+ custom pcf support
-- nicer output for 'ffmpeg -formats'
-- Matroska demuxer
-- SGI image format, encoding and decoding
-- H.264 loop filter support
-- H.264 CABAC support
-- nicer looking arrows for the motion vector visualization
-- improved VCD support
-- audio timestamp drift compensation
-- MPEG-2 YUV 422/444 support
-- polyphase kaiser windowed sinc and blackman nuttall windowed sinc audio resample
-- better image scaling
-- H.261 support
-- correctly interleave packets during encoding
-- VIS optimized motion compensation
-- intra_dc_precision>0 encoding support
-- support reuse of motion vectors/MB types/field select values of the source video
-- more accurate deblock filter
-- padding support
-- many optimizations and bugfixes
-- FunCom ISS audio file demuxer and according ADPCM decoding
-
-
-
-version 0.4.8:
-
-- MPEG-2 video encoding (Michael)
-- Id RoQ playback subsystem (Mike Melanson and Tim Ferguson)
-- Wing Commander III Movie (.mve) file playback subsystem (Mike Melanson
-  and Mario Brito)
-- Xan DPCM audio decoder (Mario Brito)
-- Interplay MVE playback subsystem (Mike Melanson)
-- Duck DK3 and DK4 ADPCM audio decoders (Mike Melanson)
-
-
-
-version 0.4.7:
-
-- RealAudio 1.0 (14_4) and 2.0 (28_8) native decoders. Author unknown, code from mplayerhq
-  (originally from public domain player for Amiga at http://www.honeypot.net/audio)
-- current version now also compiles with older GCC (Fabrice)
-- 4X multimedia playback system including 4xm file demuxer (Mike
-  Melanson), and 4X video and audio codecs (Michael)
-- Creative YUV (CYUV) decoder (Mike Melanson)
-- FFV1 codec (our very simple lossless intra only codec, compresses much better
-  than HuffYUV) (Michael)
-- ASV1 (Asus), H.264, Intel indeo3 codecs have been added (various)
-- tiny PNG encoder and decoder, tiny GIF decoder, PAM decoder (PPM with
-  alpha support), JPEG YUV colorspace support. (Fabrice Bellard)
-- ffplay has been replaced with a newer version which uses SDL (optionally)
-  for multiplatform support (Fabrice)
-- Sorenson Version 3 codec (SVQ3) support has been added (decoding only) - donated
-  by anonymous
-- AMR format has been added (Johannes Carlsson)
-- 3GP support has been added (Johannes Carlsson)
-- VP3 codec has been added (Mike Melanson)
-- more MPEG-1/2 fixes
-- better multiplatform support, MS Visual Studio fixes (various)
-- AltiVec optimizations (Magnus Damn and others)
-- SH4 processor support has been added (BERO)
-- new public interfaces (avcodec_get_pix_fmt) (Roman Shaposhnick)
-- VOB streaming support (Brian Foley)
-- better MP3 autodetection (Andriy Rysin)
-- qpel encoding (Michael)
-- 4mv+b frames encoding finally fixed (Michael)
-- chroma ME (Michael)
-- 5 comparison functions for ME (Michael)
-- B-frame encoding speedup (Michael)
-- WMV2 codec (unfinished - Michael)
-- user specified diamond size for EPZS (Michael)
-- Playstation STR playback subsystem, still experimental (Mike and Michael)
-- ASV2 codec (Michael)
-- CLJR decoder (Alex)
-
-.. And lots more new enhancements and fixes.
-
-
-
-version 0.4.6:
-
-- completely new integer only MPEG audio layer 1/2/3 decoder rewritten
-  from scratch
-- Recoded DCT and motion vector search with gcc (no longer depends on nasm)
-- fix quantization bug in AC3 encoder
-- added PCM codecs and format. Corrected WAV/AVI/ASF PCM issues
-- added prototype ffplay program
-- added GOB header parsing on H.263/H.263+ decoder (Juanjo)
-- bug fix on MCBPC tables of H.263 (Juanjo)
-- bug fix on DC coefficients of H.263 (Juanjo)
-- added Advanced Prediction Mode on H.263/H.263+ decoder (Juanjo)
-- now we can decode H.263 streams found in QuickTime files (Juanjo)
-- now we can decode H.263 streams found in VIVO v1 files(Juanjo)
-- preliminary RTP "friendly" mode for H.263/H.263+ coding. (Juanjo)
-- added GOB header for H.263/H.263+ coding on RTP mode (Juanjo)
-- now H.263 picture size is returned on the first decoded frame (Juanjo)
-- added first regression tests
-- added MPEG-2 TS demuxer
-- new demux API for libav
-- more accurate and faster IDCT (Michael)
-- faster and entropy-controlled motion search (Michael)
-- two pass video encoding (Michael)
-- new video rate control (Michael)
-- added MSMPEG4V1, MSMPEGV2 and WMV1 support (Michael)
-- great performance improvement of video encoders and decoders (Michael)
-- new and faster bit readers and vlc parsers (Michael)
-- high quality encoding mode: tries all macroblock/VLC types (Michael)
-- added DV video decoder
-- preliminary RTP/RTSP support in ffserver and libavformat
-- H.263+ AIC decoding/encoding support (Juanjo)
-- VCD MPEG-PS mode (Juanjo)
-- PSNR stuff (Juanjo)
-- simple stats output (Juanjo)
-- 16-bit and 15-bit RGB/BGR/GBR support (Bisqwit)
-
-
-
-version 0.4.5:
-
-- some header fixes (Zdenek Kabelac <kabi at informatics.muni.cz>)
-- many MMX optimizations (Nick Kurshev <nickols_k at mail.ru>)
-- added configure system (actually a small shell script)
-- added MPEG audio layer 1/2/3 decoding using LGPL'ed mpglib by
-  Michael Hipp (temporary solution - waiting for integer only
-  decoder)
-- fixed VIDIOCSYNC interrupt
-- added Intel H.263 decoding support ('I263' AVI fourCC)
-- added Real Video 1.0 decoding (needs further testing)
-- simplified image formats again. Added PGM format (=grey
-  pgm). Renamed old PGM to PGMYUV.
-- fixed msmpeg4 slice issues (tell me if you still find problems)
-- fixed OpenDivX bugs with newer versions (added VOL header decoding)
-- added support for MPlayer interface
-- added macroblock skip optimization
-- added MJPEG decoder
-- added mmx/mmxext IDCT from libmpeg2
-- added pgmyuvpipe, ppm, and ppm_pipe formats (original patch by Celer
-  <celer at shell.scrypt.net>)
-- added pixel format conversion layer (e.g. for MJPEG or PPM)
-- added deinterlacing option
-- MPEG-1/2 fixes
-- MPEG-4 vol header fixes (Jonathan Marsden <snmjbm at pacbell.net>)
-- ARM optimizations (Lionel Ulmer <lionel.ulmer at free.fr>).
-- Windows porting of file converter
-- added MJPEG raw format (input/ouput)
-- added JPEG image format support (input/output)
-
-
-
-version 0.4.4:
-
-- fixed some std header definitions (Bjorn Lindgren
-  <bjorn.e.lindgren at telia.com>).
-- added MPEG demuxer (MPEG-1 and 2 compatible).
-- added ASF demuxer
-- added prototype RM demuxer
-- added AC3 decoding (done with libac3 by Aaron Holtzman)
-- added decoding codec parameter guessing (.e.g. for MPEG, because the
-  header does not include them)
-- fixed header generation in MPEG-1, AVI and ASF muxer: wmplayer can now
-  play them (only tested video)
-- fixed H.263 white bug
-- fixed phase rounding in img resample filter
-- add MMX code for polyphase img resample filter
-- added CPU autodetection
-- added generic title/author/copyright/comment string handling (ASF and RM
-  use them)
-- added SWF demux to extract MP3 track (not usable yet because no MP3
-  decoder)
-- added fractional frame rate support
-- codecs are no longer searched by read_header() (should fix ffserver
-  segfault)
-
-
-
-version 0.4.3:
-
-- BGR24 patch (initial patch by Jeroen Vreeken <pe1rxq at amsat.org>)
-- fixed raw yuv output
-- added motion rounding support in MPEG-4
-- fixed motion bug rounding in MSMPEG4
-- added B-frame handling in video core
-- added full MPEG-1 decoding support
-- added partial (frame only) MPEG-2 support
-- changed the FOURCC code for H.263 to "U263" to be able to see the
-  +AVI/H.263 file with the UB Video H.263+ decoder. MPlayer works with
-  this +codec ;) (JuanJo).
-- Halfpel motion estimation after MB type selection (JuanJo)
-- added pgm and .Y.U.V output format
-- suppressed 'img:' protocol. Simply use: /tmp/test%d.[pgm|Y] as input or
-  output.
-- added pgmpipe I/O format (original patch from Martin Aumueller
-  <lists at reserv.at>, but changed completely since we use a format
-  instead of a protocol)
-
-
-
-version 0.4.2:
-
-- added H.263/MPEG-4/MSMPEG4 decoding support. MPEG-4 decoding support
-  (for OpenDivX) is almost complete: 8x8 MVs and rounding are
-  missing. MSMPEG4 support is complete.
-- added prototype MPEG-1 decoder. Only I- and P-frames handled yet (it
-  can decode ffmpeg MPEGs :-)).
-- added libavcodec API documentation (see apiexample.c).
-- fixed image polyphase bug (the bottom of some images could be
-  greenish)
-- added support for non clipped motion vectors (decoding only)
-  and image sizes non-multiple of 16
-- added support for AC prediction (decoding only)
-- added file overwrite confirmation (can be disabled with -y)
-- added custom size picture to H.263 using H.263+ (Juanjo)
-
-
-version 0.4.1:
-
-- added MSMPEG4 (aka DivX) compatible encoder. Changed default codec
-  of AVI and ASF to DIV3.
-- added -me option to set motion estimation method
-  (default=log). suppressed redundant -hq option.
-- added options -acodec and -vcodec to force a given codec (useful for
-  AVI for example)
-- fixed -an option
-- improved dct_quantize speed
-- factorized some motion estimation code
-
-
-
-version 0.4.0:
-
-- removing grab code from ffserver and moved it to ffmpeg. Added
-  multistream support to ffmpeg.
-- added timeshifting support for live feeds (option ?date=xxx in the
-  URL)
-- added high quality image resize code with polyphase filter (need
-  mmx/see optimization). Enable multiple image size support in ffserver.
-- added multi live feed support in ffserver
-- suppressed master feature from ffserver (it should be done with an
-  external program which opens the .ffm url and writes it to another
-  ffserver)
-- added preliminary support for video stream parsing (WAV and AVI half
-  done). Added proper support for audio/video file conversion in
-  ffmpeg.
-- added preliminary support for video file sending from ffserver
-- redesigning I/O subsystem: now using URL based input and output
-  (see avio.h)
-- added WAV format support
-- added "tty user interface" to ffmpeg to stop grabbing gracefully
-- added MMX/SSE optimizations to SAD (Sums of Absolutes Differences)
-  (Juan J. Sierralta P. a.k.a. "Juanjo" <juanjo at atmlab.utfsm.cl>)
-- added MMX DCT from mpeg2_movie 1.5 (Juanjo)
-- added new motion estimation algorithms, log and phods (Juanjo)
-- changed directories: libav for format handling, libavcodec for
-  codecs
-
-
-
-version 0.3.4:
-
-- added stereo in MPEG audio encoder
-
-
-
-version 0.3.3:
-
-- added 'high quality' mode which use motion vectors. It can be used in
-  real time at low resolution.
-- fixed rounding problems which caused quality problems at high
-  bitrates and large GOP size
-
-
-
-version 0.3.2: small fixes
-
-- ASF fixes
-- put_seek bug fix
-
-
-
-version 0.3.1: added avi/divx support
-
-- added AVI support
-- added MPEG-4 codec compatible with OpenDivX. It is based on the H.263 codec
-- added sound for flash format (not tested)
-
-
-
-version 0.3: initial public release
diff --git a/Doxyfile b/Doxyfile
deleted file mode 100644
index 5e1a405..0000000
--- a/Doxyfile
+++ /dev/null
@@ -1,1037 +0,0 @@
-# Doxyfile 1.3-rc1
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
-#
-# All text after a hash (#) is considered a comment and will be ignored
-# The format is:
-#       TAG = value [value, ...]
-# For lists items can also be appended using:
-#       TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
-
-PROJECT_NAME           = Libav
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
-
-PROJECT_NUMBER         =
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY       = doxy
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch,
-# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en
-# (Japanese with english messages), Korean, Norwegian, Polish, Portuguese,
-# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish and Ukrainian.
-
-OUTPUT_LANGUAGE        = English
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL            = YES
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
-
-EXTRACT_PRIVATE        = YES
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
-
-EXTRACT_STATIC         = YES
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES  = YES
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS     = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these class will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES     = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS  = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS      = NO
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC      = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF           = YES
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
-# description.
-
-ALWAYS_DETAILED_SEC    = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited
-# members of a class in the documentation of that class as if those members were
-# ordinary class members. Constructors, destructors and assignment operators of
-# the base classes will not be shown.
-
-INLINE_INHERITED_MEMB  = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES        = YES
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. It is allowed to use relative paths in the argument list.
-
-STRIP_FROM_PATH        = .
-
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS          = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower case letters. If set to YES upper case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# users are adviced to set this option to NO.
-
-CASE_SENSE_NAMES       = YES
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES            = NO
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES       = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS       = YES
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put list of the files that are included by a file in the documentation
-# of that file.
-
-SHOW_INCLUDE_FILES     = YES
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments  will behave just like the Qt-style comments (thus requiring an
-# explict @brief command for a brief description.
-
-JAVADOC_AUTOBRIEF      = YES
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the DETAILS_AT_TOP tag is set to YES then Doxygen
-# will output the detailed description near the top, like JavaDoc.
-# If set to NO, the detailed description appears after the member
-# documentation.
-
-DETAILS_AT_TOP         = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# reimplements.
-
-INHERIT_DOCS           = YES
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
-
-INLINE_INFO            = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
-
-SORT_MEMBER_DOCS       = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC   = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE               = 8
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
-
-GENERATE_TODOLIST      = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
-
-GENERATE_TESTLIST      = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
-
-GENERATE_BUGLIST       = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES                =
-
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS       =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consist of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES  = 30
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
-# only. Doxygen will then generate output that is more tailored for C.
-# For instance some of the names that are used will be different. The list
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C  = YES
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
-# only. Doxygen will then generate output that is more tailored for Java.
-# For instance namespaces will be presented as packages, qualified scopes
-# will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA   = NO
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES        = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET                  = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
-
-WARNINGS               = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED   = YES
-
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text.
-
-WARN_FORMAT            = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
-
-WARN_LOGFILE           =
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
-
-INPUT                  =
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp
-# *.h++ *.idl *.odl
-
-FILE_PATTERNS          =
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
-
-RECURSIVE              = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-
-EXCLUDE                =
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories
-# that are symbolic links (a Unix filesystem feature) are excluded from the input.
-
-EXCLUDE_SYMLINKS       = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories.
-
-EXCLUDE_PATTERNS       = *.svn *.git
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
-
-EXAMPLE_PATH           =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
-
-EXAMPLE_PATTERNS       =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE      = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
-
-IMAGE_PATH             =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output.
-
-INPUT_FILTER           =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES    = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-
-SOURCE_BROWSER         = YES
-
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES         = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS    = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES (the default)
-# then for each documented function all documented
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = YES
-
-# If the REFERENCES_RELATION tag is set to YES (the default)
-# then for each documented function all documented entities
-# called/used by that function will be listed.
-
-REFERENCES_RELATION    = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX     = YES
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX    = 5
-
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX          =
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
-
-GENERATE_HTML          = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT            = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION    = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header.
-
-HTML_HEADER            =
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER            =
-
-# The HTML_STYLESHEET tag can be used to specify a user defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet
-
-HTML_STYLESHEET        =
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS     = YES
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP      = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
-# written to the html output dir.
-
-CHM_FILE               =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non empty doxygen will try to run
-# the html help compiler on the generated index.hhp.
-
-HHC_LOCATION           =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI           = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC             = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the Html help documentation and to the tree view.
-
-TOC_EXPAND             = NO
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
-
-DISABLE_INDEX          = NO
-
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE   = 4
-
-# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
-# generated containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript and frames is required (for instance Mozilla, Netscape 4.0+,
-# or Internet explorer 4.0+). Note that for large projects the tree generation
-# can take a very long time. In such cases it is better to disable this feature.
-# Windows users are probably better off using the HTML help feature.
-
-GENERATE_TREEVIEW      = NO
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
-
-TREEVIEW_WIDTH         = 250
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
-
-GENERATE_LATEX         = YES
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT           = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-
-LATEX_CMD_NAME         = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
-
-MAKEINDEX_CMD_NAME     = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_LATEX          = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE             = a4wide
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES         =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER           =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS         = NO
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
-
-USE_PDFLATEX           = NO
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE        = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
-
-GENERATE_RTF           = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT             = rtf
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_RTF            = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS         = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assigments. You only have to provide
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE    =
-
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE    =
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
-
-GENERATE_MAN           = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT             = man
-
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION          = .3
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS              = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
-
-GENERATE_XML           = NO
-
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA             =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD                =
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF   = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
-
-GENERATE_PERLMOD       = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX          = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader.  This is useful
-# if you want to understand what is going on.  On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY         = YES
-
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
-
-ENABLE_PREPROCESSING   = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION        = YES
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_PREDEFINED tags.
-
-EXPAND_ONLY_PREDEF     = YES
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
-
-SEARCH_INCLUDES        = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
-
-INCLUDE_PATH           =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
-
-INCLUDE_FILE_PATTERNS  =
-
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed.
-
-PREDEFINED             = __attribute__(x)="" "RENAME(x)=x ## _TMPL" "DEF(x)=x ## _TMPL" \
-                         HAVE_AV_CONFIG_H HAVE_MMX HAVE_MMX2 HAVE_AMD3DNOW \
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-#EXPAND_AS_DEFINED      = FF_COMMON_FRAME
-EXPAND_AS_DEFINED      = declare_idct(idct, table, idct_row_head, idct_row, idct_row_tail, idct_row_mid)
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse the
-# parser if not removed.
-
-SKIP_FUNCTION_MACROS   = YES
-
-#---------------------------------------------------------------------------
-# Configuration::addtions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES tag can be used to specify one or more tagfiles.
-
-TAGFILES               =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE       =
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
-
-ALLEXTERNALS           = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
-
-EXTERNAL_GROUPS        = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH              = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in Html, RTF and LaTeX) for classes with base or
-# super classes. Setting the tag to NO turns the diagrams off. Note that this
-# option is superceded by the HAVE_DOT option below. This is only a fallback. It is
-# recommended to install and use dot, since it yield more powerful graphs.
-
-CLASS_DIAGRAMS         = YES
-
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS   = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT               = NO
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH            = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH    = YES
-
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS     = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
-
-INCLUDE_GRAPH          = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH      = YES
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY    = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
-
-DOT_IMAGE_FORMAT       = png
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found on the path.
-
-DOT_PATH               =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
-
-DOTFILE_DIRS           =
-
-# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than
-# this value, doxygen will try to truncate the graph, so that it fits within
-# the specified constraint. Beware that most browsers cannot cope with very
-# large images.
-
-MAX_DOT_GRAPH_WIDTH    = 1024
-
-# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than
-# this value, doxygen will try to truncate the graph, so that it fits within
-# the specified constraint. Beware that most browsers cannot cope with very
-# large images.
-
-MAX_DOT_GRAPH_HEIGHT   = 1024
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND        = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermedate dot files that are used to generate
-# the various graphs.
-
-DOT_CLEANUP            = YES
-
-#---------------------------------------------------------------------------
-# Configuration::addtions related to the search engine
-#---------------------------------------------------------------------------
-
-# The SEARCHENGINE tag specifies whether or not a search engine should be
-# used. If set to NO the values of all tags below this one will be ignored.
-
-SEARCHENGINE           = NO
-
-# The CGI_NAME tag should be the name of the CGI script that
-# starts the search engine (doxysearch) with the correct parameters.
-# A script with this name will be generated by doxygen.
-
-CGI_NAME               = search.cgi
-
-# The CGI_URL tag should be the absolute URL to the directory where the
-# cgi binaries are located. See the documentation of your http daemon for
-# details.
-
-CGI_URL                =
-
-# The DOC_URL tag should be the absolute URL to the directory where the
-# documentation is located. If left blank the absolute path to the
-# documentation, with file:// prepended to it, will be used.
-
-DOC_URL                =
-
-# The DOC_ABSPATH tag should be the absolute path to the directory where the
-# documentation is located. If left blank the directory on the local machine
-# will be used.
-
-DOC_ABSPATH            =
-
-# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
-# is installed.
-
-BIN_ABSPATH            = /usr/local/bin/
-
-# The EXT_DOC_PATHS tag can be used to specify one or more paths to
-# documentation generated for other projects. This allows doxysearch to search
-# the documentation for these projects as well.
-
-EXT_DOC_PATHS          =
diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index 2ed04ef..0000000
--- a/INSTALL
+++ /dev/null
@@ -1,11 +0,0 @@
-
-1) Type './configure' to create the configuration. A list of configure
-options is printed by running 'configure --help'.
-
-'configure' can be launched from a directory different from the Libav
-sources to build the objects out of tree. To do this, use an absolute
-path when launching 'configure', e.g. '/libavdir/libav/configure'.
-
-2) Then type 'make' to build Libav. GNU Make 3.81 or later is required.
-
-3) Type 'make install' to install all binaries and libraries you built.
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index c6bcbe8..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,50 +0,0 @@
-Libav:
--------
-
-Most files in Libav are under the GNU Lesser General Public License version 2.1
-or later (LGPL v2.1+). Read the file COPYING.LGPLv2.1 for details. Some other
-files have MIT/X11/BSD-style licenses. In combination the LGPL v2.1+ applies to
-Libav.
-
-Some optional parts of Libav are licensed under the GNU General Public License
-version 2 or later (GPL v2+). See the file COPYING.GPLv2 for details. None of
-these parts are used by default, you have to explicitly pass --enable-gpl to
-configure to activate them. In this case, Libav's license changes to GPL v2+.
-
-Specifically, the GPL parts of Libav are
-
-- libpostproc
-- optional MMX optimizations for YUV to RGB colorspace conversion in
-  libswscale/x86/yuv2rgb_template.c
-- optional x86 optimizations in the files
-  libavcodec/x86/h264_deblock_sse2.asm
-  libavcodec/x86/h264_idct_sse2.asm
-  libavcodec/x86/idct_mmx.c
-- the X11 grabber in libavdevice/x11grab.c
-
-There are a handful of files under other licensing terms, namely:
-
-* The files libavcodec/jfdctfst.c, libavcodec/jfdctint.c, libavcodec/jrevdct.c
-  are taken from libjpeg, see the top of the files for licensing details.
-
-Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then
-the configure parameter --enable-version3 will activate this licensing option
-for you. Read the file COPYING.LGPLv3 or, if you have enabled GPL parts,
-COPYING.GPLv3 to learn the exact legal terms that apply in this case.
-
-
-external libraries:
--------------------
-
-Some external libraries, e.g. libx264, are under GPL and can be used in
-conjunction with Libav. They require --enable-gpl to be passed to configure
-as well.
-
-The OpenCORE external libraries are under the Apache License 2.0. That license
-is incompatible with the LGPL v2.1 and the GPL v2, but not with version 3 of
-those licenses. So to combine the OpenCORE libraries with Libav, the license
-version needs to be upgraded by passing --enable-version3 to configure.
-
-The nonfree external library libfaac can be hooked up in Libav. You need to
-pass --enable-nonfree to configure to enable it. Employ this option with care
-as Libav then becomes nonfree and unredistributable.
diff --git a/MAINTAINERS b/MAINTAINERS
deleted file mode 100644
index f9891fe..0000000
--- a/MAINTAINERS
+++ /dev/null
@@ -1,359 +0,0 @@
-FFmpeg maintainers
-==================
-
-Below is a list of the people maintaining different parts of the
-FFmpeg code.
-
-
-Project Leader
-==============
-
-Michael Niedermayer
-  final design decisions
-
-
-Applications
-============
-
-ffmpeg:
-  ffmpeg.c                              Michael Niedermayer
-
-ffplay:
-  ffplay.c                              Michael Niedermayer
-
-ffserver:
-  ffserver.c, ffserver.h                Baptiste Coudurier
-
-Commandline utility code:
-  cmdutils.c, cmdutils.h                Michael Niedermayer
-
-QuickTime faststart:
-  tools/qt-faststart.c                  Baptiste Coudurier
-
-
-Miscellaneous Areas
-===================
-
-documentation                           Mike Melanson, Diego Biurrun
-website                                 Robert Swain
-build system (configure,Makefiles)      Diego Biurrun, Mans Rullgard
-project server                          Diego Biurrun, Mans Rullgard
-mailinglists                            Michael Niedermayer, Baptiste Coudurier
-presets                                 Robert Swain
-metadata subsystem                      Aurelien Jacobs
-release management                      Diego Biurrun, Reinhard Tartler
-
-
-libavutil
-=========
-
-External Interfaces:
-  libavutil/avutil.h                    Michael Niedermayer
-Internal Interfaces:
-  libavutil/common.h                    Michael Niedermayer
-
-Other:
-  intfloat*                             Michael Niedermayer
-  rational.c, rational.h                Michael Niedermayer
-  mathematics.c, mathematics.h          Michael Niedermayer
-  integer.c, integer.h                  Michael Niedermayer
-  bswap.h
-
-
-libavcodec
-==========
-
-Generic Parts:
-  External Interfaces:
-    avcodec.h                           Michael Niedermayer
-  utility code:
-    utils.c                             Michael Niedermayer
-    mem.c                               Michael Niedermayer
-    opt.c, opt.h                        Michael Niedermayer
-  arithmetic expression evaluator:
-    eval.c                              Michael Niedermayer
-  audio and video frame extraction:
-    parser.c                            Michael Niedermayer
-  bitstream reading:
-    bitstream.c, bitstream.h            Michael Niedermayer
-  CABAC:
-    cabac.h, cabac.c                    Michael Niedermayer
-  DSP utilities:
-    dsputils.c, dsputils.h              Michael Niedermayer
-  entropy coding:
-    rangecoder.c, rangecoder.h          Michael Niedermayer
-    lzw.*                               Michael Niedermayer
-  floating point AAN DCT:
-    faandct.c, faandct.h                Michael Niedermayer
-  Golomb coding:
-    golomb.c, golomb.h                  Michael Niedermayer
-  LPC:
-    lpc.c, lpc.h                        Justin Ruggles
-  motion estimation:
-    motion*                             Michael Niedermayer
-  rate control:
-    ratecontrol.c                       Michael Niedermayer
-    libxvid_rc.c                        Michael Niedermayer
-  simple IDCT:
-    simple_idct.c, simple_idct.h        Michael Niedermayer
-  postprocessing:
-    libpostproc/*                       Michael Niedermayer
-
-Codecs:
-  4xm.c                                 Michael Niedermayer
-  8bps.c                                Roberto Togni
-  8svx.c                                Jaikrishnan Menon
-  aasc.c                                Kostya Shishkov
-  aac*, sbr.h                           Alex Converse
-  ac3*                                  Justin Ruggles
-  alacenc.c                             Jaikrishnan Menon
-  alsdec.c                              Thilo Borgmann
-  apedec.c                              Kostya Shishkov
-  asv*                                  Michael Niedermayer
-  atrac3*                               Benjamin Larsson
-  bgmc.c, bgmc.h                        Thilo Borgmann
-  bink.c                                Kostya Shishkov
-  binkaudio.c                           Peter Ross
-  bmp.c                                 Mans Rullgard, Kostya Shishkov
-  cavs*                                 Stefan Gehrer
-  celp_filters.*                        Vitor Sessak
-  cinepak.c                             Roberto Togni
-  cljr                                  Alex Beregszaszi
-  cook.c, cookdata.h                    Benjamin Larsson
-  cscd.c                                Reimar Doeffinger
-  dca.c                                 Kostya Shishkov, Benjamin Larsson
-  dnxhd*                                Baptiste Coudurier
-  dpcm.c                                Mike Melanson
-  dxa.c                                 Kostya Shishkov
-  dv.c                                  Roman Shaposhnik
-  eacmv*, eaidct*, eat*                 Peter Ross
-  ffv1.c                                Michael Niedermayer
-  flac*                                 Justin Ruggles
-  flashsv*                              Benjamin Larsson
-  flicvideo.c                           Mike Melanson
-  g726.c                                Roman Shaposhnik
-  gifdec.c                              Baptiste Coudurier
-  h264*                                 Loren Merritt, Michael Niedermayer
-  h261*                                 Michael Niedermayer
-  h263*                                 Michael Niedermayer
-  huffyuv.c                             Michael Niedermayer
-  idcinvideo.c                          Mike Melanson
-  imc*                                  Benjamin Larsson
-  indeo2*                               Kostya Shishkov
-  indeo5*                               Kostya Shishkov
-  interplayvideo.c                      Mike Melanson
-  ivi*                                  Kostya Shishkov
-  jpeg_ls.c                             Kostya Shishkov
-  kmvc.c                                Kostya Shishkov
-  lcl*.c                                Roberto Togni, Reimar Doeffinger
-  libgsm.c                              Michel Bardiaux
-  libdirac*                             David Conrad
-  libopenjpeg.c                         Jaikrishnan Menon
-  libschroedinger*                      David Conrad
-  libspeexdec.c                         Justin Ruggles
-  libtheoraenc.c                        David Conrad
-  libx264.c                             Mans Rullgard, Jason Garrett-Glaser
-  loco.c                                Kostya Shishkov
-  lzo.h, lzo.c                          Reimar Doeffinger
-  mdec.c                                Michael Niedermayer
-  mimic.c                               Ramiro Polla
-  mjpeg.c                               Michael Niedermayer
-  mlp*                                  Ramiro Polla
-  mmvideo.c                             Peter Ross
-  mpc*                                  Kostya Shishkov
-  mpeg12.c, mpeg12data.h                Michael Niedermayer
-  mpegvideo.c, mpegvideo.h              Michael Niedermayer
-  msmpeg4.c, msmpeg4data.h              Michael Niedermayer
-  msrle.c                               Mike Melanson
-  msvideo1.c                            Mike Melanson
-  nellymoserdec.c                       Benjamin Larsson
-  nuv.c                                 Reimar Doeffinger
-  pcx.c                                 Ivo van Poorten
-  ptx.c                                 Ivo van Poorten
-  qcelp*                                Reynaldo H. Verdejo Pinochet
-  qdm2.c, qdm2data.h                    Roberto Togni, Benjamin Larsson
-  qdrw.c                                Kostya Shishkov
-  qpeg.c                                Kostya Shishkov
-  qtrle.c                               Mike Melanson
-  ra144.c, ra144.h, ra288.c, ra288.h    Roberto Togni
-  resample2.c                           Michael Niedermayer
-  rl2.c                                 Sascha Sommer
-  rpza.c                                Roberto Togni
-  rtjpeg.c, rtjpeg.h                    Reimar Doeffinger
-  rv10.c                                Michael Niedermayer
-  rv3*                                  Kostya Shishkov
-  rv4*                                  Kostya Shishkov
-  s3tc*                                 Ivo van Poorten
-  smacker.c                             Kostya Shishkov
-  smc.c                                 Mike Melanson
-  snow.c                                Michael Niedermayer, Loren Merritt
-  sonic.c                               Alex Beregszaszi
-  sunrast.c                             Ivo van Poorten
-  svq3.c                                Michael Niedermayer
-  targa.c                               Kostya Shishkov
-  tiff.c                                Kostya Shishkov
-  truemotion1*                          Mike Melanson
-  truemotion2*                          Kostya Shishkov
-  truespeech.c                          Kostya Shishkov
-  tscc.c                                Kostya Shishkov
-  tta.c                                 Alex Beregszaszi, Jaikrishnan Menon
-  txd.c                                 Ivo van Poorten
-  ulti*                                 Kostya Shishkov
-  vb.c                                  Kostya Shishkov
-  vc1*                                  Kostya Shishkov
-  vcr1.c                                Michael Niedermayer
-  vmnc.c                                Kostya Shishkov
-  vorbis_enc.c                          Oded Shimon
-  vorbis_dec.c                          Denes Balatoni
-  vp3*                                  Mike Melanson
-  vp5                                   Aurelien Jacobs
-  vp6                                   Aurelien Jacobs
-  vqavideo.c                            Mike Melanson
-  wavpack.c                             Kostya Shishkov
-  wmaprodec.c                           Sascha Sommer
-  wmavoice.c                            Ronald S. Bultje
-  wmv2.c                                Michael Niedermayer
-  wnv1.c                                Kostya Shishkov
-  xan.c                                 Mike Melanson
-  xl.c                                  Kostya Shishkov
-  xvmc.c                                Ivan Kalvachev
-  zmbv*                                 Kostya Shishkov
-
-Hardware acceleration:
-  dxva2*                                Laurent Aimar
-  vaapi*                                Gwenole Beauchesne
-  vdpau*                                Carl Eugen Hoyos
-
-
-libavdevice
-===========
-  External Interface:
-    libavdevice/avdevice.h
-
-
-  libdc1394.c                           Roman Shaposhnik
-  v4l2.c                                Luca Abeni
-  vfwcap.c                              Ramiro Polla
-
-
-libavformat
-===========
-
-Generic parts:
-  External Interface:
-    libavformat/avformat.h              Michael Niedermayer
-  Utility Code:
-    libavformat/utils.c                 Michael Niedermayer
-
-
-Muxers/Demuxers:
-  4xm.c                                 Mike Melanson
-  adtsenc.c                             Robert Swain
-  aiff.c                                Baptiste Coudurier
-  ape.c                                 Kostya Shishkov
-  avi*                                  Michael Niedermayer
-  bink.c                                Peter Ross
-  crc.c                                 Michael Niedermayer
-  daud.c                                Reimar Doeffinger
-  dv.c                                  Roman Shaposhnik
-  dxa.c                                 Kostya Shishkov
-  electronicarts.c                      Peter Ross
-  ffm*                                  Baptiste Coudurier
-  flac*                                 Justin Ruggles
-  flic.c                                Mike Melanson
-  flvdec.c, flvenc.c                    Michael Niedermayer
-  gxf.c                                 Reimar Doeffinger
-  gxfenc.c                              Baptiste Coudurier
-  idcin.c                               Mike Melanson
-  idroq.c                               Mike Melanson
-  iff.c                                 Jaikrishnan Menon
-  ipmovie.c                             Mike Melanson
-  img2.c                                Michael Niedermayer
-  iss.c                                 Stefan Gehrer
-  libnut.c                              Oded Shimon
-  lmlm4.c                               Ivo van Poorten
-  matroska.c                            Aurelien Jacobs
-  matroskadec.c                         Aurelien Jacobs
-  matroskaenc.c                         David Conrad
-  metadata*                             Aurelien Jacobs
-  mm.c                                  Peter Ross
-  mov.c                                 Michael Niedermayer, Baptiste Coudurier
-  movenc.c                              Michael Niedermayer, Baptiste Coudurier
-  mpc.c                                 Kostya Shishkov
-  mpeg.c                                Michael Niedermayer
-  mpegenc.c                             Michael Niedermayer
-  mpegts*                               Baptiste Coudurier
-  msnwc_tcp.c                           Ramiro Polla
-  mtv.c                                 Reynaldo H. Verdejo Pinochet
-  mxf*                                  Baptiste Coudurier
-  nsvdec.c                              Francois Revol
-  nut.c                                 Michael Niedermayer
-  nuv.c                                 Reimar Doeffinger
-  oggdec.c, oggdec.h                    David Conrad
-  oggenc.c                              Baptiste Coudurier
-  oggparse*.c                           David Conrad
-  psxstr.c                              Mike Melanson
-  pva.c                                 Ivo van Poorten
-  r3d.c                                 Baptiste Coudurier
-  raw.c                                 Michael Niedermayer
-  rdt.c                                 Ronald S. Bultje
-  rl2.c                                 Sascha Sommer
-  rmdec.c, rmenc.c                      Ronald S. Bultje, Kostya Shishkov
-  rtmp*                                 Kostya Shishkov
-  rtp.c, rtpenc.c                       Luca Abeni
-  rtp_asf.*                             Ronald S. Bultje
-  rtp_mpv.*, rtp_aac.*                  Luca Abeni
-  rtsp.c                                Luca Barbato
-  sdp.c                                 Luca Abeni
-  segafilm.c                            Mike Melanson
-  siff.c                                Kostya Shishkov
-  smacker.c                             Kostya Shishkov
-  swf.c                                 Baptiste Coudurier
-  tta.c                                 Alex Beregszaszi
-  txd.c                                 Ivo van Poorten
-  voc.c                                 Aurelien Jacobs
-  wav.c                                 Michael Niedermayer
-  wc3movie.c                            Mike Melanson
-  westwood.c                            Mike Melanson
-  wv.c                                  Kostya Shishkov
-
-Protocols:
-  http.c                                Ronald S. Bultje
-  udp.c                                 Luca Abeni
-
-
-Operating systems / CPU architectures
-=====================================
-
-Alpha                                   Mans Rullgard, Falk Hueffner
-ARM                                     Mans Rullgard
-AVR32                                   Mans Rullgard
-MIPS                                    Mans Rullgard
-BeOS                                    Francois Revol
-Mac OS X / PowerPC                      Romain Dolbeau, Guillaume Poirier
-Amiga / PowerPC                         Colin Ward
-Linux / PowerPC                         Luca Barbato
-Windows MinGW                           Alex Beregszaszi, Ramiro Polla
-Windows Cygwin                          Victor Paesa
-ADI/Blackfin DSP                        Marc Hoffman
-Sparc                                   Roman Shaposhnik
-x86                                     Michael Niedermayer
-
-
-GnuPG Fingerprints of maintainers and others who have svn write access
-======================================================================
-
-Attila Kinali                 11F0 F9A6 A1D2 11F6 C745 D10C 6520 BCDD F2DF E765
-Baptiste Coudurier            8D77 134D 20CC 9220 201F C5DB 0AC9 325C 5C1A BAAA
-Benoit Fouet                  B22A 4F4F 43EF 636B BB66 FCDC 0023 AE1E 2985 49C8
-Daniel Verkamp                78A6 07ED 782C 653E C628 B8B9 F0EB 8DD8 2F0E 21C7
-Diego Biurrun                 8227 1E31 B6D9 4994 7427 E220 9CAE D6CC 4757 FCC5
-Jaikrishnan Menon             61A1 F09F 01C9 2D45 78E1 C862 25DC 8831 AF70 D368
-Loren Merritt                 ABD9 08F4 C920 3F65 D8BE 35D7 1540 DAA7 060F 56DE
-Michael Niedermayer           9FF2 128B 147E F673 0BAD F133 611E C787 040B 0FAB
-Panagiotis Issaris            515C E262 10A8 FDCE 5481 7B9C 3AD7 D9A5 071D B3A9
-Peter Ross                    A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B
-Reimar Döffinger              C61D 16E5 9E2C D10C 8958 38A4 0899 A2B9 06D4 D9C7
-Reinhard Tartler              9300 5DC2 7E87 6C37 ED7B CA9A 9808 3544 9453 48A4
-Reynaldo H. Verdejo Pinochet  6E27 CD34 170C C78E 4D4F 5F40 C18E 077F 3114 452A
-Sascha Sommer                 38A0 F88B 868E 9D3A 97D4 D6A0 E823 706F 1E07 0D3C
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 18ab3a6..0000000
--- a/Makefile
+++ /dev/null
@@ -1,353 +0,0 @@
-include config.mak
-
-SRC_DIR = $(SRC_PATH_BARE)
-
-vpath %.texi $(SRC_PATH_BARE)
-
-PROGS-$(CONFIG_FFMPEG)   += ffmpeg
-PROGS-$(CONFIG_FFPLAY)   += ffplay
-PROGS-$(CONFIG_FFPROBE)  += ffprobe
-PROGS-$(CONFIG_FFSERVER) += ffserver
-
-PROGS      := $(addsuffix   $(EXESUF), $(PROGS-yes))
-PROGS_G     = $(addsuffix _g$(EXESUF), $(PROGS-yes))
-OBJS        = $(addsuffix .o,          $(PROGS-yes)) cmdutils.o
-MANPAGES    = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
-TOOLS       = $(addprefix tools/, $(addsuffix $(EXESUF), cws2fws pktdumper probetest qt-faststart trasher))
-HOSTPROGS   = $(addprefix tests/, audiogen videogen rotozoom tiny_psnr)
-
-BASENAMES   = ffmpeg ffplay ffprobe ffserver
-ALLPROGS    = $(addsuffix   $(EXESUF), $(BASENAMES))
-ALLPROGS_G  = $(addsuffix _g$(EXESUF), $(BASENAMES))
-ALLMANPAGES = $(addsuffix .1, $(BASENAMES))
-
-FFLIBS-$(CONFIG_AVDEVICE) += avdevice
-FFLIBS-$(CONFIG_AVFILTER) += avfilter
-FFLIBS-$(CONFIG_AVFORMAT) += avformat
-FFLIBS-$(CONFIG_AVCODEC)  += avcodec
-FFLIBS-$(CONFIG_POSTPROC) += postproc
-FFLIBS-$(CONFIG_SWSCALE)  += swscale
-
-FFLIBS := avutil
-
-DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
-
-SKIPHEADERS = cmdutils_common_opts.h
-
-include common.mak
-
-FF_LDFLAGS   := $(FFLDFLAGS)
-FF_EXTRALIBS := $(FFEXTRALIBS)
-FF_DEP_LIBS  := $(DEP_LIBS)
-
-ALL_TARGETS-$(CONFIG_DOC)       += documentation
-
-ifdef PROGS
-INSTALL_TARGETS-yes             += install-progs install-data
-INSTALL_TARGETS-$(CONFIG_DOC)   += install-man
-endif
-INSTALL_PROGS_TARGETS-$(CONFIG_SHARED) = install-libs
-
-all: $(FF_DEP_LIBS) $(PROGS) $(ALL_TARGETS-yes)
-
-$(PROGS): %$(EXESUF): %_g$(EXESUF)
-	$(CP) $< $@
-	$(STRIP) $@
-
-SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
-               ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
-               HOSTPROGS BUILT_HEADERS TESTOBJS ARCH_HEADERS
-
-define RESET
-$(1) :=
-$(1)-yes :=
-endef
-
-define DOSUBDIR
-$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
-SUBDIR := $(1)/
-include $(1)/Makefile
-endef
-
-$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
-
-ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
-ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
-
-%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
-	$(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
-
-tools/%$(EXESUF): tools/%.o
-	$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
-
-tools/%.o: tools/%.c
-	$(CC) $(CPPFLAGS) $(CFLAGS) $(CC_O) $<
-
-ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS)
-
-VERSION_SH  = $(SRC_PATH_BARE)/version.sh
-GIT_LOG     = $(SRC_PATH_BARE)/.git/logs/HEAD
-SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
-
-.version: $(wildcard $(GIT_LOG) $(SVN_ENTRIES)) $(VERSION_SH) config.mak
-.version: M=@
-
-version.h .version:
-	$(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
-	$(Q)touch .version
-
-# force version.sh to run whenever version might have changed
--include .version
-
-alltools: $(TOOLS)
-
-documentation: $(addprefix doc/, developer.html faq.html ffmpeg-doc.html \
-                                 ffplay-doc.html ffprobe-doc.html ffserver-doc.html \
-                                 general.html libavfilter.html $(ALLMANPAGES))
-
-doc/%.html: TAG = HTML
-doc/%.html: doc/%.texi
-	$(M)cd doc && texi2html -monolithic -number $(<:doc/%=%)
-
-doc/%.pod: TAG = POD
-doc/%.pod: doc/%-doc.texi
-	$(M)doc/texi2pod.pl $< $@
-
-doc/%.1: TAG = MAN
-doc/%.1: doc/%.pod
-	$(M)pod2man --section=1 --center=" " --release=" " $< > $@
-
-install: $(INSTALL_TARGETS-yes)
-
-install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes)
-	$(Q)mkdir -p "$(BINDIR)"
-	$(INSTALL) -c -m 755 $(PROGS) "$(BINDIR)"
-
-install-data: $(DATA_FILES)
-	$(Q)mkdir -p "$(DATADIR)"
-	$(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
-
-install-man: $(MANPAGES)
-	$(Q)mkdir -p "$(MANDIR)/man1"
-	$(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
-
-uninstall: uninstall-progs uninstall-data uninstall-man
-
-uninstall-progs:
-	$(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
-
-uninstall-data:
-	$(RM) -r "$(DATADIR)"
-
-uninstall-man:
-	$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
-
-testclean:
-	$(RM) -r tests/vsynth1 tests/vsynth2 tests/data
-	$(RM) $(addprefix tests/,$(CLEANSUFFIXES))
-	$(RM) tests/seek_test$(EXESUF) tests/seek_test.o
-	$(RM) $(addprefix tests/,$(addsuffix $(HOSTEXESUF),audiogen videogen rotozoom tiny_psnr))
-
-clean:: testclean
-	$(RM) $(ALLPROGS) $(ALLPROGS_G)
-	$(RM) $(CLEANSUFFIXES)
-	$(RM) doc/*.html doc/*.pod doc/*.1
-	$(RM) $(TOOLS)
-
-distclean::
-	$(RM) $(DISTCLEANSUFFIXES)
-	$(RM) version.h config.* libavutil/avconfig.h
-
-config:
-	$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
-
-# regression tests
-
-check: test checkheaders
-
-fulltest test: codectest lavftest seektest
-
-FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
-SEEK_REFFILE     = $(SRC_PATH)/tests/seek.regression.ref
-
-ENCDEC = $(and $(CONFIG_$(1)_ENCODER),$(CONFIG_$(1)_DECODER))
-MUXDEM = $(and $(CONFIG_$(1)_MUXER),$(CONFIG_$(or $(2),$(1))_DEMUXER))
-
-VCODEC_TESTS =
-VCODEC_TESTS-$(call ENCDEC,ASV1)             += asv1
-VCODEC_TESTS-$(call ENCDEC,ASV2)             += asv2
-VCODEC_TESTS-$(call ENCDEC,DNXHD)            += dnxhd_1080i dnxhd_720p dnxhd_720p_rd
-VCODEC_TESTS-$(call ENCDEC,DVVIDEO)          += dv dv50
-VCODEC_TESTS-$(call ENCDEC,FFV1)             += ffv1
-VCODEC_TESTS-$(call ENCDEC,FLASHSV)          += flashsv
-VCODEC_TESTS-$(call ENCDEC,FLV)              += flv
-VCODEC_TESTS-$(call ENCDEC,H261)             += h261
-VCODEC_TESTS-$(call ENCDEC,H263)             += h263 h263p
-VCODEC_TESTS-$(call ENCDEC,HUFFYUV)          += huffyuv
-VCODEC_TESTS-$(call ENCDEC,JPEGLS)           += jpegls
-VCODEC_TESTS-$(call ENCDEC,MJPEG)            += mjpeg ljpeg
-VCODEC_TESTS-$(call ENCDEC,MPEG1VIDEO)       += mpeg mpeg1b
-VCODEC_TESTS-$(call ENCDEC,MPEG2VIDEO)       += mpeg2 mpeg2thread
-VCODEC_TESTS-$(call ENCDEC,MPEG4)            += mpeg4 mpeg4adv mpeg4nr mpeg4thread error rc
-VCODEC_TESTS-$(call ENCDEC,MSMPEG4V1)        += msmpeg4
-VCODEC_TESTS-$(call ENCDEC,MSMPEG4V2)        += msmpeg4v2
-VCODEC_TESTS-$(call ENCDEC,ROQ)              += roq
-VCODEC_TESTS-$(call ENCDEC,RV10)             += rv10
-VCODEC_TESTS-$(call ENCDEC,RV20)             += rv20
-VCODEC_TESTS-$(call ENCDEC,SNOW)             += snow snowll
-VCODEC_TESTS-$(call ENCDEC,SVQ1)             += svq1
-VCODEC_TESTS-$(call ENCDEC,WMV1)             += wmv1
-VCODEC_TESTS-$(call ENCDEC,WMV2)             += wmv2
-
-ACODEC_TESTS =
-ACODEC_TESTS-$(call ENCDEC,AC3)              += ac3
-ACODEC_TESTS-$(call ENCDEC,ADPCM_G726)       += g726
-ACODEC_TESTS-$(call ENCDEC,ADPCM_IMA_QT)     += adpcm_ima_qt
-ACODEC_TESTS-$(call ENCDEC,ADPCM_IMA_WAV)    += adpcm_ima_wav
-ACODEC_TESTS-$(call ENCDEC,ADPCM_MS)         += adpcm_ms
-ACODEC_TESTS-$(call ENCDEC,ADPCM_SWF)        += adpcm_swf
-ACODEC_TESTS-$(call ENCDEC,ADPCM_YAMAHA)     += adpcm_yam
-ACODEC_TESTS-$(call ENCDEC,ALAC)             += alac
-ACODEC_TESTS-$(call ENCDEC,FLAC)             += flac
-ACODEC_TESTS-$(call ENCDEC,MP2)              += mp2
-ACODEC_TESTS-$(call ENCDEC,PCM_S16LE)        += pcm         # fixme
-ACODEC_TESTS-$(call ENCDEC,WMAV1)            += wmav1
-ACODEC_TESTS-$(call ENCDEC,WMAV1)            += wmav2
-
-LAVF_TESTS =
-LAVF_TESTS-$(call MUXDEM,AIFF)               += aiff
-LAVF_TESTS-$(call MUXDEM,PCM_ALAW)           += alaw
-LAVF_TESTS-$(call MUXDEM,ASF)                += asf
-LAVF_TESTS-$(call MUXDEM,AU)                 += au
-LAVF_TESTS-$(call MUXDEM,AVI)                += avi
-LAVF_TESTS-$(call ENCDEC,BMP)                += bmp
-LAVF_TESTS-$(call MUXDEM,DV)                 += dv_fmt
-LAVF_TESTS-$(call MUXDEM,FFM)                += ffm
-LAVF_TESTS-$(call MUXDEM,FLV)                += flv_fmt
-LAVF_TESTS-$(call ENCDEC,GIF)                += gif
-LAVF_TESTS-$(call MUXDEM,GXF)                += gxf
-LAVF_TESTS-$(call ENCDEC,MJPEG)              += jpg
-LAVF_TESTS-$(call MUXDEM,MATROSKA)           += mkv
-LAVF_TESTS-$(call MUXDEM,MMF)                += mmf
-LAVF_TESTS-$(call MUXDEM,MOV)                += mov
-LAVF_TESTS-$(call MUXDEM,MPEG1SYSTEM,MPEGPS) += mpg
-LAVF_TESTS-$(call MUXDEM,PCM_MULAW)          += mulaw
-LAVF_TESTS-$(call MUXDEM,MXF)                += mxf
-LAVF_TESTS-$(call MUXDEM,NUT)                += nut
-LAVF_TESTS-$(call MUXDEM,OGG)                += ogg
-LAVF_TESTS-$(call ENCDEC,PBM)                += pbmpipe
-LAVF_TESTS-$(call ENCDEC,PCX)                += pcx
-LAVF_TESTS-$(call ENCDEC,PGM)                += pgm pgmpipe
-LAVF_TESTS-$(call MUXDEM,RAWVIDEO)           += pixfmt
-LAVF_TESTS-$(call ENCDEC,PPM)                += ppm ppmpipe
-LAVF_TESTS-$(call MUXDEM,RM)                 += rm
-LAVF_TESTS-$(call ENCDEC,SGI)                += sgi
-LAVF_TESTS-$(call MUXDEM,SWF)                += swf
-LAVF_TESTS-$(call ENCDEC,TARGA)              += tga
-LAVF_TESTS-$(call ENCDEC,TIFF)               += tiff
-LAVF_TESTS-$(call MUXDEM,MPEGTS)             += ts
-LAVF_TESTS-$(call MUXDEM,VOC)                += voc
-LAVF_TESTS-$(call MUXDEM,WAV)                += wav
-LAVF_TESTS-$(call MUXDEM,YUV4MPEGPIPE)       += yuv4mpeg
-
-LAVFI_TESTS =           \
-    crop                \
-    crop_scale          \
-    crop_scale_vflip    \
-    crop_vflip          \
-    null                \
-    scale200            \
-    scale500            \
-    vflip               \
-    vflip_crop          \
-    vflip_vflip         \
-
-ACODEC_TESTS := $(addprefix regtest-, $(ACODEC_TESTS) $(ACODEC_TESTS-yes))
-VCODEC_TESTS := $(addprefix regtest-, $(VCODEC_TESTS) $(VCODEC_TESTS-yes))
-LAVF_TESTS  := $(addprefix regtest-, $(LAVF_TESTS)  $(LAVF_TESTS-yes))
-LAVFI_TESTS := $(addprefix regtest-, $(LAVFI_TESTS) $(LAVFI_TESTS-yes))
-
-CODEC_TESTS = $(VCODEC_TESTS) $(ACODEC_TESTS)
-
-codectest: $(CODEC_TESTS)
-lavftest:  $(LAVF_TESTS)
-lavfitest: $(LAVFI_TESTS)
-
-$(ACODEC_TESTS): regtest-aref
-$(VCODEC_TESTS): regtest-vref
-$(LAVF_TESTS) $(LAVFI_TESTS): regtest-ref
-
-REFFILE = $(SRC_PATH)/tests/ref/$(1)/$(2:regtest-%=%)
-RESFILE = tests/data/$(2:regtest-%=%).$(1).regression
-
-define CODECTEST_CMD
-	$(SRC_PATH)/tests/codec-regression.sh $@ vsynth1 tests/vsynth1 "$(TARGET_EXEC)" "$(TARGET_PATH)"
-	$(SRC_PATH)/tests/codec-regression.sh $@ vsynth2 tests/vsynth2 "$(TARGET_EXEC)" "$(TARGET_PATH)"
-endef
-
-regtest-ref: regtest-aref regtest-vref
-
-regtest-vref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm
-	$(CODECTEST_CMD)
-
-regtest-aref: ffmpeg$(EXESUF) tests/data/asynth1.sw
-	@$(SRC_PATH)/tests/codec-regression.sh $@ acodec tests/acodec "$(TARGET_EXEC)" "$(TARGET_PATH)"
-
-$(VCODEC_TESTS): tests/tiny_psnr$(HOSTEXESUF)
-	@echo "TEST VCODEC $(@:regtest-%=%)"
-	@$(CODECTEST_CMD)
-	@diff -u -w $(call REFFILE,vsynth1,$@) $(call RESFILE,vsynth1,$@)
-	@diff -u -w $(call REFFILE,vsynth2,$@) $(call RESFILE,vsynth2,$@)
-
-$(ACODEC_TESTS): tests/tiny_psnr$(HOSTEXESUF)
-	@echo "TEST ACODEC $(@:regtest-%=%)"
-	@$(SRC_PATH)/tests/codec-regression.sh $@ acodec tests/acodec "$(TARGET_EXEC)" "$(TARGET_PATH)"
-	@diff -u -w $(call REFFILE,acodec,$@) $(call RESFILE,acodec,$@)
-
-$(LAVF_TESTS):
-	@echo "TEST LAVF  $(@:regtest-%=%)"
-	@$(SRC_PATH)/tests/lavf-regression.sh $@ lavf tests/vsynth1 "$(TARGET_EXEC)" "$(TARGET_PATH)"
-	@diff -u -w $(call REFFILE,lavf,$@) $(call RESFILE,lavf,$@)
-
-$(LAVFI_TESTS):
-	@echo "TEST LAVFI $(@:regtest-%=%)"
-	@$(SRC_PATH)/tests/lavfi-regression.sh $@ lavfi tests/vsynth1 "$(TARGET_EXEC)" "$(TARGET_PATH)"
-	@diff -u -w $(call REFFILE,lavfi,$@) $(call RESFILE,lavfi,$@)
-
-seektest: codectest lavftest tests/seek_test$(EXESUF)
-	$(SRC_PATH)/tests/seek-regression.sh $(SRC_PATH) "$(TARGET_EXEC)" "$(TARGET_PATH)"
-
-ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
-	@echo
-	@echo "Unfortunately ffserver is broken and therefore its regression"
-	@echo "test fails randomly. Treat the results accordingly."
-	@echo
-	$(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
-
-tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
-	mkdir -p tests/vsynth1
-	$(BUILD_ROOT)/$< 'tests/vsynth1/'
-
-tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
-	mkdir -p tests/vsynth2
-	$(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
-
-tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
-	mkdir -p tests/data
-	$(BUILD_ROOT)/$< $@
-
-tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS)
-	$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
-
-ifdef SAMPLES
-include $(SRC_PATH_BARE)/tests/fate.mak
-fate: $(FATE_TESTS)
-$(FATE_TESTS): ffmpeg$(EXESUF)
-	@echo "TEST FATE   $(@:fate-%=%)"
-	@$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)'
-else
-fate:
-	@echo "SAMPLES not specified, cannot run FATE"
-endif
-
-.PHONY: documentation *test regtest-* zlib-error alltools check config
diff --git a/README b/README
deleted file mode 100644
index 6346cff..0000000
--- a/README
+++ /dev/null
@@ -1,12 +0,0 @@
-Libav README
--------------
-
-1) Documentation
-----------------
-
-* Read the documentation in the doc/ directory.
-
-2) Licensing
-------------
-
-* See the LICENSE file.
diff --git a/RELEASE b/RELEASE
deleted file mode 100644
index ddd02e0..0000000
--- a/RELEASE
+++ /dev/null
@@ -1,146 +0,0 @@
-Release Notes
-=============
-
-* 0.6 "Works with HTML5" June, 2010
-
-General notes
--------------
-
-This release focuses on improvements for the new multimedia elements in HTML5.
-The H.264 and Theora decoders are now significantly faster, the Vorbis decoder
-has seen important updates and this release supports Google's newly released
-libvpx library for the VP8 codec and WebM container.
-
-Other important changes are additions of decoders including, but not limited to,
-Intel Indeo 5, WMA Pro, WMA Voice and HE-AAC.
-
-See the Changelog file for a list of significant changes.
-
-Please note that our policy on bug reports has not changed. We still only accept
-bug reports against HEAD of the FFmpeg trunk repository. If you are experiencing
-any issues with any formally released version of FFmpeg, please try a current
-version of the development code to check if the issue still exists. If it does,
-make your report against the development code following the usual bug reporting
-guidelines.
-
-
-API and other notable Changes
------------------------------
-
-Please see the file doc/APIchanges for programmer-centric information.
-
-Notable changes:
-- deprecated vhook subsystem removed
-- deprecated old scaler removed
-- nonfree libamr support for AMR-NB/WB decoding/encoding removed
-- RTMP support in libavformat
-- -formats option split into -formats, -codecs, -bsfs, and -protocols
-- ffprobe tool
-- RTMP/RTMPT/RTMPS/RTMPE/RTMPTE protocol support via librtmp
-- CODEC_CAP_EXPERIMENTAL added
-
-
-Added Codecs:
--------------
-
-- VQF demuxer
-- PCX encoder
-- CorePNG decoding support
-- 8088flex TMV demuxer and decoder
-- enable symbol versioning by default for linkers that support it
-- V210 decoder and encoder
-- QCP demuxer
-- SoX native format muxer and demuxer
-- AMR-NB decoding/encoding, AMR-WB decoding via OpenCORE libraries
-- DPX image decoder
-- Electronic Arts Madcow decoder
-- DivX (XSUB) subtitle encoder
-- experimental AAC encoder
-- Wave64 demuxer
-- IEC-61937 compatible Muxer
-- TwinVQ decoder
-- Bluray (PGS) subtitle decoder
-- LPCM support in MPEG-TS (HDMV RID as found on Blu-ray disks)
-- WMA Pro decoder
-- Core Audio Format demuxer
-- Atrac1 decoder
-- MD STUDIO audio demuxer
-- RF64 support in WAV demuxer
-- MPEG-4 Audio Lossless Coding (ALS) decoder
-- IV8 demuxer
-- CDG demuxer and decoder
-- R210 decoder
-- Auravision Aura 1 and 2 decoders
-- Deluxe Paint Animation playback system
-- SIPR decoder
-- Adobe Filmstrip muxer and demuxer
-- RTP packetization and depacketization of H.263 and AMR
-- Bink demuxer and audio/video decoders
-- IFF PBM/ILBM bitmap decoder
-- Indeo 5 decoder
-- WMA Voice decoder
-- AMR-NB decoder
-- RTSP muxer
-- HE-AAC v1 decoder
-- Kega Game Video (KGV1) decoder
-- Psygnosis YOP demuxer and video decoder
-- RTP hinting in the mov/3gp/mp4 muxer
-- VP8 decoding via libvpx
-
-
-Notable license related changes
--------------------------------
-
-- remaining GPL parts in AC-3 decoder converted to LGPL
-- libswscale can now be compiled in LGPL mode
-
-
-
-* 0.6.1
-
-General notes
--------------
-
-This point release includes some updates to make the 0.6 release series usable
-for users that need to retain the existing behavior as closely as possible.
-The changes follow below:
-
-Bugfixes
---------
-
-- fix autodetection of E-AC-3 substream samples
-- performance fix for seekable HTTP
-- add missing VP80 fourcc code for the VP8 codec
-- small documentation fixes
-- fix several potentially exploitable issues in the FLIC decoder
-  (addresses CVE-2010-3429)
-
-
-HE-AAC v2 backport
-------------------
-
-This release includes a backport of the AAC decoder from trunk, which
-enables proper playback of HE-AAC v2 media.
-
-
-* 0.6.2
-
-General notes
--------------
-
-This is a maintenance-only release that addresses a small number of security
-and portability issues. Distributors and system integrators are encouraged
-to update and share their patches against this branch.
-
-Security fixes
---------------
-
-Programming errors in container and codec implementations may lead to
-denial of service or the execution of arbitrary code if the user is
-tricked into opening a malformed media file or stream.
-
-Affected and updated have been the implementations of the following
-codecs and container formats:
-
- - VC1 decoder (Change related to CVE-2011-0723)
- - APE decoder (cf. http://packetstorm.linuxsecurity.com/1103-exploits/vlc105-dos.txt)
diff --git a/VERSION b/VERSION
deleted file mode 100644
index b616048..0000000
--- a/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-0.6.2
diff --git a/cmdutils.c b/cmdutils.c
deleted file mode 100644
index 23f0efe..0000000
--- a/cmdutils.c
+++ /dev/null
@@ -1,664 +0,0 @@
-/*
- * Various utilities for command line tools
- * Copyright (c) 2000-2003 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <math.h>
-
-/* Include only the enabled headers since some compilers (namely, Sun
-   Studio) will not omit unused inline functions and create undefined
-   references to libraries that are not being built. */
-
-#include "config.h"
-#include "libavformat/avformat.h"
-#include "libavfilter/avfilter.h"
-#include "libavdevice/avdevice.h"
-#include "libswscale/swscale.h"
-#include "libpostproc/postprocess.h"
-#include "libavutil/avstring.h"
-#include "libavutil/pixdesc.h"
-#include "libavcodec/opt.h"
-#include "cmdutils.h"
-#include "version.h"
-#if CONFIG_NETWORK
-#include "libavformat/network.h"
-#endif
-#if HAVE_SYS_RESOURCE_H
-#include <sys/resource.h>
-#endif
-
-const char **opt_names;
-static int opt_name_count;
-AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
-AVFormatContext *avformat_opts;
-struct SwsContext *sws_opts;
-
-const int this_year = 2010;
-
-double parse_number_or_die(const char *context, const char *numstr, int type, double min, double max)
-{
-    char *tail;
-    const char *error;
-    double d = strtod(numstr, &tail);
-    if (*tail)
-        error= "Expected number for %s but found: %s\n";
-    else if (d < min || d > max)
-        error= "The value for %s was %s which is not within %f - %f\n";
-    else if(type == OPT_INT64 && (int64_t)d != d)
-        error= "Expected int64 for %s but found %s\n";
-    else
-        return d;
-    fprintf(stderr, error, context, numstr, min, max);
-    exit(1);
-}
-
-int64_t parse_time_or_die(const char *context, const char *timestr, int is_duration)
-{
-    int64_t us = parse_date(timestr, is_duration);
-    if (us == INT64_MIN) {
-        fprintf(stderr, "Invalid %s specification for %s: %s\n",
-                is_duration ? "duration" : "date", context, timestr);
-        exit(1);
-    }
-    return us;
-}
-
-void show_help_options(const OptionDef *options, const char *msg, int mask, int value)
-{
-    const OptionDef *po;
-    int first;
-
-    first = 1;
-    for(po = options; po->name != NULL; po++) {
-        char buf[64];
-        if ((po->flags & mask) == value) {
-            if (first) {
-                printf("%s", msg);
-                first = 0;
-            }
-            av_strlcpy(buf, po->name, sizeof(buf));
-            if (po->flags & HAS_ARG) {
-                av_strlcat(buf, " ", sizeof(buf));
-                av_strlcat(buf, po->argname, sizeof(buf));
-            }
-            printf("-%-17s  %s\n", buf, po->help);
-        }
-    }
-}
-
-static const OptionDef* find_option(const OptionDef *po, const char *name){
-    while (po->name != NULL) {
-        if (!strcmp(name, po->name))
-            break;
-        po++;
-    }
-    return po;
-}
-
-void parse_options(int argc, char **argv, const OptionDef *options,
-                   void (* parse_arg_function)(const char*))
-{
-    const char *opt, *arg;
-    int optindex, handleoptions=1;
-    const OptionDef *po;
-
-    /* parse options */
-    optindex = 1;
-    while (optindex < argc) {
-        opt = argv[optindex++];
-
-        if (handleoptions && opt[0] == '-' && opt[1] != '\0') {
-            int bool_val = 1;
-            if (opt[1] == '-' && opt[2] == '\0') {
-                handleoptions = 0;
-                continue;
-            }
-            opt++;
-            po= find_option(options, opt);
-            if (!po->name && opt[0] == 'n' && opt[1] == 'o') {
-                /* handle 'no' bool option */
-                po = find_option(options, opt + 2);
-                if (!(po->name && (po->flags & OPT_BOOL)))
-                    goto unknown_opt;
-                bool_val = 0;
-            }
-            if (!po->name)
-                po= find_option(options, "default");
-            if (!po->name) {
-unknown_opt:
-                fprintf(stderr, "%s: unrecognized option '%s'\n", argv[0], opt);
-                exit(1);
-            }
-            arg = NULL;
-            if (po->flags & HAS_ARG) {
-                arg = argv[optindex++];
-                if (!arg) {
-                    fprintf(stderr, "%s: missing argument for option '%s'\n", argv[0], opt);
-                    exit(1);
-                }
-            }
-            if (po->flags & OPT_STRING) {
-                char *str;
-                str = av_strdup(arg);
-                *po->u.str_arg = str;
-            } else if (po->flags & OPT_BOOL) {
-                *po->u.int_arg = bool_val;
-            } else if (po->flags & OPT_INT) {
-                *po->u.int_arg = parse_number_or_die(opt, arg, OPT_INT64, INT_MIN, INT_MAX);
-            } else if (po->flags & OPT_INT64) {
-                *po->u.int64_arg = parse_number_or_die(opt, arg, OPT_INT64, INT64_MIN, INT64_MAX);
-            } else if (po->flags & OPT_FLOAT) {
-                *po->u.float_arg = parse_number_or_die(opt, arg, OPT_FLOAT, -1.0/0.0, 1.0/0.0);
-            } else if (po->flags & OPT_FUNC2) {
-                if (po->u.func2_arg(opt, arg) < 0) {
-                    fprintf(stderr, "%s: failed to set value '%s' for option '%s'\n", argv[0], arg, opt);
-                    exit(1);
-                }
-            } else {
-                po->u.func_arg(arg);
-            }
-            if(po->flags & OPT_EXIT)
-                exit(0);
-        } else {
-            if (parse_arg_function)
-                parse_arg_function(opt);
-        }
-    }
-}
-
-int opt_default(const char *opt, const char *arg){
-    int type;
-    int ret= 0;
-    const AVOption *o= NULL;
-    int opt_types[]={AV_OPT_FLAG_VIDEO_PARAM, AV_OPT_FLAG_AUDIO_PARAM, 0, AV_OPT_FLAG_SUBTITLE_PARAM, 0};
-
-    for(type=0; type<AVMEDIA_TYPE_NB && ret>= 0; type++){
-        const AVOption *o2 = av_find_opt(avcodec_opts[0], opt, NULL, opt_types[type], opt_types[type]);
-        if(o2)
-            ret = av_set_string3(avcodec_opts[type], opt, arg, 1, &o);
-    }
-    if(!o)
-        ret = av_set_string3(avformat_opts, opt, arg, 1, &o);
-    if(!o && sws_opts)
-        ret = av_set_string3(sws_opts, opt, arg, 1, &o);
-    if(!o){
-        if(opt[0] == 'a')
-            ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_AUDIO], opt+1, arg, 1, &o);
-        else if(opt[0] == 'v')
-            ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_VIDEO], opt+1, arg, 1, &o);
-        else if(opt[0] == 's')
-            ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], opt+1, arg, 1, &o);
-    }
-    if (o && ret < 0) {
-        fprintf(stderr, "Invalid value '%s' for option '%s'\n", arg, opt);
-        exit(1);
-    }
-    if (!o) {
-        fprintf(stderr, "Unrecognized option '%s'\n", opt);
-        exit(1);
-    }
-
-//    av_log(NULL, AV_LOG_ERROR, "%s:%s: %f 0x%0X\n", opt, arg, av_get_double(avcodec_opts, opt, NULL), (int)av_get_int(avcodec_opts, opt, NULL));
-
-    //FIXME we should always use avcodec_opts, ... for storing options so there will not be any need to keep track of what i set over this
-    opt_names= av_realloc(opt_names, sizeof(void*)*(opt_name_count+1));
-    opt_names[opt_name_count++]= o->name;
-
-    if(avcodec_opts[0]->debug || avformat_opts->debug)
-        av_log_set_level(AV_LOG_DEBUG);
-    return 0;
-}
-
-int opt_loglevel(const char *opt, const char *arg)
-{
-    const struct { const char *name; int level; } log_levels[] = {
-        { "quiet"  , AV_LOG_QUIET   },
-        { "panic"  , AV_LOG_PANIC   },
-        { "fatal"  , AV_LOG_FATAL   },
-        { "error"  , AV_LOG_ERROR   },
-        { "warning", AV_LOG_WARNING },
-        { "info"   , AV_LOG_INFO    },
-        { "verbose", AV_LOG_VERBOSE },
-        { "debug"  , AV_LOG_DEBUG   },
-    };
-    char *tail;
-    int level;
-    int i;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(log_levels); i++) {
-        if (!strcmp(log_levels[i].name, arg)) {
-            av_log_set_level(log_levels[i].level);
-            return 0;
-        }
-    }
-
-    level = strtol(arg, &tail, 10);
-    if (*tail) {
-        fprintf(stderr, "Invalid loglevel \"%s\". "
-                        "Possible levels are numbers or:\n", arg);
-        for (i = 0; i < FF_ARRAY_ELEMS(log_levels); i++)
-            fprintf(stderr, "\"%s\"\n", log_levels[i].name);
-        exit(1);
-    }
-    av_log_set_level(level);
-    return 0;
-}
-
-int opt_timelimit(const char *opt, const char *arg)
-{
-#if HAVE_SETRLIMIT
-    int lim = parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX);
-    struct rlimit rl = { lim, lim + 1 };
-    if (setrlimit(RLIMIT_CPU, &rl))
-        perror("setrlimit");
-#else
-    fprintf(stderr, "Warning: -%s not implemented on this OS\n", opt);
-#endif
-    return 0;
-}
-
-void set_context_opts(void *ctx, void *opts_ctx, int flags)
-{
-    int i;
-    for(i=0; i<opt_name_count; i++){
-        char buf[256];
-        const AVOption *opt;
-        const char *str= av_get_string(opts_ctx, opt_names[i], &opt, buf, sizeof(buf));
-        /* if an option with name opt_names[i] is present in opts_ctx then str is non-NULL */
-        if(str && ((opt->flags & flags) == flags))
-            av_set_string3(ctx, opt_names[i], str, 1, NULL);
-    }
-}
-
-void print_error(const char *filename, int err)
-{
-    char errbuf[128];
-    const char *errbuf_ptr = errbuf;
-
-    if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
-        errbuf_ptr = strerror(AVUNERROR(err));
-    fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
-}
-
-#define PRINT_LIB_VERSION(outstream,libname,LIBNAME,indent)             \
-    if (CONFIG_##LIBNAME) {                                             \
-        unsigned int version = libname##_version();                     \
-        fprintf(outstream, "%slib%-10s %2d.%2d.%2d / %2d.%2d.%2d\n",    \
-                indent? "  " : "", #libname,                            \
-                LIB##LIBNAME##_VERSION_MAJOR,                           \
-                LIB##LIBNAME##_VERSION_MINOR,                           \
-                LIB##LIBNAME##_VERSION_MICRO,                           \
-                version >> 16, version >> 8 & 0xff, version & 0xff);    \
-    }
-
-static void print_all_lib_versions(FILE* outstream, int indent)
-{
-    PRINT_LIB_VERSION(outstream, avutil,   AVUTIL,   indent);
-    PRINT_LIB_VERSION(outstream, avcodec,  AVCODEC,  indent);
-    PRINT_LIB_VERSION(outstream, avformat, AVFORMAT, indent);
-    PRINT_LIB_VERSION(outstream, avdevice, AVDEVICE, indent);
-    PRINT_LIB_VERSION(outstream, avfilter, AVFILTER, indent);
-    PRINT_LIB_VERSION(outstream, swscale,  SWSCALE,  indent);
-    PRINT_LIB_VERSION(outstream, postproc, POSTPROC, indent);
-}
-
-static void maybe_print_config(const char *lib, const char *cfg)
-{
-    static int warned_cfg;
-
-    if (strcmp(FFMPEG_CONFIGURATION, cfg)) {
-        if (!warned_cfg) {
-            fprintf(stderr, "  WARNING: library configuration mismatch\n");
-            warned_cfg = 1;
-        }
-        fprintf(stderr, "  %-11s configuration: %s\n", lib, cfg);
-    }
-}
-
-#define PRINT_LIB_CONFIG(lib, tag, cfg) do {    \
-        if (CONFIG_##lib)                       \
-            maybe_print_config(tag, cfg);       \
-    } while (0)
-
-void show_banner(void)
-{
-    fprintf(stderr, "%s version " FFMPEG_VERSION ", Copyright (c) %d-%d the Libav developers\n",
-            program_name, program_birth_year, this_year);
-    fprintf(stderr, "  built on %s %s with %s %s\n",
-            __DATE__, __TIME__, CC_TYPE, CC_VERSION);
-    fprintf(stderr, "  configuration: " FFMPEG_CONFIGURATION "\n");
-    PRINT_LIB_CONFIG(AVUTIL,   "libavutil",   avutil_configuration());
-    PRINT_LIB_CONFIG(AVCODEC,  "libavcodec",  avcodec_configuration());
-    PRINT_LIB_CONFIG(AVFORMAT, "libavformat", avformat_configuration());
-    PRINT_LIB_CONFIG(AVDEVICE, "libavdevice", avdevice_configuration());
-    PRINT_LIB_CONFIG(AVFILTER, "libavfilter", avfilter_configuration());
-    PRINT_LIB_CONFIG(SWSCALE,  "libswscale",  swscale_configuration());
-    PRINT_LIB_CONFIG(POSTPROC, "libpostproc", postproc_configuration());
-    print_all_lib_versions(stderr, 1);
-}
-
-void show_version(void) {
-    printf("%s " FFMPEG_VERSION "\n", program_name);
-    print_all_lib_versions(stdout, 0);
-}
-
-void show_license(void)
-{
-    printf(
-#if CONFIG_NONFREE
-    "This version of %s has nonfree parts compiled in.\n"
-    "Therefore it is not legally redistributable.\n",
-    program_name
-#elif CONFIG_GPLV3
-    "%s is free software; you can redistribute it and/or modify\n"
-    "it under the terms of the GNU General Public License as published by\n"
-    "the Free Software Foundation; either version 3 of the License, or\n"
-    "(at your option) any later version.\n"
-    "\n"
-    "%s is distributed in the hope that it will be useful,\n"
-    "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-    "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
-    "GNU General Public License for more details.\n"
-    "\n"
-    "You should have received a copy of the GNU General Public License\n"
-    "along with %s.  If not, see <http://www.gnu.org/licenses/>.\n",
-    program_name, program_name, program_name
-#elif CONFIG_GPL
-    "%s is free software; you can redistribute it and/or modify\n"
-    "it under the terms of the GNU General Public License as published by\n"
-    "the Free Software Foundation; either version 2 of the License, or\n"
-    "(at your option) any later version.\n"
-    "\n"
-    "%s is distributed in the hope that it will be useful,\n"
-    "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-    "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
-    "GNU General Public License for more details.\n"
-    "\n"
-    "You should have received a copy of the GNU General Public License\n"
-    "along with %s; if not, write to the Free Software\n"
-    "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n",
-    program_name, program_name, program_name
-#elif CONFIG_LGPLV3
-    "%s is free software; you can redistribute it and/or modify\n"
-    "it under the terms of the GNU Lesser General Public License as published by\n"
-    "the Free Software Foundation; either version 3 of the License, or\n"
-    "(at your option) any later version.\n"
-    "\n"
-    "%s is distributed in the hope that it will be useful,\n"
-    "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-    "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
-    "GNU Lesser General Public License for more details.\n"
-    "\n"
-    "You should have received a copy of the GNU Lesser General Public License\n"
-    "along with %s.  If not, see <http://www.gnu.org/licenses/>.\n",
-    program_name, program_name, program_name
-#else
-    "%s is free software; you can redistribute it and/or\n"
-    "modify it under the terms of the GNU Lesser General Public\n"
-    "License as published by the Free Software Foundation; either\n"
-    "version 2.1 of the License, or (at your option) any later version.\n"
-    "\n"
-    "%s is distributed in the hope that it will be useful,\n"
-    "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-    "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n"
-    "Lesser General Public License for more details.\n"
-    "\n"
-    "You should have received a copy of the GNU Lesser General Public\n"
-    "License along with %s; if not, write to the Free Software\n"
-    "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n",
-    program_name, program_name, program_name
-#endif
-    );
-}
-
-void list_fmts(void (*get_fmt_string)(char *buf, int buf_size, int fmt), int nb_fmts)
-{
-    int i;
-    char fmt_str[128];
-    for (i=-1; i < nb_fmts; i++) {
-        get_fmt_string (fmt_str, sizeof(fmt_str), i);
-        fprintf(stdout, "%s\n", fmt_str);
-    }
-}
-
-void show_formats(void)
-{
-    AVInputFormat *ifmt=NULL;
-    AVOutputFormat *ofmt=NULL;
-    const char *last_name;
-
-    printf(
-        "File formats:\n"
-        " D. = Demuxing supported\n"
-        " .E = Muxing supported\n"
-        " --\n");
-    last_name= "000";
-    for(;;){
-        int decode=0;
-        int encode=0;
-        const char *name=NULL;
-        const char *long_name=NULL;
-
-        while((ofmt= av_oformat_next(ofmt))) {
-            if((name == NULL || strcmp(ofmt->name, name)<0) &&
-                strcmp(ofmt->name, last_name)>0){
-                name= ofmt->name;
-                long_name= ofmt->long_name;
-                encode=1;
-            }
-        }
-        while((ifmt= av_iformat_next(ifmt))) {
-            if((name == NULL || strcmp(ifmt->name, name)<0) &&
-                strcmp(ifmt->name, last_name)>0){
-                name= ifmt->name;
-                long_name= ifmt->long_name;
-                encode=0;
-            }
-            if(name && strcmp(ifmt->name, name)==0)
-                decode=1;
-        }
-        if(name==NULL)
-            break;
-        last_name= name;
-
-        printf(
-            " %s%s %-15s %s\n",
-            decode ? "D":" ",
-            encode ? "E":" ",
-            name,
-            long_name ? long_name:" ");
-    }
-}
-
-void show_codecs(void)
-{
-    AVCodec *p=NULL, *p2;
-    const char *last_name;
-    printf(
-        "Codecs:\n"
-        " D..... = Decoding supported\n"
-        " .E.... = Encoding supported\n"
-        " ..V... = Video codec\n"
-        " ..A... = Audio codec\n"
-        " ..S... = Subtitle codec\n"
-        " ...S.. = Supports draw_horiz_band\n"
-        " ....D. = Supports direct rendering method 1\n"
-        " .....T = Supports weird frame truncation\n"
-        " ------\n");
-    last_name= "000";
-    for(;;){
-        int decode=0;
-        int encode=0;
-        int cap=0;
-        const char *type_str;
-
-        p2=NULL;
-        while((p= av_codec_next(p))) {
-            if((p2==NULL || strcmp(p->name, p2->name)<0) &&
-                strcmp(p->name, last_name)>0){
-                p2= p;
-                decode= encode= cap=0;
-            }
-            if(p2 && strcmp(p->name, p2->name)==0){
-                if(p->decode) decode=1;
-                if(p->encode) encode=1;
-                cap |= p->capabilities;
-            }
-        }
-        if(p2==NULL)
-            break;
-        last_name= p2->name;
-
-        switch(p2->type) {
-        case AVMEDIA_TYPE_VIDEO:
-            type_str = "V";
-            break;
-        case AVMEDIA_TYPE_AUDIO:
-            type_str = "A";
-            break;
-        case AVMEDIA_TYPE_SUBTITLE:
-            type_str = "S";
-            break;
-        default:
-            type_str = "?";
-            break;
-        }
-        printf(
-            " %s%s%s%s%s%s %-15s %s",
-            decode ? "D": (/*p2->decoder ? "d":*/" "),
-            encode ? "E":" ",
-            type_str,
-            cap & CODEC_CAP_DRAW_HORIZ_BAND ? "S":" ",
-            cap & CODEC_CAP_DR1 ? "D":" ",
-            cap & CODEC_CAP_TRUNCATED ? "T":" ",
-            p2->name,
-            p2->long_name ? p2->long_name : "");
-       /* if(p2->decoder && decode==0)
-            printf(" use %s for decoding", p2->decoder->name);*/
-        printf("\n");
-    }
-    printf("\n");
-    printf(
-"Note, the names of encoders and decoders do not always match, so there are\n"
-"several cases where the above table shows encoder only or decoder only entries\n"
-"even though both encoding and decoding are supported. For example, the h263\n"
-"decoder corresponds to the h263 and h263p encoders, for file formats it is even\n"
-"worse.\n");
-}
-
-void show_bsfs(void)
-{
-    AVBitStreamFilter *bsf=NULL;
-
-    printf("Bitstream filters:\n");
-    while((bsf = av_bitstream_filter_next(bsf)))
-        printf("%s\n", bsf->name);
-    printf("\n");
-}
-
-void show_protocols(void)
-{
-    URLProtocol *up=NULL;
-
-    printf("Supported file protocols:\n");
-    while((up = av_protocol_next(up)))
-        printf("%s\n", up->name);
-}
-
-void show_filters(void)
-{
-    AVFilter av_unused(**filter) = NULL;
-
-    printf("Filters:\n");
-#if CONFIG_AVFILTER
-    while ((filter = av_filter_next(filter)) && *filter)
-        printf("%-16s %s\n", (*filter)->name, (*filter)->description);
-#endif
-}
-
-void show_pix_fmts(void)
-{
-    enum PixelFormat pix_fmt;
-
-    printf(
-        "Pixel formats:\n"
-        "I.... = Supported Input  format for conversion\n"
-        ".O... = Supported Output format for conversion\n"
-        "..H.. = Hardware accelerated format\n"
-        "...P. = Paletted format\n"
-        "....B = Bitstream format\n"
-        "FLAGS NAME            NB_COMPONENTS BITS_PER_PIXEL\n"
-        "-----\n");
-
-#if !CONFIG_SWSCALE
-#   define sws_isSupportedInput(x)  0
-#   define sws_isSupportedOutput(x) 0
-#endif
-
-    for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) {
-        const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[pix_fmt];
-        printf("%c%c%c%c%c %-16s       %d            %2d\n",
-               sws_isSupportedInput (pix_fmt)      ? 'I' : '.',
-               sws_isSupportedOutput(pix_fmt)      ? 'O' : '.',
-               pix_desc->flags & PIX_FMT_HWACCEL   ? 'H' : '.',
-               pix_desc->flags & PIX_FMT_PAL       ? 'P' : '.',
-               pix_desc->flags & PIX_FMT_BITSTREAM ? 'B' : '.',
-               pix_desc->name,
-               pix_desc->nb_components,
-               av_get_bits_per_pixel(pix_desc));
-    }
-}
-
-int read_yesno(void)
-{
-    int c = getchar();
-    int yesno = (toupper(c) == 'Y');
-
-    while (c != '\n' && c != EOF)
-        c = getchar();
-
-    return yesno;
-}
-
-int read_file(const char *filename, char **bufptr, size_t *size)
-{
-    FILE *f = fopen(filename, "rb");
-
-    if (!f) {
-        fprintf(stderr, "Cannot read file '%s': %s\n", filename, strerror(errno));
-        return AVERROR(errno);
-    }
-    fseek(f, 0, SEEK_END);
-    *size = ftell(f);
-    fseek(f, 0, SEEK_SET);
-    *bufptr = av_malloc(*size + 1);
-    if (!*bufptr) {
-        fprintf(stderr, "Could not allocate file buffer\n");
-        fclose(f);
-        return AVERROR(ENOMEM);
-    }
-    fread(*bufptr, 1, *size, f);
-    (*bufptr)[*size++] = '\0';
-
-    fclose(f);
-    return 0;
-}
diff --git a/cmdutils.h b/cmdutils.h
deleted file mode 100644
index 5656370..0000000
--- a/cmdutils.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Various utilities for command line tools
- * copyright (c) 2003 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef FFMPEG_CMDUTILS_H
-#define FFMPEG_CMDUTILS_H
-
-#include <inttypes.h>
-#include "libavcodec/avcodec.h"
-#include "libavformat/avformat.h"
-#include "libswscale/swscale.h"
-
-/**
- * program name, defined by the program for show_version().
- */
-extern const char program_name[];
-
-/**
- * program birth year, defined by the program for show_banner()
- */
-extern const int program_birth_year;
-
-extern const int this_year;
-
-extern const char **opt_names;
-extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
-extern AVFormatContext *avformat_opts;
-extern struct SwsContext *sws_opts;
-
-/**
- * Fallback for options that are not explicitly handled, these will be
- * parsed through AVOptions.
- */
-int opt_default(const char *opt, const char *arg);
-
-/**
- * Sets the libav* libraries log level.
- */
-int opt_loglevel(const char *opt, const char *arg);
-
-/**
- * Limit the execution time.
- */
-int opt_timelimit(const char *opt, const char *arg);
-
-/**
- * Parses a string and returns its corresponding value as a double.
- * Exits from the application if the string cannot be correctly
- * parsed or the corresponding value is invalid.
- *
- * @param context the context of the value to be set (e.g. the
- * corresponding commandline option name)
- * @param numstr the string to be parsed
- * @param type the type (OPT_INT64 or OPT_FLOAT) as which the
- * string should be parsed
- * @param min the minimum valid accepted value
- * @param max the maximum valid accepted value
- */
-double parse_number_or_die(const char *context, const char *numstr, int type, double min, double max);
-
-/**
- * Parses a string specifying a time and returns its corresponding
- * value as a number of microseconds. Exits from the application if
- * the string cannot be correctly parsed.
- *
- * @param context the context of the value to be set (e.g. the
- * corresponding commandline option name)
- * @param timestr the string to be parsed
- * @param is_duration a flag which tells how to interpret timestr, if
- * not zero timestr is interpreted as a duration, otherwise as a
- * date
- *
- * @see parse_date()
- */
-int64_t parse_time_or_die(const char *context, const char *timestr, int is_duration);
-
-typedef struct {
-    const char *name;
-    int flags;
-#define HAS_ARG    0x0001
-#define OPT_BOOL   0x0002
-#define OPT_EXPERT 0x0004
-#define OPT_STRING 0x0008
-#define OPT_VIDEO  0x0010
-#define OPT_AUDIO  0x0020
-#define OPT_GRAB   0x0040
-#define OPT_INT    0x0080
-#define OPT_FLOAT  0x0100
-#define OPT_SUBTITLE 0x0200
-#define OPT_FUNC2  0x0400
-#define OPT_INT64  0x0800
-#define OPT_EXIT   0x1000
-     union {
-        void (*func_arg)(const char *); //FIXME passing error code as int return would be nicer then exit() in the func
-        int *int_arg;
-        char **str_arg;
-        float *float_arg;
-        int (*func2_arg)(const char *, const char *);
-        int64_t *int64_arg;
-    } u;
-    const char *help;
-    const char *argname;
-} OptionDef;
-
-void show_help_options(const OptionDef *options, const char *msg, int mask, int value);
-
-/**
- * Parses the command line arguments.
- * @param options Array with the definitions required to interpret every
- * option of the form: -<option_name> [<argument>]
- * @param parse_arg_function Name of the function called to process every
- * argument without a leading option name flag. NULL if such arguments do
- * not have to be processed.
- */
-void parse_options(int argc, char **argv, const OptionDef *options,
-                   void (* parse_arg_function)(const char*));
-
-void set_context_opts(void *ctx, void *opts_ctx, int flags);
-
-/**
- * Prints an error message to stderr, indicating filename and a human
- * readable description of the error code err.
- *
- * If strerror_r() is not available the use of this function in a
- * multithreaded application may be unsafe.
- *
- * @see av_strerror()
- */
-void print_error(const char *filename, int err);
-
-void list_fmts(void (*get_fmt_string)(char *buf, int buf_size, int fmt), int nb_fmts);
-
-/**
- * Prints the program banner to stderr. The banner contents depend on the
- * current version of the repository and of the libav* libraries used by
- * the program.
- */
-void show_banner(void);
-
-/**
- * Prints the version of the program to stdout. The version message
- * depends on the current versions of the repository and of the libav*
- * libraries.
- */
-void show_version(void);
-
-/**
- * Prints the license of the program to stdout. The license depends on
- * the license of the libraries compiled into the program.
- */
-void show_license(void);
-
-/**
- * Prints a listing containing all the formats supported by the
- * program.
- */
-void show_formats(void);
-
-/**
- * Prints a listing containing all the codecs supported by the
- * program.
- */
-void show_codecs(void);
-
-/**
- * Prints a listing containing all the filters supported by the
- * program.
- */
-void show_filters(void);
-
-/**
- * Prints a listing containing all the bit stream filters supported by the
- * program.
- */
-void show_bsfs(void);
-
-/**
- * Prints a listing containing all the protocols supported by the
- * program.
- */
-void show_protocols(void);
-
-/**
- * Prints a listing containing all the pixel formats supported by the
- * program.
- */
-void show_pix_fmts(void);
-
-/**
- * Returns a positive value if reads from standard input a line
- * starting with [yY], otherwise returns 0.
- */
-int read_yesno(void);
-
-/**
- * Reads the file with name filename, and puts its content in a newly
- * allocated 0-terminated buffer.
- *
- * @param bufptr puts here the pointer to the newly allocated buffer
- * @param size puts here the size of the newly allocated buffer
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR error code in case of failure.
- */
-int read_file(const char *filename, char **bufptr, size_t *size);
-
-#endif /* FFMPEG_CMDUTILS_H */
diff --git a/cmdutils_common_opts.h b/cmdutils_common_opts.h
deleted file mode 100644
index da30997..0000000
--- a/cmdutils_common_opts.h
+++ /dev/null
@@ -1,13 +0,0 @@
-    { "L", OPT_EXIT, {(void*)show_license}, "show license" },
-    { "h", OPT_EXIT, {(void*)show_help}, "show help" },
-    { "?", OPT_EXIT, {(void*)show_help}, "show help" },
-    { "help", OPT_EXIT, {(void*)show_help}, "show help" },
-    { "-help", OPT_EXIT, {(void*)show_help}, "show help" },
-    { "version", OPT_EXIT, {(void*)show_version}, "show version" },
-    { "formats"  , OPT_EXIT, {(void*)show_formats  }, "show available formats" },
-    { "codecs"   , OPT_EXIT, {(void*)show_codecs   }, "show available codecs" },
-    { "bsfs"     , OPT_EXIT, {(void*)show_bsfs     }, "show available bit stream filters" },
-    { "protocols", OPT_EXIT, {(void*)show_protocols}, "show available protocols" },
-    { "filters",   OPT_EXIT, {(void*)show_filters  }, "show available filters" },
-    { "pix_fmts" , OPT_EXIT, {(void*)show_pix_fmts }, "show available pixel formats" },
-    { "loglevel", HAS_ARG | OPT_FUNC2, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
diff --git a/common.mak b/common.mak
deleted file mode 100644
index 25a5d81..0000000
--- a/common.mak
+++ /dev/null
@@ -1,109 +0,0 @@
-#
-# common bits used by all libraries
-#
-
-# first so "all" becomes default target
-all: all-yes
-
-ifndef SUBDIR
-vpath %.c   $(SRC_DIR)
-vpath %.h   $(SRC_DIR)
-vpath %.S   $(SRC_DIR)
-vpath %.asm $(SRC_DIR)
-vpath %.v   $(SRC_DIR)
-
-ifeq ($(SRC_DIR),$(SRC_PATH_BARE))
-BUILD_ROOT_REL = .
-else
-BUILD_ROOT_REL = ..
-endif
-
-ifndef V
-Q      = @
-ECHO   = printf "$(1)\t%s\n" $(2)
-BRIEF  = CC AS YASM AR LD HOSTCC STRIP CP
-SILENT = DEPCC YASMDEP RM RANLIB
-MSG    = $@
-M      = @$(call ECHO,$(TAG),$@);
-$(foreach VAR,$(BRIEF), \
-    $(eval $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
-$(foreach VAR,$(SILENT),$(eval $(VAR) = @$($(VAR))))
-$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_DIR)/%=%)); $(INSTALL))
-endif
-
-ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
-
-CPPFLAGS := -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(CPPFLAGS)
-CFLAGS   += $(ECFLAGS)
-
-%.o: %.c
-	$(CCDEP)
-	$(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $<
-
-%.o: %.S
-	$(ASDEP)
-	$(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) -c -o $@ $<
-
-%.ho: %.h
-	$(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
-
-%$(EXESUF): %.c
-
-%.ver: %.v
-	$(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
-
-%.c %.h: TAG = GEN
-
-install: install-libs install-headers
-install-libs: install-libs-yes
-
-uninstall: uninstall-libs uninstall-headers
-
-.PHONY: all depend dep *clean install* uninstall* examples testprogs
-
-# Disable suffix rules.  Most of the builtin rules are suffix rules,
-# so this saves some time on slow systems.
-.SUFFIXES:
-
-# Do not delete intermediate files from chains of implicit rules
-$(OBJS):
-endif
-
-OBJS-$(HAVE_MMX) +=  $(MMX-OBJS-yes)
-
-CFLAGS    += $(CFLAGS-yes)
-OBJS      += $(OBJS-yes)
-FFLIBS    := $(FFLIBS-yes) $(FFLIBS)
-TESTPROGS += $(TESTPROGS-yes)
-
-FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS)
-FFLDFLAGS   := $(addprefix -L$(BUILD_ROOT)/lib,$(ALLFFLIBS)) $(LDFLAGS)
-
-EXAMPLES  := $(addprefix $(SUBDIR),$(addsuffix -example$(EXESUF),$(EXAMPLES)))
-OBJS      := $(addprefix $(SUBDIR),$(sort $(OBJS)))
-TESTOBJS  := $(addprefix $(SUBDIR),$(TESTOBJS))
-TESTPROGS := $(addprefix $(SUBDIR),$(addsuffix -test$(EXESUF),$(TESTPROGS)))
-HOSTOBJS  := $(addprefix $(SUBDIR),$(addsuffix .o,$(HOSTPROGS)))
-HOSTPROGS := $(addprefix $(SUBDIR),$(addsuffix $(HOSTEXESUF),$(HOSTPROGS)))
-
-DEP_LIBS := $(foreach NAME,$(FFLIBS),$(BUILD_ROOT_REL)/lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
-
-ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
-SKIPHEADERS += $(addprefix $(ARCH)/,$(ARCH_HEADERS))
-SKIPHEADERS := $(addprefix $(SUBDIR),$(SKIPHEADERS-) $(SKIPHEADERS))
-checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho))
-
-$(HOSTOBJS): %.o: %.c
-	$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
-
-$(HOSTPROGS): %$(HOSTEXESUF): %.o
-	$(HOSTCC) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
-
-DEPS := $(OBJS:.o=.d)
-depend dep: $(DEPS)
-
-CLEANSUFFIXES     = *.d *.o *~ *.ho *.map *.ver
-DISTCLEANSUFFIXES = *.pc
-LIBSUFFIXES       = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp
-
--include $(wildcard $(DEPS))
diff --git a/configure b/configure
deleted file mode 100755
index 3f5176e..0000000
--- a/configure
+++ /dev/null
@@ -1,3172 +0,0 @@
-#!/bin/sh
-#
-# Libav configure script
-#
-# Copyright (c) 2000-2002 Fabrice Bellard
-# Copyright (c) 2005-2008 Diego Biurrun
-# Copyright (c) 2005-2008 Mans Rullgard
-#
-
-# Prevent locale nonsense from breaking basic text processing.
-LC_ALL=C
-export LC_ALL
-
-# make sure we are running under a compatible shell
-# try to make this part work with most shells
-
-try_exec(){
-    echo "Trying shell $1"
-    type "$1" > /dev/null 2>&1 && exec "$@"
-}
-
-unset foo
-(: ${foo%%bar}) 2> /dev/null
-E1="$?"
-
-(: ${foo?}) 2> /dev/null
-E2="$?"
-
-if test "$E1" != 0 || test "$E2" = 0; then
-    echo "Broken shell detected.  Trying alternatives."
-    export FF_CONF_EXEC
-    if test "0$FF_CONF_EXEC" -lt 1; then
-        FF_CONF_EXEC=1
-        try_exec bash "$0" "$@"
-    fi
-    if test "0$FF_CONF_EXEC" -lt 2; then
-        FF_CONF_EXEC=2
-        try_exec ksh "$0" "$@"
-    fi
-    if test "0$FF_CONF_EXEC" -lt 3; then
-        FF_CONF_EXEC=3
-        try_exec /usr/xpg4/bin/sh "$0" "$@"
-    fi
-    echo "No compatible shell script interpreter found."
-    echo "This configure script requires a POSIX-compatible shell"
-    echo "such as bash or ksh."
-    echo "THIS IS NOT A BUG IN LIBAV, DO NOT REPORT IT AS SUCH."
-    echo "Instead, install a working POSIX-compatible shell."
-    echo "Disabling this configure test will create a broken Libav."
-    if test "$BASH_VERSION" = '2.04.0(1)-release'; then
-        echo "This bash version ($BASH_VERSION) is broken on your platform."
-        echo "Upgrade to a later version if available."
-    fi
-    exit 1
-fi
-
-show_help(){
-cat <<EOF
-Usage: configure [options]
-Options: [defaults in brackets after descriptions]
-
-Standard options:
-  --help                   print this message
-  --logfile=FILE           log tests and output to FILE [config.err]
-  --disable-logging        do not log configure debug information
-  --prefix=PREFIX          install in PREFIX [$prefix]
-  --bindir=DIR             install binaries in DIR [PREFIX/bin]
-  --datadir=DIR            install data files in DIR [PREFIX/share/ffmpeg]
-  --libdir=DIR             install libs in DIR [PREFIX/lib]
-  --shlibdir=DIR           install shared libs in DIR [PREFIX/lib]
-  --incdir=DIR             install includes in DIR [PREFIX/include]
-  --mandir=DIR             install man page in DIR [PREFIX/share/man]
-
-Configuration options:
-  --disable-static         do not build static libraries [no]
-  --enable-shared          build shared libraries [no]
-  --enable-gpl             allow use of GPL code, the resulting libs
-                           and binaries will be under GPL [no]
-  --enable-version3        upgrade (L)GPL to version 3 [no]
-  --enable-nonfree         allow use of nonfree code, the resulting libs
-                           and binaries will be unredistributable [no]
-  --disable-doc            do not build documentation
-  --disable-ffmpeg         disable ffmpeg build
-  --disable-ffplay         disable ffplay build
-  --disable-ffprobe        disable ffprobe build
-  --disable-ffserver       disable ffserver build
-  --disable-avdevice       disable libavdevice build
-  --disable-avcodec        disable libavcodec build
-  --disable-avformat       disable libavformat build
-  --disable-swscale        disable libswscale build
-  --enable-postproc        enable GPLed postprocessing support [no]
-  --enable-avfilter        video filter support [no]
-  --enable-avfilter-lavf   video filters dependent on avformat [no]
-  --enable-beosthreads     use BeOS threads [no]
-  --enable-os2threads      use OS/2 threads [no]
-  --enable-pthreads        use pthreads [no]
-  --enable-w32threads      use Win32 threads [no]
-  --enable-x11grab         enable X11 grabbing [no]
-  --disable-network        disable network support [no]
-  --disable-mpegaudio-hp   faster (but less accurate) MPEG audio decoding [no]
-  --enable-gray            enable full grayscale support (slower color)
-  --disable-swscale-alpha  disable alpha channel support in swscale
-  --disable-fastdiv        disable table-based division
-  --enable-small           optimize for size instead of speed
-  --disable-aandct         disable AAN DCT code
-  --disable-dct            disable DCT code
-  --disable-fft            disable FFT code
-  --disable-golomb         disable Golomb code
-  --disable-lpc            disable LPC code
-  --disable-mdct           disable MDCT code
-  --disable-rdft           disable RDFT code
-  --disable-vaapi          disable VAAPI code
-  --disable-vdpau          disable VDPAU code
-  --disable-dxva2          disable DXVA2 code
-  --enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)
-  --enable-hardcoded-tables use hardcoded tables instead of runtime generation
-  --enable-memalign-hack   emulate memalign, interferes with memory debuggers
-  --enable-beos-netserver  enable BeOS netserver
-  --disable-everything     disable all components listed below
-  --disable-encoder=NAME   disable encoder NAME
-  --enable-encoder=NAME    enable encoder NAME
-  --disable-encoders       disable all encoders
-  --disable-decoder=NAME   disable decoder NAME
-  --enable-decoder=NAME    enable decoder NAME
-  --disable-decoders       disable all decoders
-  --disable-hwaccel=NAME   disable hwaccel NAME
-  --enable-hwaccel=NAME    enable hwaccel NAME
-  --disable-hwaccels       disable all hwaccels
-  --disable-muxer=NAME     disable muxer NAME
-  --enable-muxer=NAME      enable muxer NAME
-  --disable-muxers         disable all muxers
-  --disable-demuxer=NAME   disable demuxer NAME
-  --enable-demuxer=NAME    enable demuxer NAME
-  --disable-demuxers       disable all demuxers
-  --enable-parser=NAME     enable parser NAME
-  --disable-parser=NAME    disable parser NAME
-  --disable-parsers        disable all parsers
-  --enable-bsf=NAME        enable bitstream filter NAME
-  --disable-bsf=NAME       disable bitstream filter NAME
-  --disable-bsfs           disable all bitstream filters
-  --enable-protocol=NAME   enable protocol NAME
-  --disable-protocol=NAME  disable protocol NAME
-  --disable-protocols      disable all protocols
-  --disable-indev=NAME     disable input device NAME
-  --disable-outdev=NAME    disable output device NAME
-  --disable-indevs         disable input devices
-  --disable-outdevs        disable output devices
-  --disable-devices        disable all devices
-  --enable-filter=NAME     enable filter NAME
-  --disable-filter=NAME    disable filter NAME
-  --disable-filters        disable all filters
-  --list-decoders          show all available decoders
-  --list-encoders          show all available encoders
-  --list-hwaccels          show all available hardware accelerators
-  --list-muxers            show all available muxers
-  --list-demuxers          show all available demuxers
-  --list-parsers           show all available parsers
-  --list-protocols         show all available protocols
-  --list-bsfs              show all available bitstream filters
-  --list-indevs            show all available input devices
-  --list-outdevs           show all available output devices
-  --list-filters           show all available filters
-
-External library support:
-  --enable-avisynth        enable reading of AVISynth script files [no]
-  --enable-bzlib           enable bzlib [autodetect]
-  --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
-  --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
-  --enable-libdc1394       enable IIDC-1394 grabbing using libdc1394
-                           and libraw1394 [no]
-  --enable-libdirac        enable Dirac support via libdirac [no]
-  --enable-libfaac         enable FAAC support via libfaac [no]
-  --enable-libfaad         enable FAAD support via libfaad [no]
-  --enable-libfaadbin      open libfaad.so.0 at runtime [no]
-  --enable-libgsm          enable GSM support via libgsm [no]
-  --enable-libmp3lame      enable MP3 encoding via libmp3lame [no]
-  --enable-libnut          enable NUT (de)muxing via libnut,
-                           native (de)muxer exists [no]
-  --enable-libopenjpeg     enable JPEG 2000 decoding via OpenJPEG [no]
-  --enable-librtmp         enable RTMP[E] support via librtmp [no]
-  --enable-libschroedinger enable Dirac support via libschroedinger [no]
-  --enable-libspeex        enable Speex decoding via libspeex [no]
-  --enable-libtheora       enable Theora encoding via libtheora [no]
-  --enable-libvorbis       enable Vorbis encoding via libvorbis,
-                           native implementation exists [no]
-  --enable-libvpx          enable VP8 support via libvpx [no]
-  --enable-libx264         enable H.264 encoding via x264 [no]
-  --enable-libxvid         enable Xvid encoding via xvidcore,
-                           native MPEG-4/Xvid encoder exists [no]
-  --enable-mlib            enable Sun medialib [no]
-  --enable-zlib            enable zlib [autodetect]
-
-Advanced options (experts only):
-  --source-path=PATH       path to source code [$source_path]
-  --cross-prefix=PREFIX    use PREFIX for compilation tools [$cross_prefix]
-  --enable-cross-compile   assume a cross-compiler is used
-  --sysroot=PATH           root of cross-build tree
-  --sysinclude=PATH        location of cross-build system headers
-  --target-os=OS           compiler targets OS [$target_os]
-  --target-exec=CMD        command to run executables on target
-  --target-path=DIR        path to view of build directory on target
-  --nm=NM                  use nm tool
-  --ar=AR                  use archive tool AR [$ar_default]
-  --as=AS                  use assembler AS [$as_default]
-  --cc=CC                  use C compiler CC [$cc_default]
-  --ld=LD                  use linker LD
-  --host-cc=HOSTCC         use host C compiler HOSTCC
-  --host-cflags=HCFLAGS    use HCFLAGS when compiling for host
-  --host-ldflags=HLDFLAGS  use HLDFLAGS when linking for host
-  --host-libs=HLIBS        use libs HLIBS when linking for host
-  --extra-cflags=ECFLAGS   add ECFLAGS to CFLAGS [$CFLAGS]
-  --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
-  --extra-libs=ELIBS       add ELIBS [$ELIBS]
-  --extra-version=STRING   version string suffix []
-  --build-suffix=SUFFIX    library name suffix []
-  --arch=ARCH              select architecture [$arch]
-  --cpu=CPU                select the minimum required CPU (affects
-                           instruction selection, may crash on older CPUs)
-  --enable-powerpc-perf    enable performance report on PPC
-                           (requires enabling PMC)
-  --disable-asm            disable all assembler optimizations
-  --disable-altivec        disable AltiVec optimizations
-  --disable-amd3dnow       disable 3DNow! optimizations
-  --disable-amd3dnowext    disable 3DNow! extended optimizations
-  --disable-mmx            disable MMX optimizations
-  --disable-mmx2           disable MMX2 optimizations
-  --disable-sse            disable SSE optimizations
-  --disable-ssse3          disable SSSE3 optimizations
-  --disable-armv5te        disable armv5te optimizations
-  --disable-armv6          disable armv6 optimizations
-  --disable-armv6t2        disable armv6t2 optimizations
-  --disable-armvfp         disable ARM VFP optimizations
-  --disable-iwmmxt         disable iwmmxt optimizations
-  --disable-mmi            disable MMI optimizations
-  --disable-neon           disable neon optimizations
-  --disable-vis            disable VIS optimizations
-  --disable-yasm           disable use of yasm assembler
-  --enable-pic             build position-independent code
-  --malloc-prefix=PFX      prefix malloc and related names with PFX
-  --enable-sram            allow use of on-chip SRAM
-
-Developer options (useful when working on Libav itself):
-  --disable-debug          disable debugging symbols
-  --enable-debug=LEVEL     set the debug level [$debuglevel]
-  --enable-gprof           enable profiling with gprof [$gprof]
-  --disable-optimizations  disable compiler optimizations
-  --enable-extra-warnings  enable more compiler warnings
-  --disable-stripping      disable stripping of executables and shared libraries
-  --samples=PATH           location of test samples for FATE
-
-NOTE: Object files are built at the place where configure is launched.
-EOF
-  exit 0
-}
-
-quotes='""'
-
-log(){
-    echo "$@" >> $logfile
-}
-
-log_file(){
-    log BEGIN $1
-    pr -n -t $1 >> $logfile
-    log END $1
-}
-
-echolog(){
-    log "$@"
-    echo "$@"
-}
-
-die(){
-    echolog "$@"
-    cat <<EOF
-
-If you think configure made a mistake, make sure you are using the latest
-version from Git.  If the latest version fails, report the problem to the
-libav-user at libav.org mailing list or IRC #libav on irc.freenode.net.
-EOF
-    if disabled logging; then
-        cat <<EOF
-Rerun configure with logging enabled (do not use --disable-logging), and
-include the log this produces with your report.
-EOF
-    else
-cat <<EOF
-Include the log file "$logfile" produced by configure as this will help
-solving the problem.
-EOF
-    fi
-    exit 1
-}
-
-# Avoid locale weirdness, besides we really just want to translate ASCII.
-toupper(){
-    echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
-}
-
-tolower(){
-    echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
-}
-
-c_escape(){
-    echo "$*" | sed 's/["\\]/\\\0/g'
-}
-
-sh_quote(){
-    v=$(echo "$1" | sed "s/'/'\\\\''/g")
-    test "$v" = "${v#*[ |&;<>()$\`\\\"\'*?\[\]#~=%]}" || v="'$v'"
-    echo "$v"
-}
-
-filter(){
-    pat=$1
-    shift
-    for v; do
-        eval "case $v in $pat) echo $v ;; esac"
-    done
-}
-
-map(){
-    m=$1
-    shift
-    for v; do eval $m; done
-}
-
-set_all(){
-    value=$1
-    shift
-    for var in $*; do
-        eval $var=$value
-    done
-}
-
-set_weak(){
-    value=$1
-    shift
-    for var; do
-        eval : \${$var:=$value}
-    done
-}
-
-pushvar(){
-    for var in $*; do
-        eval level=\${${var}_level:=0}
-        eval ${var}_${level}="\$$var"
-        eval ${var}_level=$(($level+1))
-    done
-}
-
-popvar(){
-    for var in $*; do
-        eval level=\${${var}_level:-0}
-        test $level = 0 && continue
-        eval level=$(($level-1))
-        eval $var="\${${var}_${level}}"
-        eval ${var}_level=$level
-        eval unset ${var}_${level}
-    done
-}
-
-enable(){
-    set_all yes $*
-}
-
-disable(){
-    set_all no $*
-}
-
-enable_weak(){
-    set_weak yes $*
-}
-
-disable_weak(){
-    set_weak no $*
-}
-
-enable_safe(){
-    for var; do
-        enable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
-    done
-}
-
-disable_safe(){
-    for var; do
-        disable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
-    done
-}
-
-do_enable_deep(){
-    for var; do
-        enabled $var && continue
-        eval sel="\$${var}_select"
-        eval sgs="\$${var}_suggest"
-        pushvar var sgs
-        enable_deep $sel
-        popvar sgs
-        enable_deep_weak $sgs
-        popvar var
-    done
-}
-
-enable_deep(){
-    do_enable_deep $*
-    enable $*
-}
-
-enable_deep_weak(){
-    do_enable_deep $*
-    enable_weak $*
-}
-
-enabled(){
-    test "${1#!}" = "$1" && op== || op=!=
-    eval test "x\$${1#!}" $op "xyes"
-}
-
-disabled(){
-    test "${1#!}" = "$1" && op== || op=!=
-    eval test "x\$${1#!}" $op "xno"
-}
-
-enabled_all(){
-    for opt; do
-        enabled $opt || return 1
-    done
-}
-
-disabled_all(){
-    for opt; do
-        disabled $opt || return 1
-    done
-}
-
-enabled_any(){
-    for opt; do
-        enabled $opt && return 0
-    done
-}
-
-disabled_any(){
-    for opt; do
-        disabled $opt && return 0
-    done
-    return 1
-}
-
-set_default(){
-    for opt; do
-        eval : \${$opt:=\$${opt}_default}
-    done
-}
-
-is_in(){
-    value=$1
-    shift
-    for var in $*; do
-        [ $var = $value ] && return 0
-    done
-    return 1
-}
-
-check_deps(){
-    for cfg; do
-        cfg="${cfg#!}"
-        enabled ${cfg}_checking && die "Circular dependency for $cfg."
-        disabled ${cfg}_checking && continue
-        enable ${cfg}_checking
-
-        eval dep_all="\$${cfg}_deps"
-        eval dep_any="\$${cfg}_deps_any"
-        eval dep_sel="\$${cfg}_select"
-        eval dep_sgs="\$${cfg}_suggest"
-        eval dep_ifa="\$${cfg}_if"
-        eval dep_ifn="\$${cfg}_if_any"
-
-        pushvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
-        check_deps $dep_all $dep_any $dep_sel $dep_sgs $dep_ifa $dep_ifn
-        popvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
-
-        [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
-        [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
-        enabled_all  $dep_all || disable $cfg
-        enabled_any  $dep_any || disable $cfg
-        disabled_any $dep_sel && disable $cfg
-
-        if enabled $cfg; then
-            eval dep_extralibs="\$${cfg}_extralibs"
-            test -n "$dep_extralibs" && add_extralibs $dep_extralibs
-            enable_deep $dep_sel
-            enable_deep_weak $dep_sgs
-        fi
-
-        disable ${cfg}_checking
-    done
-}
-
-print_config(){
-    pfx=$1
-    header=$2
-    makefile=$3
-    shift 3
-    for cfg; do
-        ucname="$(toupper $cfg)"
-        if enabled $cfg; then
-            echo "#define ${pfx}${ucname} 1" >> $header
-            echo "${pfx}${ucname}=yes" >> $makefile
-        else
-            echo "#define ${pfx}${ucname} 0" >> $header
-            echo "!${pfx}${ucname}=yes" >> $makefile
-        fi
-    done
-}
-
-flags_saved(){
-    (: ${SAVE_CFLAGS?}) 2> /dev/null
-}
-
-save_flags(){
-    flags_saved && return
-    SAVE_CFLAGS="$CFLAGS"
-    SAVE_LDFLAGS="$LDFLAGS"
-    SAVE_extralibs="$extralibs"
-}
-
-restore_flags(){
-    flags_saved || return
-    CFLAGS="$SAVE_CFLAGS"
-    LDFLAGS="$SAVE_LDFLAGS"
-    extralibs="$SAVE_extralibs"
-    unset SAVE_CFLAGS
-    unset SAVE_LDFLAGS
-    unset SAVE_extralibs
-}
-
-temp_cflags(){
-    save_flags
-    CFLAGS="$CFLAGS $*"
-}
-
-temp_ldflags(){
-    save_flags
-    LDFLAGS="$LDFLAGS $*"
-}
-
-temp_extralibs(){
-    save_flags
-    extralibs="$extralibs $*"
-}
-
-append(){
-    var=$1
-    shift
-    flags_saved && eval "SAVE_$var=\"\$SAVE_$var $*\""
-    eval "$var=\"\$$var $*\""
-}
-
-add_cppflags(){
-    append CPPFLAGS $($filter_cppflags "$@")
-}
-
-add_cflags(){
-    append CFLAGS $($filter_cflags "$@")
-}
-
-add_asflags(){
-    append ASFLAGS $($filter_asflags "$@")
-}
-
-add_ldflags(){
-    append LDFLAGS "$@"
-}
-
-add_extralibs(){
-    append extralibs "$@"
-}
-
-check_cmd(){
-    log "$@"
-    "$@" >> $logfile 2>&1
-}
-
-check_cc(){
-    log check_cc "$@"
-    cat > $TMPC
-    log_file $TMPC
-    check_cmd $cc $CPPFLAGS $CFLAGS "$@" -c -o $TMPO $TMPC
-}
-
-check_cpp(){
-    log check_cpp "$@"
-    cat > $TMPC
-    log_file $TMPC
-    check_cmd $cc $CPPFLAGS $CFLAGS "$@" -E -o $TMPO $TMPC
-}
-
-check_as(){
-    log check_as "$@"
-    cat > $TMPC
-    log_file $TMPC
-    check_cmd $as $CPPFLAGS $ASFLAGS "$@" -c -o $TMPO $TMPC
-}
-
-check_asm(){
-    log check_asm "$@"
-    name="$1"
-    code="$2"
-    shift 2
-    disable $name
-    check_as "$@" <<EOF && enable $name
-void foo(void){ __asm__ volatile($code); }
-EOF
-}
-
-check_yasm(){
-    log check_yasm "$@"
-    echo "$1" > $TMPS
-    log_file $TMPS
-    shift 1
-    check_cmd $yasmexe $YASMFLAGS "$@" -o $TMPO $TMPS
-}
-
-check_ld(){
-    log check_ld "$@"
-    flags=''
-    libs=''
-    for f; do
-        test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
-    done
-    check_cc $($filter_cflags $flags) || return
-    check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $extralibs $libs
-}
-
-check_cppflags(){
-    log check_cppflags "$@"
-    set -- $($filter_cppflags "$@")
-    check_cc "$@" <<EOF && append CPPFLAGS "$@"
-int x;
-EOF
-}
-
-check_cflags(){
-    log check_cflags "$@"
-    set -- $($filter_cflags "$@")
-    check_cc "$@" <<EOF && append CFLAGS "$@"
-int x;
-EOF
-}
-
-test_ldflags(){
-    log test_ldflags "$@"
-    check_ld "$@" <<EOF
-int main(void){ return 0; }
-EOF
-}
-
-check_ldflags(){
-    log check_ldflags "$@"
-    test_ldflags "$@" && add_ldflags "$@"
-}
-
-check_header(){
-    log check_header "$@"
-    header=$1
-    shift
-    disable_safe $header
-    check_cpp "$@" <<EOF && enable_safe $header
-#include <$header>
-int x;
-EOF
-}
-
-check_func(){
-    log check_func "$@"
-    func=$1
-    shift
-    disable $func
-    check_ld "$@" <<EOF && enable $func
-extern int $func();
-int main(void){ $func(); }
-EOF
-}
-
-check_mathfunc(){
-    log check_mathfunc "$@"
-    func=$1
-    shift
-    disable $func
-    check_ld "$@" <<EOF && enable $func
-#include <math.h>
-float foo(float f) { return $func(f); }
-int main(void){ return 0; }
-EOF
-}
-
-check_func_headers(){
-    log check_func_headers "$@"
-    headers=$1
-    func=$2
-    shift 2
-    disable $func
-    incs=""
-    for hdr in $headers; do
-        incs="$incs
-#include <$hdr>"
-    done
-    check_ld "$@" <<EOF && enable $func && enable_safe $headers
-$incs
-int main(int argc, char **argv){
-    return (long) $func;
-}
-EOF
-}
-
-check_cpp_condition(){
-    log check_cpp_condition "$@"
-    header=$1
-    condition=$2
-    shift 2
-    check_cpp $($filter_cppflags "$@") <<EOF
-#include <$header>
-#if !($condition)
-#error "unsatisfied condition: $condition"
-#endif
-EOF
-}
-
-check_lib(){
-    log check_lib "$@"
-    header="$1"
-    func="$2"
-    shift 2
-    temp_extralibs "$@"
-    check_header $header && check_func $func && add_extralibs "$@"
-    err=$?
-    restore_flags
-    return $err
-}
-
-check_lib2(){
-    log check_lib2 "$@"
-    headers="$1"
-    func="$2"
-    shift 2
-    check_func_headers "$headers" $func "$@" && add_extralibs "$@"
-}
-
-check_exec(){
-    check_ld "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
-}
-
-check_exec_crash(){
-    code=$(cat)
-
-    # exit() is not async signal safe.  _Exit (C99) and _exit (POSIX)
-    # are safe but may not be available everywhere.  Thus we use
-    # raise(SIGTERM) instead.  The check is run in a subshell so we
-    # can redirect the "Terminated" message from the shell.  SIGBUS
-    # is not defined by standard C so it is used conditionally.
-
-    (check_exec "$@") >> $logfile 2>&1 <<EOF
-#include <signal.h>
-static void sighandler(int sig){
-    raise(SIGTERM);
-}
-int main(void){
-    signal(SIGILL, sighandler);
-    signal(SIGFPE, sighandler);
-    signal(SIGSEGV, sighandler);
-#ifdef SIGBUS
-    signal(SIGBUS, sighandler);
-#endif
-    { $code }
-}
-EOF
-}
-
-check_type(){
-    log check_type "$@"
-    headers=$1
-    type=$2
-    shift 2
-    disable_safe "$type"
-    incs=""
-    for hdr in $headers; do
-        incs="$incs
-#include <$hdr>"
-    done
-    check_cc "$@" <<EOF && enable_safe "$type"
-$incs
-$type v;
-EOF
-}
-
-check_struct(){
-    log check_type "$@"
-    headers=$1
-    struct=$2
-    member=$3
-    shift 3
-    disable_safe "${struct}_${member}"
-    incs=""
-    for hdr in $headers; do
-        incs="$incs
-#include <$hdr>"
-    done
-    check_cc "$@" <<EOF && enable_safe "${struct}_${member}"
-$incs
-const void *p = &(($struct *)0)->$member;
-EOF
-}
-
-require(){
-    name="$1"
-    header="$2"
-    func="$3"
-    shift 3
-    check_lib $header $func "$@" || die "ERROR: $name not found"
-}
-
-require2(){
-    name="$1"
-    headers="$2"
-    func="$3"
-    shift 3
-    check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
-}
-
-check_foo_config(){
-    cfg=$1
-    pkg=$2
-    header=$3
-    func=$4
-    shift 4
-    disable $cfg
-    check_cmd ${pkg}-config --version
-    err=$?
-    if test "$err" = 0; then
-        temp_cflags $(${pkg}-config --cflags)
-        temp_extralibs $(${pkg}-config --libs)
-        check_lib "$@" $header $func && enable $cfg
-    fi
-    return $err
-}
-
-check_host_cc(){
-    log check_host_cc "$@"
-    cat > $TMPC
-    log_file $TMPC
-    check_cmd $host_cc $host_cflags "$@" -c -o $TMPO $TMPC
-}
-
-check_host_cflags(){
-    log check_host_cflags "$@"
-    check_host_cc "$@" <<EOF && append host_cflags "$@"
-int x;
-EOF
-}
-
-apply(){
-    file=$1
-    shift
-    "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
-}
-
-cp_if_changed(){
-    cmp -s "$1" "$2" &&
-        echo "$2 is unchanged" ||
-        cp -f "$1" "$2"
-}
-
-# CONFIG_LIST contains configurable options, while HAVE_LIST is for
-# system-dependent things.
-
-COMPONENT_LIST="
-    bsfs
-    decoders
-    demuxers
-    encoders
-    filters
-    hwaccels
-    indevs
-    muxers
-    outdevs
-    parsers
-    protocols
-"
-
-CONFIG_LIST="
-    $COMPONENT_LIST
-    aandct
-    avcodec
-    avdevice
-    avfilter
-    avfilter_lavf
-    avformat
-    avisynth
-    beos_netserver
-    bzlib
-    dct
-    doc
-    dwt
-    dxva2
-    fastdiv
-    ffmpeg
-    ffplay
-    ffprobe
-    ffserver
-    fft
-    golomb
-    gpl
-    gprof
-    gray
-    h264dsp
-    hardcoded_tables
-    libdc1394
-    libdirac
-    libfaac
-    libfaad
-    libfaadbin
-    libgsm
-    libmp3lame
-    libnut
-    libopencore_amrnb
-    libopencore_amrwb
-    libopenjpeg
-    librtmp
-    libschroedinger
-    libspeex
-    libtheora
-    libvorbis
-    libvpx
-    libx264
-    libxvid
-    lpc
-    lsp
-    mdct
-    memalign_hack
-    mlib
-    mpegaudio_hp
-    network
-    nonfree
-    pic
-    postproc
-    powerpc_perf
-    rdft
-    runtime_cpudetect
-    shared
-    small
-    sram
-    static
-    swscale
-    swscale_alpha
-    vaapi
-    vdpau
-    version3
-    x11grab
-    zlib
-"
-
-THREADS_LIST='
-    beosthreads
-    os2threads
-    pthreads
-    w32threads
-'
-
-ARCH_LIST='
-    alpha
-    arm
-    avr32
-    avr32_ap
-    avr32_uc
-    bfin
-    ia64
-    m68k
-    mips
-    mips64
-    parisc
-    ppc
-    ppc64
-    s390
-    sh4
-    sparc
-    sparc64
-    tomi
-    x86
-    x86_32
-    x86_64
-'
-
-ARCH_EXT_LIST='
-    altivec
-    amd3dnow
-    amd3dnowext
-    armv5te
-    armv6
-    armv6t2
-    armvfp
-    iwmmxt
-    mmi
-    mmx
-    mmx2
-    neon
-    ppc4xx
-    sse
-    ssse3
-    vis
-'
-
-HAVE_LIST_PUB='
-    bigendian
-'
-
-HAVE_LIST="
-    $ARCH_EXT_LIST
-    $HAVE_LIST_PUB
-    $THREADS_LIST
-    alsa_asoundlib_h
-    altivec_h
-    arpa_inet_h
-    attribute_may_alias
-    attribute_packed
-    bswap
-    closesocket
-    cmov
-    conio_h
-    dcbzl
-    dev_bktr_ioctl_bt848_h
-    dev_bktr_ioctl_meteor_h
-    dev_ic_bt8xx_h
-    dev_video_meteor_ioctl_meteor_h
-    dev_video_bktr_ioctl_bt848_h
-    dlfcn_h
-    dlopen
-    dos_paths
-    ebp_available
-    ebx_available
-    exp2
-    exp2f
-    fast_64bit
-    fast_clz
-    fast_cmov
-    fast_unaligned
-    fork
-    getaddrinfo
-    gethrtime
-    GetProcessMemoryInfo
-    GetProcessTimes
-    getrusage
-    struct_rusage_ru_maxrss
-    inet_aton
-    inline_asm
-    isatty
-    ldbrx
-    libdc1394_1
-    libdc1394_2
-    llrint
-    llrintf
-    local_aligned_16
-    local_aligned_8
-    log2
-    log2f
-    loongson
-    lrint
-    lrintf
-    lzo1x_999_compress
-    machine_ioctl_bt848_h
-    machine_ioctl_meteor_h
-    malloc_h
-    memalign
-    mkstemp
-    pld
-    posix_memalign
-    round
-    roundf
-    sdl
-    sdl_video_size
-    setmode
-    socklen_t
-    soundcard_h
-    poll_h
-    setrlimit
-    strerror_r
-    struct_addrinfo
-    struct_ipv6_mreq
-    struct_sockaddr_in6
-    struct_sockaddr_sa_len
-    struct_sockaddr_storage
-    symver
-    symver_gnu_asm
-    symver_asm_label
-    sys_mman_h
-    sys_resource_h
-    sys_select_h
-    sys_soundcard_h
-    sys_videoio_h
-    ten_operands
-    termios_h
-    threads
-    truncf
-    vfp_args
-    VirtualAlloc
-    winsock2_h
-    xform_asm
-    yasm
-"
-
-# options emitted with CONFIG_ prefix but not available on command line
-CONFIG_EXTRA="
-    avutil
-    gplv3
-    lgplv3
-"
-
-CMDLINE_SELECT="
-    $ARCH_EXT_LIST
-    $CONFIG_LIST
-    $THREADS_LIST
-    asm
-    cross_compile
-    debug
-    extra_warnings
-    logging
-    optimizations
-    stripping
-    yasm
-"
-
-PATHS_LIST='
-    bindir
-    datadir
-    incdir
-    libdir
-    mandir
-    prefix
-    shlibdir
-'
-
-CMDLINE_SET="
-    $PATHS_LIST
-    ar
-    arch
-    as
-    build_suffix
-    cc
-    cpu
-    cross_prefix
-    dep_cc
-    extra_version
-    host_cc
-    host_cflags
-    host_ldflags
-    host_libs
-    host_os
-    ld
-    logfile
-    malloc_prefix
-    nm
-    samples
-    source_path
-    strip
-    sysinclude
-    sysroot
-    target_exec
-    target_os
-    target_path
-"
-
-CMDLINE_APPEND="
-    extra_cflags
-"
-
-# code dependency declarations
-
-# architecture extensions
-
-armv5te_deps="arm"
-armv6_deps="arm"
-armv6t2_deps="arm"
-armvfp_deps="arm"
-iwmmxt_deps="arm"
-neon_deps="arm"
-
-mmi_deps="mips"
-
-altivec_deps="ppc"
-ppc4xx_deps="ppc"
-
-vis_deps="sparc"
-
-x86_64_suggest="cmov fast_cmov"
-amd3dnow_deps="mmx"
-amd3dnowext_deps="amd3dnow"
-mmx_deps="x86"
-mmx2_deps="mmx"
-sse_deps="mmx"
-ssse3_deps="sse"
-
-fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
-fast_clz_if_any="alpha armv5te avr32 mips ppc x86"
-fast_unaligned_if_any="armv6 ppc x86"
-
-need_memalign="altivec neon sse"
-inline_asm_deps="!tms470"
-
-symver_if_any="symver_asm_label symver_gnu_asm"
-
-# subsystems
-mdct_select="fft"
-rdft_select="fft"
-
-# decoders / encoders / hardware accelerators
-aac_decoder_select="mdct rdft aac_parser"
-aac_encoder_select="mdct"
-ac3_decoder_select="mdct ac3_parser"
-alac_encoder_select="lpc"
-amrnb_decoder_select="lsp"
-atrac1_decoder_select="mdct"
-atrac3_decoder_select="mdct"
-binkaudio_dct_decoder_select="mdct rdft dct"
-binkaudio_rdft_decoder_select="mdct rdft"
-cavs_decoder_select="golomb"
-cook_decoder_select="mdct"
-cscd_decoder_suggest="zlib"
-dca_decoder_select="mdct"
-dnxhd_encoder_select="aandct"
-dxa_decoder_select="zlib"
-eac3_decoder_select="ac3_decoder"
-eamad_decoder_select="aandct"
-eatgq_decoder_select="aandct"
-eatqi_decoder_select="aandct"
-ffv1_decoder_select="golomb"
-flac_decoder_select="golomb"
-flac_encoder_select="golomb lpc"
-flashsv_decoder_select="zlib"
-flashsv_encoder_select="zlib"
-flv_decoder_select="h263_decoder"
-flv_encoder_select="h263_encoder"
-h261_encoder_select="aandct"
-h263_decoder_select="h263_parser"
-h263_encoder_select="aandct"
-h263_vaapi_hwaccel_select="vaapi h263_decoder"
-h263i_decoder_select="h263_decoder"
-h263p_encoder_select="h263_encoder"
-h264_decoder_select="golomb h264dsp"
-h264_dxva2_hwaccel_deps="dxva2api_h"
-h264_dxva2_hwaccel_select="dxva2 h264_decoder"
-h264_vaapi_hwaccel_select="vaapi"
-h264_vdpau_decoder_select="vdpau h264_decoder"
-imc_decoder_select="fft mdct"
-jpegls_decoder_select="golomb"
-jpegls_encoder_select="golomb"
-ljpeg_encoder_select="aandct"
-loco_decoder_select="golomb"
-mjpeg_encoder_select="aandct"
-mlp_decoder_select="mlp_parser"
-mpeg1video_encoder_select="aandct"
-mpeg2video_encoder_select="aandct"
-mpeg4_decoder_select="h263_decoder mpeg4video_parser"
-mpeg4_encoder_select="h263_encoder"
-mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder"
-mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder"
-mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
-mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder"
-mpeg4_vdpau_decoder_select="vdpau mpeg4_decoder"
-mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
-mpeg_xvmc_decoder_select="mpegvideo_decoder"
-msmpeg4v1_decoder_select="h263_decoder"
-msmpeg4v1_encoder_select="h263_encoder"
-msmpeg4v2_decoder_select="h263_decoder"
-msmpeg4v2_encoder_select="h263_encoder"
-msmpeg4v3_decoder_select="h263_decoder"
-msmpeg4v3_encoder_select="h263_encoder"
-nellymoser_decoder_select="mdct"
-nellymoser_encoder_select="mdct"
-png_decoder_select="zlib"
-png_encoder_select="zlib"
-qcelp_decoder_select="lsp"
-qdm2_decoder_select="mdct rdft"
-rv10_decoder_select="h263_decoder"
-rv10_encoder_select="h263_encoder"
-rv20_decoder_select="h263_decoder"
-rv20_encoder_select="h263_encoder"
-rv30_decoder_select="golomb h264dsp"
-rv40_decoder_select="golomb h264dsp"
-shorten_decoder_select="golomb"
-sipr_decoder_select="lsp"
-snow_decoder_select="dwt"
-snow_encoder_select="aandct dwt"
-sonic_decoder_select="golomb"
-sonic_encoder_select="golomb"
-sonic_ls_encoder_select="golomb"
-svq1_encoder_select="aandct"
-svq3_decoder_select="golomb h264dsp"
-svq3_decoder_suggest="zlib"
-theora_decoder_select="vp3_decoder"
-tiff_decoder_suggest="zlib"
-tiff_encoder_suggest="zlib"
-truehd_decoder_select="mlp_decoder"
-tscc_decoder_select="zlib"
-twinvq_decoder_select="mdct lsp"
-vc1_decoder_select="h263_decoder"
-vc1_dxva2_hwaccel_deps="dxva2api_h DXVA_PictureParameters_wDecodedPictureIndex"
-vc1_dxva2_hwaccel_select="dxva2 vc1_decoder"
-vc1_vaapi_hwaccel_select="vaapi vc1_decoder"
-vc1_vdpau_decoder_select="vdpau vc1_decoder"
-vorbis_decoder_select="mdct"
-vorbis_encoder_select="mdct"
-vp6a_decoder_select="vp6_decoder"
-vp6f_decoder_select="vp6_decoder"
-wmapro_decoder_select="mdct"
-wmav1_decoder_select="mdct"
-wmav1_encoder_select="mdct"
-wmav2_decoder_select="mdct"
-wmav2_encoder_select="mdct"
-wmavoice_decoder_select="lsp rdft dct"
-wmv1_decoder_select="h263_decoder"
-wmv1_encoder_select="h263_encoder"
-wmv2_decoder_select="h263_decoder"
-wmv2_encoder_select="h263_encoder"
-wmv3_decoder_select="vc1_decoder"
-wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
-wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
-wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
-zlib_decoder_select="zlib"
-zlib_encoder_select="zlib"
-zmbv_decoder_select="zlib"
-zmbv_encoder_select="zlib"
-
-vaapi_deps="va_va_h"
-vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
-
-# parsers
-h264_parser_select="golomb h264dsp"
-
-# bitstream_filters
-aac_adtstoasc_bsf_select="aac_parser"
-
-# external libraries
-libdirac_decoder_deps="libdirac !libschroedinger"
-libdirac_encoder_deps="libdirac"
-libfaac_encoder_deps="libfaac"
-libfaad_decoder_deps="libfaad"
-libfaadbin_extralibs='$ldl'
-libgsm_decoder_deps="libgsm"
-libgsm_encoder_deps="libgsm"
-libgsm_ms_decoder_deps="libgsm"
-libgsm_ms_encoder_deps="libgsm"
-libmp3lame_encoder_deps="libmp3lame"
-libopencore_amrnb_decoder_deps="libopencore_amrnb"
-libopencore_amrnb_encoder_deps="libopencore_amrnb"
-libopencore_amrwb_decoder_deps="libopencore_amrwb"
-libopenjpeg_decoder_deps="libopenjpeg"
-libschroedinger_decoder_deps="libschroedinger"
-libschroedinger_encoder_deps="libschroedinger"
-libspeex_decoder_deps="libspeex"
-libtheora_encoder_deps="libtheora"
-libvorbis_encoder_deps="libvorbis"
-libvpx_decoder_deps="libvpx"
-libvpx_encoder_deps="libvpx"
-libx264_encoder_deps="libx264"
-libxvid_encoder_deps="libxvid"
-
-# demuxers / muxers
-ac3_demuxer_deps="ac3_parser"
-asf_stream_muxer_select="asf_muxer"
-avisynth_demuxer_deps="avisynth"
-dirac_demuxer_deps="dirac_parser"
-eac3_demuxer_select="ac3_parser"
-ipod_muxer_select="mov_muxer"
-libnut_demuxer_deps="libnut"
-libnut_muxer_deps="libnut"
-matroska_audio_muxer_select="matroska_muxer"
-matroska_demuxer_suggest="zlib bzlib"
-mov_demuxer_suggest="zlib"
-mp3_demuxer_deps="mpegaudio_parser"
-mp4_muxer_select="mov_muxer"
-mpegtsraw_demuxer_select="mpegts_demuxer"
-mxf_d10_muxer_select="mxf_muxer"
-ogg_demuxer_select="golomb"
-psp_muxer_select="mov_muxer"
-rtsp_demuxer_deps="sdp_demuxer"
-rtsp_muxer_deps="sdp_demuxer"
-rtsp_muxer_select="rtp_muxer"
-sdp_demuxer_deps="rtp_protocol mpegts_demuxer"
-sdp_demuxer_select="asf_demuxer rm_demuxer"
-spdif_muxer_select="aac_parser"
-tg2_muxer_select="mov_muxer"
-tgp_muxer_select="mov_muxer"
-w64_demuxer_deps="wav_demuxer"
-
-# indevs / outdevs
-alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
-alsa_indev_extralibs="-lasound"
-alsa_outdev_deps="alsa_asoundlib_h"
-alsa_outdev_extralibs="-lasound"
-audio_beos_indev_deps="audio_beos"
-audio_beos_indev_extralibs="-lmedia -lbe"
-audio_beos_outdev_deps="audio_beos"
-audio_beos_outdev_extralibs="-lmedia -lbe"
-bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
-dv1394_indev_deps="dv1394 dv_demuxer"
-jack_indev_deps="jack_jack_h"
-jack_indev_extralibs="-ljack"
-libdc1394_indev_deps="libdc1394"
-oss_indev_deps_any="soundcard_h sys_soundcard_h"
-oss_outdev_deps_any="soundcard_h sys_soundcard_h"
-v4l_indev_deps="linux_videodev_h"
-v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
-vfwcap_indev_deps="capCreateCaptureWindow"
-vfwcap_indev_extralibs="-lavicap32"
-x11_grab_device_indev_deps="x11grab XShmCreateImage"
-x11_grab_device_indev_extralibs="-lX11 -lXext -lXfixes"
-
-# protocols
-gopher_protocol_deps="network"
-http_protocol_deps="network"
-http_protocol_select="tcp_protocol"
-rtmp_protocol_deps="tcp_protocol"
-rtp_protocol_deps="udp_protocol"
-tcp_protocol_deps="network"
-udp_protocol_deps="network"
-
-# filters
-movie_filter_deps="avfilter_lavf"
-avfilter_lavf_deps="avformat"
-
-# libraries
-avdevice_deps="avcodec avformat"
-avformat_deps="avcodec"
-
-# programs
-ffmpeg_deps="avcodec avformat swscale"
-ffplay_deps="avcodec avformat swscale sdl"
-ffplay_select="rdft"
-ffprobe_deps="avcodec avformat"
-ffserver_deps="avformat ffm_muxer rtp_protocol rtsp_demuxer"
-ffserver_extralibs='$ldl'
-
-doc_deps="texi2html"
-
-# default parameters
-
-logfile="config.err"
-
-# installation paths
-prefix_default="/usr/local"
-bindir_default='${prefix}/bin'
-datadir_default='${prefix}/share/ffmpeg'
-incdir_default='${prefix}/include'
-libdir_default='${prefix}/lib'
-mandir_default='${prefix}/share/man'
-shlibdir_default="$libdir_default"
-
-# toolchain
-ar_default="ar"
-cc_default="gcc"
-cc_version=\"unknown\"
-host_cc_default="gcc"
-ln_s="ln -sf"
-nm_default="nm"
-objformat="elf"
-ranlib="ranlib"
-strip_default="strip"
-yasmexe="yasm"
-
-nm_opts='-g'
-
-# machine
-arch_default=$(uname -m)
-cpu="generic"
-
-# OS
-target_os_default=$(tolower $(uname -s))
-host_os=$target_os_default
-
-# configurable options
-enable avcodec
-enable avdevice
-enable avformat
-enable avutil
-enable asm
-enable debug
-enable doc
-enable fastdiv
-enable ffmpeg
-enable ffplay
-enable ffprobe
-enable ffserver
-enable mpegaudio_hp
-enable network
-enable optimizations
-enable protocols
-enable static
-enable stripping
-enable swscale
-enable swscale_alpha
-
-# build settings
-SHFLAGS='-shared -Wl,-soname,$$(@F)'
-FFSERVERLDFLAGS=-Wl,-E
-LIBPREF="lib"
-LIBSUF=".a"
-FULLNAME='$(NAME)$(BUILDSUF)'
-LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
-SLIBPREF="lib"
-SLIBSUF=".so"
-SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
-SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
-SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
-LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
-
-CC_O='-o $@'
-
-host_cflags='-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -O3 -g -Wall'
-host_libs='-lm'
-
-target_path='$(CURDIR)'
-
-# gcc stupidly only outputs the basename of targets with -MM, but we need the
-# full relative path for objects in subdirectories for non-recursive Make.
-DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
-DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -MM'
-
-# find source path
-source_path="$(dirname "$0")"
-enable source_path_used
-if test -f configure; then
-    source_path="$(pwd)"
-    disable source_path_used
-else
-    source_path="$(cd "$source_path"; pwd)"
-    echo "$source_path" | grep -q '[[:blank:]]' &&
-        die "Out of tree builds are impossible with whitespace in source path."
-    test -e "$source_path/config.h" &&
-        die "Out of tree builds are impossible with config.h in source dir."
-fi
-
-for v in "$@"; do
-    r=${v#*=}
-    l=${v%"$r"}
-    r=$(sh_quote "$r")
-    FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
-done
-
-find_things(){
-    thing=$1
-    pattern=$2
-    file=$source_path/$3
-    sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
-}
-
-ENCODER_LIST=$(find_things  encoder  ENC      libavcodec/allcodecs.c)
-DECODER_LIST=$(find_things  decoder  DEC      libavcodec/allcodecs.c)
-HWACCEL_LIST=$(find_things  hwaccel  HWACCEL  libavcodec/allcodecs.c)
-PARSER_LIST=$(find_things   parser   PARSER   libavcodec/allcodecs.c)
-BSF_LIST=$(find_things      bsf      BSF      libavcodec/allcodecs.c)
-MUXER_LIST=$(find_things    muxer    _MUX     libavformat/allformats.c)
-DEMUXER_LIST=$(find_things  demuxer  DEMUX    libavformat/allformats.c)
-OUTDEV_LIST=$(find_things   outdev   OUTDEV   libavdevice/alldevices.c)
-INDEV_LIST=$(find_things    indev    _IN      libavdevice/alldevices.c)
-PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
-FILTER_LIST=$(find_things   filter   FILTER   libavfilter/allfilters.c)
-
-for n in $COMPONENT_LIST; do
-    v=$(toupper ${n%s})_LIST
-    eval enable \$$v
-    eval ${n}_if_any="\$$v"
-done
-
-enable $ARCH_EXT_LIST
-
-die_unknown(){
-    echo "Unknown option \"$1\"."
-    echo "See $0 --help for available options."
-    exit 1
-}
-
-show_list() {
-    suffix=_$1
-    shift
-    echo $* | sed s/$suffix//g | tr ' ' '\n' | sort | pr -3 -t
-    exit 0
-}
-
-for opt do
-    optval="${opt#*=}"
-    case "$opt" in
-    --extra-ldflags=*) add_ldflags $optval
-    ;;
-    --extra-libs=*) add_extralibs $optval
-    ;;
-    --disable-devices) disable $INDEV_LIST $OUTDEV_LIST
-    ;;
-    --enable-debug=*) debuglevel="$optval"
-    ;;
-    --disable-everything)
-    map 'eval disable \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
-    ;;
-    --enable-*=*|--disable-*=*)
-    eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
-    is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
-    eval list=\$$(toupper $thing)_LIST
-    name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
-    $action $(filter "$name" $list)
-    ;;
-    --enable-?*|--disable-?*)
-    eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
-    if is_in $option $COMPONENT_LIST; then
-        test $action = disable && action=unset
-        eval $action \$$(toupper ${option%s})_LIST
-    elif is_in $option $CMDLINE_SELECT; then
-        $action $option
-    else
-        die_unknown $opt
-    fi
-    ;;
-    --list-*)
-        NAME="${opt#--list-}"
-        is_in $NAME $COMPONENT_LIST || die_unknown $opt
-        NAME=${NAME%s}
-        eval show_list $NAME \$$(toupper $NAME)_LIST
-    ;;
-    --help|-h) show_help
-    ;;
-    *)
-    optname="${opt%%=*}"
-    optname="${optname#--}"
-    optname=$(echo "$optname" | sed 's/-/_/g')
-    if is_in $optname $CMDLINE_SET; then
-        eval $optname='$optval'
-    elif is_in $optname $CMDLINE_APPEND; then
-        append $optname "$optval"
-    else
-         die_unknown $opt
-    fi
-    ;;
-    esac
-done
-
-disabled logging && logfile=/dev/null
-
-echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
-set >> $logfile
-
-test -n "$cross_prefix" && enable cross_compile
-
-if enabled cross_compile; then
-    test -n "$arch" && test -n "$target_os" ||
-        die "Must specify target arch and OS when cross-compiling"
-fi
-
-set_default arch target_os
-
-ar_default="${cross_prefix}${ar_default}"
-cc_default="${cross_prefix}${cc_default}"
-nm_default="${cross_prefix}${nm_default}"
-ranlib="${cross_prefix}${ranlib}"
-strip_default="${cross_prefix}${strip_default}"
-
-sysinclude_default="${sysroot}/usr/include"
-
-set_default cc nm strip sysinclude
-enabled cross_compile || host_cc_default=$cc
-set_default host_cc
-
-exesuf() {
-    case $1 in
-        mingw32*|cygwin*|*-dos|freedos|opendos|os/2*) echo .exe ;;
-    esac
-}
-
-EXESUF=$(exesuf $target_os)
-HOSTEXESUF=$(exesuf $host_os)
-
-# set temporary file name
-: ${TMPDIR:=$TEMPDIR}
-: ${TMPDIR:=$TMP}
-: ${TMPDIR:=/tmp}
-
-if ! check_cmd type mktemp; then
-    # simple replacement for missing mktemp
-    # NOT SAFE FOR GENERAL USE
-    mktemp(){
-        echo "${2%XXX*}.${HOSTNAME}.${UID}.$$"
-    }
-fi
-
-tmpfile(){
-    tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 &&
-        (set -C; exec > $tmp) 2>/dev/null ||
-        die "Unable to create temporary file in $TMPDIR."
-    append TMPFILES $tmp
-    eval $1=$tmp
-}
-
-trap 'rm -f -- $TMPFILES' EXIT
-trap exit HUP INT TERM
-
-tmpfile TMPC  .c
-tmpfile TMPE  $EXESUF
-tmpfile TMPH  .h
-tmpfile TMPO  .o
-tmpfile TMPS  .S
-tmpfile TMPV  .ver
-tmpfile TMPSH .sh
-
-unset -f mktemp
-
-# make sure we can execute files in $TMPDIR
-cat > $TMPSH 2>> $logfile <<EOF
-#! /bin/sh
-EOF
-chmod +x $TMPSH >> $logfile 2>&1
-if ! $TMPSH >> $logfile 2>&1; then
-    cat <<EOF
-Unable to create and execute files in $TMPDIR.  Set the TMPDIR environment
-variable to another directory and make sure that it is not mounted noexec.
-EOF
-    die "Sanity test failed."
-fi
-
-filter_cflags=echo
-filter_cppflags=echo
-filter_asflags=echo
-
-if   $cc -v 2>&1 | grep -qi ^gcc; then
-    cc_type=gcc
-    cc_version=__VERSION__
-    if ! $cc -dumpversion | grep -q '^2\.'; then
-        CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
-        AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
-    fi
-    speed_cflags='-O3'
-    size_cflags='-Os'
-elif $cc --version 2>/dev/null | grep -q Intel; then
-    cc_type=icc
-    cc_version="AV_STRINGIFY(__INTEL_COMPILER)"
-    CC_DEPFLAGS='-MMD'
-    AS_DEPFLAGS='-MMD'
-    speed_cflags='-O3'
-    size_cflags='-Os'
-    noopt_cflags='-O1'
-elif $cc -v 2>&1 | grep -q xlc; then
-    cc_type=xlc
-    cc_version="AV_STRINGIFY(__IBMC__)"
-    speed_cflags='-O5'
-    size_cflags='-O5 -qcompact'
-elif $cc -V 2>/dev/null | grep -q Compaq; then
-    cc_type=ccc
-    cc_version="AV_STRINGIFY(__DECC_VER)"
-    DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -M'
-    debuglevel=3
-    add_ldflags -Wl,-z,now # calls to libots crash without this
-    speed_cflags='-fast'
-    size_cflags='-O1'
-elif $cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
-    test -d "$sysroot" || die "No valid sysroot specified."
-    cc_type=armcc
-    cc_version="AV_STRINGIFY(__ARMCC_VERSION)"
-    armcc_conf="$PWD/armcc.conf"
-    $cc --arm_linux_configure                 \
-        --arm_linux_config_file="$armcc_conf" \
-        --configure_sysroot="$sysroot"        \
-        --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
-        die "Error creating armcc configuration file."
-    cc="$cc --arm_linux_config_file=$armcc_conf --translate_gcc"
-    as_default="${cross_prefix}gcc"
-    CC_DEPFLAGS='-MMD'
-    AS_DEPFLAGS='-MMD'
-    speed_cflags='-O3'
-    size_cflags='-Os'
-elif $cc -version 2>/dev/null | grep -q TMS470; then
-    cc_type=tms470
-    cc_version="AV_STRINGIFY(__TI_COMPILER_VERSION__)"
-    cc="$cc --gcc --abi=eabi -eo=.o -mc -me"
-    CC_O='-fr=$(@D)'
-    as_default="${cross_prefix}gcc"
-    ld_default="${cross_prefix}gcc"
-    TMPO=$(basename $TMPC .c).o
-    append TMPFILES $TMPO
-    add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__=
-    CC_DEPFLAGS='-ppa -ppd=$(@:.o=.d)'
-    AS_DEPFLAGS='-MMD'
-    speed_cflags='-O3 -mf=5'
-    size_cflags='-O3 -mf=2'
-    filter_cflags=tms470_flags
-    tms470_flags(){
-        for flag; do
-            case $flag in
-                -march=*|-mcpu=*)
-                    case "${flag#*=}" in
-                        armv7-a|cortex-a*)      echo -mv=7a8 ;;
-                        armv7-r|cortex-r*)      echo -mv=7r4 ;;
-                        armv7-m|cortex-m*)      echo -mv=7m3 ;;
-                        armv6*|arm11*)          echo -mv=6   ;;
-                        armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
-                                                echo -mv=5e  ;;
-                        armv4*|arm7*|arm9[24]*) echo -mv=4   ;;
-                    esac
-                    ;;
-                -mfpu=neon)     echo --float_support=vfpv3 --neon ;;
-                -mfpu=vfp)      echo --float_support=vfpv2        ;;
-                -mfpu=vfpv3)    echo --float_support=vfpv3        ;;
-                -msoft-float)   echo --float_support=vfplib       ;;
-                -O[0-3]|-mf=*)  echo $flag                        ;;
-                -g)             echo -g -mn                       ;;
-                -pds=*)         echo $flag                        ;;
-            esac
-        done
-    }
-elif $cc -v 2>&1 | grep -q clang; then
-    cc_type=clang
-    cc_version=__VERSION__
-    CC_DEPFLAGS='-MMD'
-    AS_DEPFLAGS='-MMD'
-    speed_cflags='-O3'
-    size_cflags='-Os'
-elif $cc -V 2>&1 | grep -q Sun; then
-    cc_type=suncc
-    cc_version="AV_STRINGIFY(__SUNPRO_C)"
-    DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
-    DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1'
-    speed_cflags='-O5'
-    size_cflags='-O5 -xspace'
-    filter_cflags=suncc_flags
-    suncc_flags(){
-        for flag; do
-            case $flag in
-                -march=*|-mcpu=*)
-                    case "${flag#*=}" in
-                        native)                   echo -xtarget=native       ;;
-                        v9)                       echo -xarch=sparc          ;;
-                        ultrasparc)               echo -xarch=sparcvis       ;;
-                        ultrasparc3|niagara*)     echo -xarch=sparcvis2      ;;
-                        i586|pentium)             echo -xchip=pentium        ;;
-                        i686|pentiumpro|pentium2) echo -xtarget=pentium_pro  ;;
-                        pentium3*|c3-2)           echo -xtarget=pentium3     ;;
-                        pentium-m)          echo -xarch=sse2 -xchip=pentium3 ;;
-                        pentium4*)          echo -xtarget=pentium4           ;;
-                        prescott|nocona)    echo -xarch=sse3 -xchip=pentium4 ;;
-                        *-sse3)             echo -xarch=sse3                 ;;
-                        core2)              echo -xarch=ssse3 -xchip=core2   ;;
-                        amdfam10|barcelona)       echo -xarch=sse4_1         ;;
-                        athlon-4|athlon-[mx]p)    echo -xarch=ssea           ;;
-                        k8|opteron|athlon64|athlon-fx)
-                                                  echo -xarch=sse2a          ;;
-                        athlon*)                  echo -xarch=pentium_proa   ;;
-                    esac
-                    ;;
-                -std=c99)             echo -xc99              ;;
-                -fomit-frame-pointer) echo -xregs=frameptr    ;;
-                -fPIC)                echo -KPIC -xcode=pic32 ;;
-                -W*,*)                echo $flag              ;;
-                -f*-*|-W*)                                    ;;
-                *)                    echo $flag              ;;
-            esac
-        done
-    }
-fi
-
-test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc"
-
-: ${as_default:=$cc}
-: ${dep_cc_default:=$cc}
-: ${ld_default:=$cc}
-set_default ar as dep_cc ld
-
-test -n "$CC_DEPFLAGS" || CCDEP=$DEPEND_CMD
-test -n "$AS_DEPFLAGS" || ASDEP=$DEPEND_CMD
-
-add_cflags $extra_cflags
-add_asflags $extra_cflags
-
-if test -n "$sysroot"; then
-    case "$cc_type" in
-        gcc)
-            add_cppflags --sysroot="$sysroot"
-            add_ldflags --sysroot="$sysroot"
-        ;;
-        tms470)
-            add_cppflags -I"$sysinclude"
-            add_ldflags  --sysroot="$sysroot"
-        ;;
-        clang)
-            add_cppflags -isysroot "$sysroot"
-            add_ldflags -isysroot "$sysroot"
-        ;;
-    esac
-fi
-
-if test "$cpu" = host; then
-    enabled cross_compile && die "--cpu=host makes no sense when cross-compiling."
-
-    case "$cc_type" in
-        gcc)
-            check_native(){
-                $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
-                sed -n "/$1=/{
-                            s/.*$1=\\([^ ]*\\).*/\\1/
-                            p
-                            q
-                        }" $TMPE
-            }
-            cpu=$(check_native -march || check_native -mcpu)
-        ;;
-    esac
-
-    test "${cpu:-host}" = host && die "--cpu=host not supported with compiler $cc"
-fi
-
-# Deal with common $arch aliases
-case "$arch" in
-    arm*)
-        arch="arm"
-    ;;
-    mips|mipsel|IP*)
-        arch="mips"
-    ;;
-    mips64*)
-        arch="mips"
-        subarch="mips64"
-    ;;
-    parisc|hppa)
-        arch="parisc"
-    ;;
-    parisc64|hppa64)
-        arch="parisc"
-        subarch="parisc64"
-    ;;
-    "Power Macintosh"|ppc|powerpc)
-        arch="ppc"
-    ;;
-    ppc64|powerpc64)
-        arch="ppc"
-        subarch="ppc64"
-    ;;
-    s390|s390x)
-        arch="s390"
-    ;;
-    sh4|sh)
-        arch="sh4"
-    ;;
-    sun4u|sparc64)
-        arch="sparc"
-        subarch="sparc64"
-    ;;
-    i[3-6]86|i86pc|BePC|x86_64|amd64)
-        arch="x86"
-    ;;
-esac
-
-is_in $arch $ARCH_LIST || echo "WARNING: unknown arch $arch"
-enable $arch
-
-# Add processor-specific flags
-if test "$cpu" = generic; then
-    : do nothing
-elif enabled ppc; then
-
-    case $(tolower $cpu) in
-        601|ppc601|powerpc601)
-            cpuflags="-mcpu=601"
-            disable altivec
-        ;;
-        603*|ppc603*|powerpc603*)
-            cpuflags="-mcpu=603"
-            disable altivec
-        ;;
-        604*|ppc604*|powerpc604*)
-            cpuflags="-mcpu=604"
-            disable altivec
-        ;;
-        g3|75*|ppc75*|powerpc75*)
-            cpuflags="-mcpu=750 -mpowerpc-gfxopt"
-            disable altivec
-        ;;
-        g4|745*|ppc745*|powerpc745*)
-            cpuflags="-mcpu=7450 -mpowerpc-gfxopt"
-        ;;
-        74*|ppc74*|powerpc74*)
-            cpuflags="-mcpu=7400 -mpowerpc-gfxopt"
-        ;;
-        g5|970|ppc970|powerpc970|power4*)
-            cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
-        ;;
-        cell)
-            cpuflags="-mcpu=cell"
-            enable ldbrx
-        ;;
-        e500v2)
-            cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
-            disable altivec
-        ;;
-        e500)
-            cpuflags="-mcpu=8540 -mhard-float"
-            disable altivec
-        ;;
-    esac
-
-elif enabled x86; then
-
-    case $cpu in
-        i[345]86|pentium)
-            cpuflags="-march=$cpu"
-            disable mmx
-        ;;
-        # targets that do NOT support conditional mov (cmov)
-        pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
-            cpuflags="-march=$cpu"
-            disable cmov
-        ;;
-        # targets that do support conditional mov (cmov)
-        i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2|amdfam10)
-            cpuflags="-march=$cpu"
-            enable cmov
-            enable fast_cmov
-        ;;
-        # targets that do support conditional mov but on which it's slow
-        pentium4|pentium4m|prescott|nocona)
-            cpuflags="-march=$cpu"
-            enable cmov
-            disable fast_cmov
-        ;;
-    esac
-
-elif enabled sparc; then
-
-    case $cpu in
-        sparc64)
-            cpuflags="-mcpu=v9"
-        ;;
-    esac
-
-elif enabled arm; then
-
-    case $cpu in
-        armv*)
-            cpuflags="-march=$cpu"
-        ;;
-        *)
-            cpuflags="-mcpu=$cpu"
-        ;;
-    esac
-
-elif enabled alpha; then
-
-    enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu"
-
-elif enabled bfin; then
-
-    cpuflags="-mcpu=$cpu"
-
-elif enabled mips; then
-
-    cpuflags="-march=$cpu"
-
-elif enabled avr32; then
-
-    case $cpu in
-        ap7[02]0[0-2])
-            subarch="avr32_ap"
-            cpuflags="-mpart=$cpu"
-        ;;
-        ap)
-            subarch="avr32_ap"
-            cpuflags="-march=$cpu"
-        ;;
-        uc3[ab]*)
-            subarch="avr32_uc"
-            cpuflags="-mcpu=$cpu"
-        ;;
-        uc)
-            subarch="avr32_uc"
-            cpuflags="-march=$cpu"
-        ;;
-    esac
-
-fi
-
-add_cflags $cpuflags
-add_asflags $cpuflags
-
-# compiler sanity check
-check_exec <<EOF
-int main(void){ return 0; }
-EOF
-if test "$?" != 0; then
-    echo "$cc is unable to create an executable file."
-    if test -z "$cross_prefix" && ! enabled cross_compile ; then
-        echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
-        echo "Only do this if you know what cross compiling means."
-    fi
-    die "C compiler test failed."
-fi
-
-add_cppflags -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112
-check_cflags -std=c99
-check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
-#include <stdlib.h>
-EOF
-check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
-#include <stdlib.h>
-EOF
-
-check_host_cflags -std=c99
-
-case "$arch" in
-    alpha|ia64|mips|parisc|sparc)
-        spic=$shared
-    ;;
-    x86)
-        subarch="x86_32"
-        check_cc <<EOF && subarch="x86_64"
-        int test[(int)sizeof(char*) - 7];
-EOF
-        if test "$subarch" = "x86_64"; then
-            spic=$shared
-        fi
-    ;;
-esac
-
-enable $subarch
-enabled spic && enable pic
-
-# OS specific
-case $target_os in
-    beos|haiku|zeta)
-        prefix_default="$HOME/config"
-        # 3 gcc releases known for BeOS, each with ugly bugs
-        gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
-        case "$gcc_version" in
-          2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
-            disable mmx
-            ;;
-          *20010315*) echo "BeBits gcc"
-            add_cflags -fno-expensive-optimizations
-            ;;
-        esac
-        SHFLAGS=-nostart
-        # enable BeOS things
-        enable audio_beos
-        # no need for libm, but the inet stuff
-        # Check for BONE
-        # XXX: actually should check for NOT net_server
-        if echo $BEINCLUDES | grep -q 'headers/be/bone'; then
-            network_extralibs="-lbind -lsocket"
-        else
-            enable beos_netserver
-            network_extralibs="-lnet"
-        fi ;;
-    sunos)
-        FFSERVERLDFLAGS=""
-        SHFLAGS='-shared -Wl,-h,$$(@F)'
-        enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
-        network_extralibs="-lsocket -lnsl"
-        add_cppflags -D__EXTENSIONS__
-        nm_opts='-P -g'
-        ;;
-    netbsd)
-        oss_indev_extralibs="-lossaudio"
-        oss_outdev_extralibs="-lossaudio"
-        add_cppflags -D_XOPEN_SOURCE=600
-        ;;
-    openbsd)
-        enable malloc_aligned
-        # On OpenBSD 4.5. the compiler does not use PIC unless
-        # explicitly using -fPIC. Libav builds fine without PIC,
-        # however the generated executable will not do anything
-        # (simply quits with exit-code 1, no crash, no output).
-        # Thus explicitly enable PIC here.
-        enable pic
-        SHFLAGS='-shared'
-        oss_indev_extralibs="-lossaudio"
-        oss_outdev_extralibs="-lossaudio"
-        ;;
-    freebsd|dragonfly)
-        enable malloc_aligned
-        ;;
-    bsd/os)
-        osextralibs="-lpoll -lgnugetopt"
-        strip="strip -d"
-        ;;
-    darwin)
-        enable malloc_aligned
-        SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR) -Wl,-read_only_relocs,suppress'
-        strip="strip -x"
-        FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
-        SLIBSUF=".dylib"
-        SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
-        SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
-        FFSERVERLDFLAGS=-Wl,-bind_at_load
-        objformat="macho"
-        enabled x86_64 && objformat="macho64"
-        enabled_any pic shared ||
-            { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
-        ;;
-    mingw32*)
-        if test $target_os = "mingw32ce"; then
-            disable network
-        else
-            target_os=mingw32
-        fi
-        LIBTARGET=i386
-        if enabled x86_64; then
-            enable malloc_aligned
-            LIBTARGET=x64
-        elif enabled arm; then
-            LIBTARGET=arm
-        fi
-        shlibdir_default="$bindir_default"
-        disable ffserver
-        SLIBPREF=""
-        SLIBSUF=".dll"
-        SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
-        SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
-        SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'
-        SLIB_INSTALL_EXTRA_CMD='-install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"; \
-            install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)"; \
-            install -d "$(LIBDIR)"; \
-            install -m 644 $(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) "$(LIBDIR)/lib$(SLIBNAME:$(SLIBSUF)=.dll.a)"'
-        SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
-        SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
-        objformat="win32"
-        enable dos_paths
-        check_cflags -fno-common
-        if ! enabled x86_64; then
-            check_cpp_condition _mingw.h "(__MINGW32_MAJOR_VERSION > 3) || (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
-                die "ERROR: MinGW runtime version must be >= 3.15."
-            enabled_any avisynth vfwcap_indev &&
-                { check_cpp_condition w32api.h "(__W32API_MAJOR_VERSION > 3) || (__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION >= 13)" ||
-                  die "ERROR: avisynth and vfwcap_indev require w32api version 3.13 or later."; }
-        fi
-        ;;
-    cygwin*)
-        target_os=cygwin
-        shlibdir_default="$bindir_default"
-        SLIBPREF="cyg"
-        SLIBSUF=".dll"
-        SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
-        SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
-        SHFLAGS='-shared -Wl,--enable-auto-image-base'
-        objformat="win32"
-        enable dos_paths
-        check_cflags -fno-common
-        ;;
-    *-dos|freedos|opendos)
-        disable ffplay ffserver
-        disable $INDEV_LIST $OUTDEV_LIST
-        network_extralibs="-lsocket"
-        objformat="coff"
-        enable dos_paths
-        ;;
-    linux)
-        enable dv1394
-        ;;
-    irix*)
-        target_os=irix
-        ranlib="echo ignoring ranlib"
-        ;;
-    os/2*)
-        strip="lxlite"
-        ln_s="cp -f"
-        FFLDFLAGS="-Zomf -Zbin-files -Zargs-wild -Zmap"
-        SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
-        FFSERVERLDFLAGS=""
-        LIBSUF="_s.a"
-        SLIBPREF=""
-        SLIBSUF=".dll"
-        SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
-        SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
-        SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
-          echo PROTMODE >> $(SUBDIR)$(NAME).def; \
-          echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
-          echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
-          echo EXPORTS >> $(SUBDIR)$(NAME).def; \
-          emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def'
-        SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
-          emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
-        SLIB_INSTALL_EXTRA_CMD='install -m 644 $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib "$(LIBDIR)"'
-        SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.a "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.lib'
-        enable dos_paths
-        ;;
-    gnu/kfreebsd)
-        ;;
-    gnu)
-        ;;
-    none)
-        ;;
-    *)
-        die "Unknown OS '$target_os'."
-        ;;
-esac
-
-check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic
-
-set_default $PATHS_LIST
-
-add_extralibs $osextralibs
-
-# Combine FFLDFLAGS and the LDFLAGS environment variable.
-LDFLAGS="$FFLDFLAGS $LDFLAGS"
-
-# we need to build at least one lib type
-if ! enabled_any static shared; then
-    cat <<EOF
-At least one library type must be built.
-Specify --enable-static to build the static libraries or --enable-shared to
-build the shared libraries as well. To only build the shared libraries specify
---disable-static in addition to --enable-shared.
-EOF
-    exit 1;
-fi
-
-disabled static && LIBNAME=""
-
-if enabled_any libfaad libfaadbin ; then
-    if check_header faad.h; then
-        check_cc <<EOF
-#include <faad.h>
-#ifndef FAAD2_VERSION
-ok faad1
-#endif
-int main(void) { return 0; }
-EOF
-        test $? = 0 && enable libfaad2
-    else
-        die "FAAD test failed."
-    fi
-fi
-
-
-die_license_disabled() {
-    enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
-}
-
-die_license_disabled gpl libfaad2
-die_license_disabled gpl libx264
-die_license_disabled gpl libxvid
-die_license_disabled gpl postproc
-die_license_disabled gpl x11grab
-
-die_license_disabled nonfree libfaac
-
-die_license_disabled version3 libopencore_amrnb
-die_license_disabled version3 libopencore_amrwb
-
-enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
-
-check_deps $ARCH_EXT_LIST
-
-disabled optimizations || check_cflags -fomit-frame-pointer
-
-enable_pic() {
-    enable pic
-    add_cppflags -DPIC
-    add_cflags   -fPIC
-    add_asflags  -fPIC
-}
-
-enabled pic && enable_pic
-
-check_cc <<EOF || die "Symbol mangling check failed."
-int ff_extern;
-EOF
-sym=$($nm $nm_opts $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
-extern_prefix=${sym%%ff_extern*}
-
-check_cc <<EOF && enable inline_asm
-void foo(void) { __asm__ volatile ("" ::); }
-EOF
-
-_restrict=
-for restrict_keyword in restrict __restrict__ __restrict; do
-    check_cc <<EOF && _restrict=$restrict_keyword && break
-void foo(char * $restrict_keyword p);
-EOF
-done
-
-check_cc <<EOF && enable attribute_packed
-struct { int x; } __attribute__((packed)) x;
-EOF
-
-check_cc <<EOF && enable attribute_may_alias
-union { int x; } __attribute__((may_alias)) x;
-EOF
-
-check_cc <<EOF || die "endian test failed"
-unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
-EOF
-od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
-
-if enabled alpha; then
-
-    check_cflags -mieee
-
-elif enabled arm; then
-
-    check_cflags -marm
-
-    check_ld <<EOF && enable vfp_args
-__asm__ (".eabi_attribute 28, 1");
-int main(void) { return 0; }
-EOF
-
-    # We have to check if pld is a nop and disable it.
-    check_asm pld '"pld [r0]"'
-
-    enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"'
-    enabled armv6   && check_asm armv6   '"sadd16 r0, r0, r0"'
-    enabled armv6t2 && check_asm armv6t2 '"movt r0, #0"'
-    enabled armvfp  && check_asm armvfp  '"fadds s0, s0, s0"'
-    enabled iwmmxt  && check_asm iwmmxt  '"wunpckelub wr6, wr4"'
-    enabled neon    && check_asm neon    '"vadd.i16 q0, q0, q0"'
-
-    enabled_all armv6t2 shared !pic && enable_pic
-
-elif enabled mips; then
-
-    check_asm loongson '"dmult.g $1, $2, $3"'
-    enabled mmi     && check_asm mmi     '"lq $2, 0($2)"'
-
-elif enabled ppc; then
-
-    enable local_aligned_8 local_aligned_16
-
-    check_asm dcbzl     '"dcbzl 0, 1"'
-    check_asm ppc4xx    '"maclhw r10, r11, r12"'
-    check_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
-
-    # AltiVec flags: The FSF version of GCC differs from the Apple version
-    if enabled altivec; then
-        check_cflags -maltivec -mabi=altivec &&
-        { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
-        check_cflags -faltivec
-
-        # check if our compiler supports Motorola AltiVec C API
-        check_cc <<EOF || disable altivec
-$inc_altivec_h
-int main(void) {
-    vector signed int v1, v2, v3;
-    v1 = vec_add(v2,v3);
-    return 0;
-}
-EOF
-
-        # check if our compiler supports braces for vector declarations
-        check_cc <<EOF || die "You need a compiler that supports {} in AltiVec vector declarations."
-$inc_altivec_h
-int main (void) { (vector int) {1}; return 0; }
-EOF
-    fi
-
-elif enabled sparc; then
-
-    enabled vis && check_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc &&
-        add_cflags -mcpu=ultrasparc -mtune=ultrasparc
-
-elif enabled x86; then
-
-    enable local_aligned_8 local_aligned_16
-
-    # check whether EBP is available on x86
-    # As 'i' is stored on the stack, this program will crash
-    # if the base pointer is used to access it because the
-    # base pointer is cleared in the inline assembly code.
-    check_exec_crash <<EOF && enable ebp_available
-    volatile int i=0;
-    __asm__ volatile (
-        "xorl %%ebp, %%ebp"
-    ::: "%ebp");
-    return i;
-EOF
-
-    # check whether EBX is available on x86
-    check_asm ebx_available '""::"b"(0)' &&
-        check_asm ebx_available '"":::"%ebx"'
-
-    # check whether more than 10 operands are supported
-    check_cc <<EOF && enable ten_operands
-int main(void) {
-    int x=0;
-    __asm__ volatile(
-        ""
-        :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
-    );
-    return 0;
-}
-EOF
-
-    # check whether binutils is new enough to compile SSSE3/MMX2
-    enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
-    enabled mmx2  && check_asm mmx2  '"pmaxub %mm0, %mm1"'
-
-    check_asm bswap '"bswap %%eax" ::: "%eax"'
-
-    YASMFLAGS="-f $objformat -DARCH_$(toupper $subarch)"
-    enabled     x86_64        && append YASMFLAGS "-m amd64"
-    enabled     pic           && append YASMFLAGS "-DPIC"
-    test -n "$extern_prefix"  && append YASMFLAGS "-DPREFIX"
-    case "$objformat" in
-        elf) enabled debug && append YASMFLAGS "-g dwarf2" ;;
-    esac
-    disabled yasm || { check_yasm "pabsw xmm0, xmm0" && enable yasm; }
-
-    case "$cpu" in
-        athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
-            disable fast_clz
-        ;;
-    esac
-
-fi
-
-if check_func dlopen; then
-    ldl=
-elif check_func dlopen -ldl; then
-    ldl=-ldl
-fi
-
-# Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
-check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
-
-check_func  fork
-check_func  getaddrinfo $network_extralibs
-check_func  gethrtime
-check_func  getrusage
-check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
-check_func  inet_aton $network_extralibs
-check_func  isatty
-check_func  ${malloc_prefix}memalign            && enable memalign
-check_func  mkstemp
-check_func  ${malloc_prefix}posix_memalign      && enable posix_memalign
-check_func  setrlimit
-check_func  strerror_r
-check_func_headers io.h setmode
-check_func_headers lzo/lzo1x.h lzo1x_999_compress
-check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
-check_func_headers windows.h GetProcessTimes
-check_func_headers windows.h VirtualAlloc
-
-check_header conio.h
-check_header dlfcn.h
-check_header dxva2api.h
-check_header malloc.h
-check_header poll.h
-check_header sys/mman.h
-check_header sys/resource.h
-check_header sys/select.h
-check_header termios.h
-check_header vdpau/vdpau.h
-check_header vdpau/vdpau_x11.h
-check_header X11/extensions/XvMClib.h
-
-check_struct dxva2api.h DXVA_PictureParameters wDecodedPictureIndex
-
-if ! enabled_any memalign memalign_hack posix_memalign malloc_aligned &&
-     enabled_any $need_memalign ; then
-    die "Error, no aligned memory allocator but SSE enabled, disable it or use --enable-memalign-hack."
-fi
-
-disabled  zlib || check_lib   zlib.h      zlibVersion -lz   || disable  zlib
-disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
-
-# check for some common methods of building with pthread support
-# do this before the optional library checks as some of them require pthreads
-if enabled pthreads; then
-    if check_func pthread_create; then
-        :
-    elif check_func pthread_create -pthread; then
-        add_cflags -pthread
-        add_extralibs -pthread
-    elif check_func pthread_create -pthreads; then
-        add_cflags -pthreads
-        add_extralibs -pthreads
-    elif check_func pthread_create -lpthreadGC2; then
-        add_extralibs -lpthreadGC2
-    elif ! check_lib pthread.h pthread_create -lpthread; then
-        die "ERROR: can't find pthreads library"
-    fi
-fi
-
-for thread in $THREADS_LIST; do
-    if enabled $thread; then
-        test -n "$thread_type" &&
-            die "ERROR: Only one thread type must be selected." ||
-            thread_type="$thread"
-    fi
-done
-
-check_lib math.h sin -lm
-check_lib va/va.h vaInitialize -lva
-
-check_mathfunc exp2
-check_mathfunc exp2f
-check_mathfunc llrint
-check_mathfunc llrintf
-check_mathfunc log2
-check_mathfunc log2f
-check_mathfunc lrint
-check_mathfunc lrintf
-check_mathfunc round
-check_mathfunc roundf
-check_mathfunc truncf
-
-# these are off by default, so fail if requested and not available
-enabled avisynth   && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32
-enabled libdirac   && add_cflags $(pkg-config --cflags dirac) &&
-                      require  libdirac libdirac_decoder/dirac_parser.h dirac_decoder_init $(pkg-config --libs dirac) &&
-                      require  libdirac libdirac_encoder/dirac_encoder.h dirac_encoder_init $(pkg-config --libs dirac)
-enabled libfaac    && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
-enabled libfaad    && require2 libfaad faad.h faacDecOpen -lfaad
-enabled libgsm     && require  libgsm gsm/gsm.h gsm_create -lgsm
-enabled libmp3lame && require  libmp3lame lame/lame.h lame_init -lmp3lame -lm
-enabled libnut     && require  libnut libnut.h nut_demuxer_init -lnut
-enabled libopencore_amrnb  && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb -lm
-enabled libopencore_amrwb  && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb -lm
-enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg
-enabled librtmp    && require  librtmp librtmp/rtmp.h RTMP_Init $(pkg-config --libs librtmp)
-enabled libschroedinger && add_cflags $(pkg-config --cflags schroedinger-1.0) &&
-                           require libschroedinger schroedinger/schro.h schro_init $(pkg-config --libs schroedinger-1.0)
-enabled libspeex   && require  libspeex speex/speex.h speex_decoder_init -lspeex
-enabled libtheora  && require  libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
-enabled libvorbis  && require  libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
-enabled libvpx     && require2 libvpx "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_dec_init_ver" -lvpx &&
-                      require2 libvpx "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver" -lvpx
-enabled libx264    && require  libx264 x264.h x264_encoder_encode -lx264 -lm &&
-                      { check_cpp_condition x264.h "X264_BUILD >= 83" ||
-                        die "ERROR: libx264 version must be >= 0.83."; }
-enabled libxvid    && require  libxvid xvid.h xvid_global -lxvidcore
-enabled mlib       && require  mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
-
-# libdc1394 check
-if enabled libdc1394; then
-    { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
-        enable libdc1394_2; } ||
-    { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
-        enable libdc1394_1; } ||
-    die "ERROR: No version of libdc1394 found "
-fi
-
-SDL_CONFIG="${cross_prefix}sdl-config"
-if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
-    sdl_cflags=$("${SDL_CONFIG}" --cflags)
-    sdl_libs=$("${SDL_CONFIG}" --libs)
-    check_func_headers SDL.h SDL_Init $sdl_cflags $sdl_libs &&
-    check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
-    enable sdl &&
-    check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size
-fi
-
-texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html
-
-if enabled network; then
-    check_type "sys/types.h sys/socket.h" socklen_t
-    check_type netdb.h "struct addrinfo"
-    check_type netinet/in.h "struct ipv6_mreq"
-    check_type netinet/in.h "struct sockaddr_in6"
-    check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
-    check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
-    # Prefer arpa/inet.h over winsock2
-    if check_header arpa/inet.h ; then
-        check_func closesocket
-    elif check_header winsock2.h ; then
-        check_func_headers winsock2.h closesocket -lws2 && \
-            network_extralibs="-lws2" || \
-        { check_func_headers winsock2.h closesocket -lws2_32 && \
-            network_extralibs="-lws2_32"; }
-        check_type ws2tcpip.h socklen_t
-        check_type ws2tcpip.h "struct addrinfo"
-        check_type ws2tcpip.h "struct ipv6_mreq"
-        check_type ws2tcpip.h "struct sockaddr_in6"
-        check_type ws2tcpip.h "struct sockaddr_storage"
-        check_struct winsock2.h "struct sockaddr" sa_len
-    else
-        disable network
-    fi
-fi
-
-check_header linux/videodev.h
-check_header linux/videodev2.h
-check_header sys/videoio.h
-
-check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
-
-# check for ioctl_meteor.h, ioctl_bt848.h and alternatives
-{ check_header dev/bktr/ioctl_meteor.h &&
-  check_header dev/bktr/ioctl_bt848.h; } ||
-{ check_header machine/ioctl_meteor.h &&
-  check_header machine/ioctl_bt848.h; } ||
-{ check_header dev/video/meteor/ioctl_meteor.h &&
-  check_header dev/video/bktr/ioctl_bt848.h; } ||
-check_header dev/ic/bt8xx.h
-
-check_header sys/soundcard.h
-check_header soundcard.h
-
-enabled_any alsa_indev alsa_outdev && check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
-
-enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack
-
-enabled x11grab                         &&
-check_header X11/Xlib.h                 &&
-check_header X11/extensions/XShm.h      &&
-check_header X11/extensions/Xfixes.h    &&
-check_func XOpenDisplay -lX11           &&
-check_func XShmCreateImage -lX11 -lXext &&
-check_func XFixesGetCursorImage -lX11 -lXext -lXfixes
-
-if ! disabled vdpau && enabled vdpau_vdpau_h; then
-check_cpp_condition \
-    vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
-    { echolog "Please upgrade to libvdpau >= 0.2 if you would like vdpau support." &&
-      disable vdpau; }
-fi
-
-enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
-
-# add some useful compiler flags if supported
-check_cflags -Wdeclaration-after-statement
-check_cflags -Wall
-check_cflags -Wno-switch
-check_cflags -Wdisabled-optimization
-check_cflags -Wpointer-arith
-check_cflags -Wredundant-decls
-check_cflags -Wno-pointer-sign
-check_cflags -Wcast-qual
-check_cflags -Wwrite-strings
-check_cflags -Wtype-limits
-check_cflags -Wundef
-check_cflags -Wmissing-prototypes
-enabled extra_warnings && check_cflags -Winline
-
-# add some linker flags
-check_ldflags -Wl,--warn-common
-check_ldflags -Wl,--as-needed
-check_ldflags '-Wl,-rpath-link,\$(BUILD_ROOT)/libpostproc -Wl,-rpath-link,\$(BUILD_ROOT)/libswscale -Wl,-rpath-link,\$(BUILD_ROOT)/libavfilter -Wl,-rpath-link,\$(BUILD_ROOT)/libavdevice -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
-check_ldflags -Wl,-Bsymbolic
-
-echo "X{};" > $TMPV
-if test_ldflags -Wl,--version-script,$TMPV; then
-    append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
-    check_cc <<EOF && enable symver_asm_label
-void ff_foo(void) __asm__ ("av_foo at VERSION");
-void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
-EOF
-    check_cc <<EOF && enable symver_gnu_asm
-__asm__(".symver ff_foo,av_foo at VERSION");
-void ff_foo(void) {}
-EOF
-fi
-
-if enabled small; then
-    add_cflags $size_cflags
-    optimizations="small"
-elif enabled optimizations; then
-    add_cflags $speed_cflags
-else
-    add_cflags $noopt_cflags
-fi
-check_cflags -fno-math-errno
-check_cflags -fno-signed-zeros
-
-if enabled icc; then
-    # Just warnings, no remarks
-    check_cflags -w1
-    # -wd: Disable following warnings
-    # 144, 167, 556: -Wno-pointer-sign
-    # 10006: ignoring unknown option -fno-signed-zeros
-    # 10156: ignoring option '-W'; no argument required
-    check_cflags -wd144,167,556,10006,10156
-    # 11030: Warning unknown option --as-needed
-    # 10156: ignoring option '-export'; no argument required
-    check_ldflags -wd10156,11030
-    # Allow to compile with optimizations
-    check_ldflags -march=$cpu
-    # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
-    enable ebp_available
-elif enabled ccc; then
-    # disable some annoying warnings
-    add_cflags -msg_disable cvtu32to64
-    add_cflags -msg_disable embedcomment
-    add_cflags -msg_disable needconstext
-    add_cflags -msg_disable nomainieee
-    add_cflags -msg_disable ptrmismatch1
-    add_cflags -msg_disable unreachcode
-elif enabled gcc; then
-    check_cflags -fno-tree-vectorize
-    check_cflags -Werror=implicit
-    check_cflags -Werror=missing-prototypes
-elif enabled clang; then
-    check_cflags -Qunused-arguments
-elif enabled armcc; then
-    # 2523: use of inline assembler is deprecated
-    add_cflags -Wrvct,--diag_suppress=2523
-    add_cflags -Wrvct,--diag_suppress=1207
-elif enabled tms470; then
-    add_cflags -pds=824 -pds=837
-fi
-
-if enabled gprof; then
-    add_cflags  -p
-    add_ldflags -p
-fi
-
-# Find out if the .align argument is a power of two or not.
-check_asm asmalign_pot '".align 3"'
-
-enabled_any $THREADS_LIST      && enable threads
-
-check_deps $CONFIG_LIST       \
-           $CONFIG_EXTRA      \
-           $HAVE_LIST         \
-           $DECODER_LIST      \
-           $ENCODER_LIST      \
-           $HWACCEL_LIST      \
-           $PARSER_LIST       \
-           $BSF_LIST          \
-           $DEMUXER_LIST      \
-           $MUXER_LIST        \
-           $FILTER_LIST       \
-           $INDEV_LIST        \
-           $OUTDEV_LIST       \
-           $PROTOCOL_LIST     \
-
-enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
-
-echo "install prefix            $prefix"
-echo "source path               $source_path"
-echo "C compiler                $cc"
-echo ".align is power-of-two    $asmalign_pot"
-echo "ARCH                      $arch ($cpu)"
-if test "$build_suffix" != ""; then
-    echo "build suffix              $build_suffix"
-fi
-if test "$extra_version" != ""; then
-    echo "version string suffix     $extra_version"
-fi
-echo "big-endian                ${bigendian-no}"
-echo "runtime cpu detection     ${runtime_cpudetect-no}"
-if enabled x86; then
-    echo "yasm                      ${yasm-no}"
-    echo "MMX enabled               ${mmx-no}"
-    echo "MMX2 enabled              ${mmx2-no}"
-    echo "3DNow! enabled            ${amd3dnow-no}"
-    echo "3DNow! extended enabled   ${amd3dnowext-no}"
-    echo "SSE enabled               ${sse-no}"
-    echo "SSSE3 enabled             ${ssse3-no}"
-    echo "CMOV enabled              ${cmov-no}"
-    echo "CMOV is fast              ${fast_cmov-no}"
-    echo "EBX available             ${ebx_available-no}"
-    echo "EBP available             ${ebp_available-no}"
-    echo "10 operands supported     ${ten_operands-no}"
-fi
-if enabled arm; then
-    echo "ARMv5TE enabled           ${armv5te-no}"
-    echo "ARMv6 enabled             ${armv6-no}"
-    echo "ARMv6T2 enabled           ${armv6t2-no}"
-    echo "ARM VFP enabled           ${armvfp-no}"
-    echo "IWMMXT enabled            ${iwmmxt-no}"
-    echo "NEON enabled              ${neon-no}"
-fi
-if enabled mips; then
-    echo "MMI enabled               ${mmi-no}"
-fi
-if enabled ppc; then
-    echo "AltiVec enabled           ${altivec-no}"
-    echo "PPC 4xx optimizations     ${ppc4xx-no}"
-    echo "dcbzl available           ${dcbzl-no}"
-    echo "performance report        ${powerpc_perf-no}"
-fi
-if enabled sparc; then
-    echo "VIS enabled               ${vis-no}"
-fi
-echo "gprof enabled             ${gprof-no}"
-echo "debug symbols             ${debug-no}"
-echo "strip symbols             ${stripping-no}"
-echo "optimizations             ${optimizations-no}"
-echo "static                    ${static-no}"
-echo "shared                    ${shared-no}"
-echo "postprocessing support    ${postproc-no}"
-echo "new filter support        ${avfilter-no}"
-echo "filters using lavformat   ${avfilter_lavf-no}"
-echo "network support           ${network-no}"
-echo "threading support         ${thread_type-no}"
-echo "SDL support               ${sdl-no}"
-echo "Sun medialib support      ${mlib-no}"
-echo "AVISynth enabled          ${avisynth-no}"
-echo "libdc1394 support         ${libdc1394-no}"
-echo "libdirac enabled          ${libdirac-no}"
-echo "libfaac enabled           ${libfaac-no}"
-echo "libfaad enabled           ${libfaad-no}"
-echo "libfaad dlopened          ${libfaadbin-no}"
-echo "libgsm enabled            ${libgsm-no}"
-echo "libmp3lame enabled        ${libmp3lame-no}"
-echo "libnut enabled            ${libnut-no}"
-echo "libopencore-amrnb support ${libopencore_amrnb-no}"
-echo "libopencore-amrwb support ${libopencore_amrwb-no}"
-echo "libopenjpeg enabled       ${libopenjpeg-no}"
-echo "librtmp enabled           ${librtmp-no}"
-echo "libschroedinger enabled   ${libschroedinger-no}"
-echo "libspeex enabled          ${libspeex-no}"
-echo "libtheora enabled         ${libtheora-no}"
-echo "libvorbis enabled         ${libvorbis-no}"
-echo "libvpx enabled            ${libvpx-no}"
-echo "libx264 enabled           ${libx264-no}"
-echo "libxvid enabled           ${libxvid-no}"
-echo "zlib enabled              ${zlib-no}"
-echo "bzlib enabled             ${bzlib-no}"
-echo
-
-for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
-    echo "Enabled ${type}s:"
-    eval list=\$$(toupper $type)_LIST
-    for part in $list; do
-        enabled $part && echo ${part%_*}
-    done | sort | pr -3 -t
-    echo
-done
-
-license="LGPL version 2.1 or later"
-if enabled nonfree; then
-    license="nonfree and unredistributable"
-elif enabled gplv3; then
-    license="GPL version 3 or later"
-elif enabled lgplv3; then
-    license="LGPL version 3 or later"
-elif enabled gpl; then
-    license="GPL version 2 or later"
-fi
-
-echo "License: $license"
-
-echo "Creating config.mak and config.h..."
-
-# build tree in object directory if source path is different from current one
-if enabled source_path_used; then
-    DIRS="
-        doc
-        libavcodec
-        libavcodec/$arch
-        libavdevice
-        libavfilter
-        libavformat
-        libavutil
-        libavutil/$arch
-        libpostproc
-        libswscale
-        libswscale/$arch
-        tests
-        tools
-    "
-    FILES="
-        Makefile
-        common.mak
-        subdir.mak
-        doc/texi2pod.pl
-        libavcodec/Makefile
-        libavcodec/${arch}/Makefile
-        libavdevice/Makefile
-        libavfilter/Makefile
-        libavformat/Makefile
-        libavutil/Makefile
-        libpostproc/Makefile
-        libswscale/Makefile
-    "
-    map 'mkdir -p $v' $DIRS;
-    map 'test -f "$source_path/$v" && $ln_s "$source_path/$v" $v' $FILES
-fi
-
-enabled stripping || strip="echo skipping strip"
-
-cat > config.mak <<EOF
-# Automatically generated by configure - do not modify!
-ifndef FFMPEG_CONFIG_MAK
-FFMPEG_CONFIG_MAK=1
-FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
-prefix=$prefix
-LIBDIR=\$(DESTDIR)$libdir
-SHLIBDIR=\$(DESTDIR)$shlibdir
-INCDIR=\$(DESTDIR)$incdir
-BINDIR=\$(DESTDIR)$bindir
-DATADIR=\$(DESTDIR)$datadir
-MANDIR=\$(DESTDIR)$mandir
-SRC_PATH="$source_path"
-SRC_PATH_BARE=$source_path
-BUILD_ROOT="$PWD"
-ARCH=$arch
-CC=$cc
-AS=$as
-LD=$ld
-DEPCC=$dep_cc
-YASM=$yasmexe
-YASMDEP=$yasmexe
-AR=$ar
-RANLIB=$ranlib
-CP=cp -p
-LN_S=$ln_s
-STRIP=$strip
-CPPFLAGS=$CPPFLAGS
-CFLAGS=$CFLAGS
-ASFLAGS=$ASFLAGS
-CC_O=$CC_O
-LDFLAGS=$LDFLAGS
-FFSERVERLDFLAGS=$FFSERVERLDFLAGS
-SHFLAGS=$SHFLAGS
-YASMFLAGS=$YASMFLAGS
-BUILDSUF=$build_suffix
-FULLNAME=$FULLNAME
-LIBPREF=$LIBPREF
-LIBSUF=$LIBSUF
-LIBNAME=$LIBNAME
-SLIBPREF=$SLIBPREF
-SLIBSUF=$SLIBSUF
-EXESUF=$EXESUF
-EXTRA_VERSION=$extra_version
-DEPFLAGS=$DEPFLAGS
-CCDEP=$CCDEP
-ASDEP=$ASDEP
-CC_DEPFLAGS=$CC_DEPFLAGS
-AS_DEPFLAGS=$AS_DEPFLAGS
-HOSTCC=$host_cc
-HOSTCFLAGS=$host_cflags
-HOSTEXESUF=$HOSTEXESUF
-HOSTLDFLAGS=$host_ldflags
-HOSTLIBS=$host_libs
-TARGET_EXEC=$target_exec
-TARGET_PATH=$target_path
-SDL_LIBS=$sdl_libs
-SDL_CFLAGS=$sdl_cflags
-LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
-EXTRALIBS=$extralibs
-INSTALL=install
-LIBTARGET=${LIBTARGET}
-SLIBNAME=${SLIBNAME}
-SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
-SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
-SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
-SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
-SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD}
-SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}
-SAMPLES=$samples
-EOF
-
-get_version(){
-    name=$1
-    file=$source_path/$2
-    eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
-    eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
-    lcname=$(tolower $name)
-    eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
-    eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
-}
-
-get_version LIBSWSCALE  libswscale/swscale.h
-get_version LIBPOSTPROC libpostproc/postprocess.h
-get_version LIBAVCODEC  libavcodec/avcodec.h
-get_version LIBAVDEVICE libavdevice/avdevice.h
-get_version LIBAVFORMAT libavformat/avformat.h
-get_version LIBAVUTIL   libavutil/avutil.h
-get_version LIBAVFILTER libavfilter/avfilter.h
-
-enabled asmalign_pot || align_shift="1 <<"
-
-cat > $TMPH <<EOF
-/* Automatically generated by configure - do not modify! */
-#ifndef FFMPEG_CONFIG_H
-#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
-#define FFMPEG_LICENSE "$(c_escape $license)"
-#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
-#define CC_TYPE "$cc_type"
-#define CC_VERSION $cc_version
-#define restrict $_restrict
-#define ASMALIGN(ZEROBITS) ".align $align_shift " #ZEROBITS "\\n\\t"
-#define EXTERN_PREFIX "${extern_prefix}"
-#define EXTERN_ASM ${extern_prefix}
-EOF
-
-test -n "$malloc_prefix" &&
-    echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
-
-if enabled small || disabled optimizations; then
-    echo "#undef  av_always_inline"  >> $TMPH
-    echo "#define av_always_inline"  >> $TMPH
-fi
-
-print_config ARCH_   $TMPH config.mak $ARCH_LIST
-print_config HAVE_   $TMPH config.mak $HAVE_LIST
-print_config CONFIG_ $TMPH config.mak $CONFIG_LIST       \
-                                      $CONFIG_EXTRA      \
-                                      $DECODER_LIST      \
-                                      $ENCODER_LIST      \
-                                      $HWACCEL_LIST      \
-                                      $PARSER_LIST       \
-                                      $BSF_LIST          \
-                                      $DEMUXER_LIST      \
-                                      $MUXER_LIST        \
-                                      $FILTER_LIST       \
-                                      $PROTOCOL_LIST     \
-                                      $INDEV_LIST        \
-                                      $OUTDEV_LIST       \
-
-echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
-echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
-
-# Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
-cp_if_changed $TMPH config.h
-
-cat > $TMPH <<EOF
-/* Generated by ffconf */
-#ifndef AVUTIL_AVCONFIG_H
-#define AVUTIL_AVCONFIG_H
-EOF
-
-print_config AV_HAVE_ $TMPH /dev/null $HAVE_LIST_PUB
-
-echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
-
-cp_if_changed $TMPH libavutil/avconfig.h
-
-# build pkg-config files
-
-pkgconfig_generate(){
-name=$1
-shortname=${name#lib}${build_suffix}
-comment=$2
-version=$3
-libs=$4
-requires=$5
-cat <<EOF > $name/$name.pc
-prefix=$prefix
-exec_prefix=\${prefix}
-libdir=$libdir
-includedir=$incdir
-
-Name: $name
-Description: $comment
-Version: $version
-Requires: $(enabled shared || echo $requires)
-Requires.private: $(enabled shared && echo $requires)
-Conflicts:
-Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs)
-Libs.private: $(enabled shared && echo $libs)
-Cflags: -I\${includedir}
-EOF
-cat <<EOF > $name/$name-uninstalled.pc
-prefix=
-exec_prefix=
-libdir=\${pcfiledir}
-includedir=${source_path}
-
-Name: $name
-Description: $comment
-Version: $version
-Requires: $requires
-Conflicts:
-Libs: \${libdir}/${LIBPREF}${shortname}${LIBSUF} $libs
-Cflags: -I\${includedir}
-EOF
-}
-
-pkgconfig_generate libavutil "Libav utility library" "$LIBAVUTIL_VERSION"
-pkgconfig_generate libavcodec "Libav codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
-pkgconfig_generate libavformat "Libav container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION"
-pkgconfig_generate libavdevice "Libav device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "libavformat = $LIBAVFORMAT_VERSION"
-enabled avfilter &&
-    pkgconfig_generate libavfilter "Libav video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
-enabled postproc &&
-    pkgconfig_generate libpostproc "Libav post processing library" "$LIBPOSTPROC_VERSION"
-pkgconfig_generate libswscale "Libav image rescaling library" "$LIBSWSCALE_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
diff --git a/debian/changelog b/debian/changelog
index 769f227..db505b1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-libav-extra (4:0.6.2-0ubuntu1) natty; urgency=low
+libav-extra (4:0.6.2-1ubuntu1) natty; urgency=low
 
   * rename to libav-extra
 
diff --git a/debian/control b/debian/control
index e837eb9..5cae531 100644
--- a/debian/control
+++ b/debian/control
@@ -16,6 +16,7 @@ Vcs-Browser: http://git.debian.org/?p=pkg-multimedia/libav.git;a=summary
 Homepage: http://libav.org/
 Build-Depends: debhelper (>= 7),
  libasound2-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386],
+ libav-source,
  libbz2-dev,
  libdc1394-22-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386],
  libdirac-dev,
@@ -42,7 +43,6 @@ Build-Depends: debhelper (>= 7),
  libxfixes-dev,
  libxvidcore-dev | libxvidcore4-dev,
  libxvmc-dev,
- quilt,
  texi2html,
  yasm [i386 amd64],
  zlib1g-dev
diff --git a/debian/gbp.conf b/debian/gbp.conf
index cc8019e..7056557 100644
--- a/debian/gbp.conf
+++ b/debian/gbp.conf
@@ -3,4 +3,4 @@ upstream-branch = upstream
 debian-branch = ubuntu.extra
 upstream-tag = upstream/%(version)s
 debian-tag = extra/debian/%(version)s
-pristine-tar = True
+pristine-tar = False
diff --git a/debian/patches/0002-Tweak-doxygen-config.patch b/debian/patches/0002-Tweak-doxygen-config.patch
deleted file mode 100644
index 0b719af..0000000
--- a/debian/patches/0002-Tweak-doxygen-config.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From: Reinhard Tartler <siretart at tauware.de>
-Date: Mon, 28 Jun 2010 22:43:55 +0200
-Subject: [PATCH] Tweak doxygen config
-
-exclude some directories we use for packaging from doxygen documentation
----
- Doxyfile |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/Doxyfile b/Doxyfile
-index ee233b9..1251d34 100644
---- a/Doxyfile
-+++ b/Doxyfile
-@@ -359,7 +359,7 @@ RECURSIVE              = YES
- # excluded from the INPUT source files. This way you can easily exclude a
- # subdirectory from a directory tree whose root is specified with the INPUT tag.
- 
--EXCLUDE                =
-+EXCLUDE                = debian debian-shared debian-static debian-cmov .pc .git
- 
- # The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories
- # that are symbolic links (a Unix filesystem feature) are excluded from the input.
--- 
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index 3949993..0000000
--- a/debian/patches/series
+++ /dev/null
@@ -1 +0,0 @@
-0002-Tweak-doxygen-config.patch
diff --git a/debian/rules b/debian/rules
index 3128ec1..fb85cbd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,7 +1,5 @@
 #!/usr/bin/make -f
 
-include /usr/share/quilt/quilt.make
-
 EPOCH=4:
 DEB_SOURCE := $(shell dpkg-parsechangelog | sed -n 's/^Source: //p')
 DEB_VERSION := $(shell dpkg-parsechangelog | sed -n 's/^Version: //p')
@@ -34,11 +32,14 @@ snapshot_version:
 		cp .svnrevision $@
 	touch $@
 
+libav/configure:
+	tar xvf /usr/src/libav-source.tar.gz
+
 configure-%: configure-stamp-%
-configure-stamp-%: $(QUILT_STAMPFN) snapshot_version
+configure-stamp-%: snapshot_version libav/configure
 	dh_testdir
 	mkdir -p debian-$*
-	cd debian-$* && CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(CURDIR)/configure \
+	cd debian-$* && CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(CURDIR)/libav/configure \
 		$($*_build_confflags) $(extra_$*_build_confflags)
 	touch $@
 
@@ -52,7 +53,7 @@ debian-shared/tools/qt-faststart: build-stamp-shared
 	$(MAKE) -C debian-shared tools/qt-faststart V=1
 
 build-doxy: build-doxy-stamp
-build-doxy-stamp: $(QUILT_STAMPFN)
+build-doxy-stamp:
 	dh_testdir
 	doxygen
 	touch $@
@@ -61,14 +62,14 @@ build: build-stamp
 build-stamp: $(addprefix build-stamp-, $(FLAVORS)) debian-shared/tools/qt-faststart
 	touch $@
 
-clean: clean-real unpatch
+clean: clean-real
 clean-real:
 	dh_testdir
 	dh_testroot
 	rm -f build-stamp $(addprefix build-stamp-, $(FLAVORS)) \
 	    $(addprefix configure-stamp-, $(FLAVORS)) patch-stamp \
 	    build-doxy-stamp
-	rm -rf $(addprefix debian-, $(FLAVORS)) doxy
+	rm -rf $(addprefix debian-, $(FLAVORS)) doxy libav
 	dh_clean
 
 get-orig-source:
@@ -103,12 +104,12 @@ binary-indep: install
 binary-arch: build install codecs.txt formats.txt
 	dh_testdir
 	dh_testroot
-	dh_installdocs $(extradoc) doc/optimization.txt
-	dh_installdocs -A MAINTAINERS CREDITS doc/TODO
+	dh_installdocs $(extradoc) libav/doc/optimization.txt
+	dh_installdocs -A libav/CREDITS libav/doc/TODO
 	dh_installdocs -A debian/README.Debian
 	dh_installdocs -p libavcodec-extra-52 codecs.txt
 	dh_installdocs -p libavformat-extra-52 formats.txt
-	dh_installchangelogs Changelog
+	dh_installchangelogs libav/Changelog
 	dh_lintian
 	dh_link
 	dh_compress
diff --git a/debian/source/format b/debian/source/format
index d3827e7..89ae9db 100644
--- a/debian/source/format
+++ b/debian/source/format
@@ -1 +1 @@
-1.0
+3.0 (native)
diff --git a/doc/APIchanges b/doc/APIchanges
deleted file mode 100644
index db69658..0000000
--- a/doc/APIchanges
+++ /dev/null
@@ -1,239 +0,0 @@
-Never assume the API of libav* to be stable unless at least 1 week has passed since
-the last major version increase.
-The last version increases were:
-libavcodec:  ?
-libavdevice: ?
-libavfilter: 2009-10-18
-libavformat: ?
-libpostproc: ?
-libswscale:  ?
-libavutil:   2009-03-08
-
-
-API changes, most recent first:
-
-2010-06-01 - r31301 - lsws 0.11.0 - convertPalette API
-  Add sws_convertPalette8ToPacked32 and sws_convertPalette8ToPacked24
-
-2010-05-26 - r23334 - lavc 52.72.0 - CODEC_CAP_EXPERIMENTAL
-  Add CODEC_CAP_EXPERIMENTAL flag.
-
-2010-05-18 - r23161 - lavf 52.63.0 - AVFMT_FLAG_RTP_HINT
-  Add AVFMT_FLAG_RTP_HINT as possible value for AVFormatContext.flags
-
-2010-05-01 - r23002 - lavf 52.62.0 - probe function
-  Add av_probe_input_format2 to API, it allows ignoring probe
-  results below given score and returns the actual probe score.
-
-2010-04-01 - r22806 - lavf 52.61.0 - metadata API
-  Add a flag for av_metadata_set2() to disable overwriting of
-  existing tags.
-
-2010-04-01 - r22753 - lavc 52.66.0
-  Add avcodec_get_edge_width()
-
-2010-03-31 - r22750 - lavc 52.65.0
-  Add avcodec_copy_context().
-
-2010-03-31 - r22748 - lavf 52.60.0 - av_match_ext()
-  Make av_match_ext() public.
-
-2010-03-31 - r22736 - lavu 50.14.0 - AVMediaType
-  Move AVMediaType enum from libavcodec to libavutil.
-
-2010-03-31 - r22735 - lavc 52.64.0 - AVMediaType
-  Define AVMediaType enum, and use it instead of enum CodecType, which
-  is deprecated and will be dropped at the next major bump.
-
-2010-03-25 - r22684 - lavu 50.13.0 - av_strerror()
-  Implement av_strerror().
-
-2010-03-23 - r22649 - lavc 52.60.0 - av_dct_init()
-  Support DCT-I and DST-I
-
-2010-03-15 - r22540 - lavf 52.56.0 - AVFormatContext.start_time_realtime
-  Add AVFormatContext.start_time_realtime field.
-
-2010-03-13 - r22506 - lavfi 1.18.0 - AVFilterPicRef.pos
-  Add AVFilterPicRef.pos field.
-
-2010-03-13 - r22501 - lavu 50.12.0 - error.h
-  Move error code definitions from libavcodec/avcodec.h to
-  the new public header libavutil/error.h.
-
-2010-03-07 - r22291 - lavc 52.56.0 - avfft.h
-  Add public FFT interface.
-
-2010-03-06 - r22251 - lavu 50.11.0 - av_stristr()
-  Add av_stristr().
-
-2010-03-03 - r22174 - lavu 50.10.0 - av_tree_enumerate()
-  Add av_tree_enumerate().
-
-2010-02-07 - r21673 - lavu 50.9.0 - av_compare_ts()
-  Add av_compare_ts().
-
-2010-02-05 - r30513 - lsws 0.10.0 - sws_getCoefficients()
-  Add sws_getCoefficients().
-
-2010-02-01 - r21587 - lavf 52.50.0 - metadata API
-  Add a list of generic tag names, change 'author' -> 'artist',
-  'year' -> 'date'.
-
-2010-01-30 - r21545 - lavu 50.8.0 - av_get_pix_fmt()
-  Add av_get_pix_fmt().
-
-2010-01-21 - r30381 - lsws 0.9.0 - sws_scale
-  Change constness attributes of sws_scale() parameters.
-
-2010-01-10 - r21121 - lavfi 1.15.0 - avfilter_graph_config_links()
-  Add a log_ctx parameter to avfilter_graph_config_links().
-
-2010-01-07 - r30236 - lsws 0.8.0 - sws_isSupported{In,Out}put
-  Add sws_isSupportedInput() and sws_isSupportedOutput() functions.
-
-2010-01-06 - r21035 - lavfi 1.14.0 - avfilter_add_colorspace()
-  Change the avfilter_add_colorspace() signature, make it accept an
-  (AVFilterFormats **) rather than an (AVFilterFormats *) as before.
-
-2010-01-03 - r21007 - lavfi 1.13.0 - avfilter_add_colorspace()
-  Add avfilter_add_colorspace().
-
-2010-01-02 - r20998 - lavf 52.46.0 - av_match_ext()
-  Add av_match_ext(), it should be used in place of match_ext().
-
-2010-01-01 - r20991 - lavf 52.45.0 - av_guess_format()
-  Add av_guess_format(), it should be used in place of guess_format().
-
-2009-12-13 - r20834 - lavf 52.43.0 - metadata API
-  Add av_metadata_set2(), AV_METADATA_DONT_STRDUP_KEY and AV_METADATA_DONT_STRDUP_VAL.
-
-2009-12-13 - r20829 - lavu 50.7.0 - avstring.h API
-  Add av_d2str().
-
-2009-12-13 - r20826 - lavc 52.42.0 - AVStream
-  Add avg_frame_rate.
-
-2009-12-12 - r20808 - lavu 50.6.0 - av_bmg_next()
-  Introduce the av_bmg_next() function.
-
-2009-12-05 - r20734 - lavfi 1.12.0 - avfilter_draw_slice()
-  Add a slice_dir parameter to avfilter_draw_slice().
-
-2009-11-26 - r20611 - lavfi 1.11.0 - AVFilter
-  Remove the next field from AVFilter, this is not anymore required.
-
-2009-11-25 - r20607 - lavfi 1.10.0 - avfilter_next()
-  Introduce the avfilter_next() function.
-
-2009-11-25 - r20605 - lavfi 1.9.0 - avfilter_register()
-  Change the signature of avfilter_register() to make it return an
-  int. This is required since now the registration operation may fail.
-
-2009-11-25 - r20603 - lavu 50.5.0 - pixdesc.h API
-  Make the pixdesc.h API public.
-
-2009-10-27 - r20385 - lavfi 1.5.0 - AVFilter.next
-  Add a next field to AVFilter, this is used for simplifying the
-  registration and management of the registered filters.
-
-2009-10-23 - r20356 - lavfi 1.4.1 - AVFilter.description
-  Add a description field to AVFilter.
-
-2009-10-19 - r20302 - lavfi 1.3.0 - avfilter_make_format_list()
-  Change the interface of avfilter_make_format_list() from
-  avfilter_make_format_list(int n, ...) to
-  avfilter_make_format_list(enum PixelFormat *pix_fmts).
-
-2009-10-18 - r20272 - lavfi 1.0.0 - avfilter_get_video_buffer()
-  Make avfilter_get_video_buffer() recursive and add the w and h
-  parameters to it.
-
-2009-10-07 - r20189 - lavfi 0.5.1 - AVFilterPic
-  Add w and h fields to AVFilterPic.
-
-2009-06-22 - r19250 - lavf 52.34.1 - AVFormatContext.packet_size
-  This is now an unsigned int instead of a signed int.
-
-2009-06-19 - r19222 - lavc 52.32.0 - AVSubtitle.pts
-  Add a pts field to AVSubtitle which gives the subtitle packet pts
-  in AV_TIME_BASE. Some subtitle de-/encoders (e.g. XSUB) will
-  not work right without this.
-
-2009-06-03 - r19078 - lavc 52.30.2 - AV_PKT_FLAG_KEY
-  PKT_FLAG_KEY has been deprecated and will be dropped at the next
-  major version. Use AV_PKT_FLAG_KEY instead.
-
-2009-06-01 - r19025 - lavc 52.30.0 - av_lockmgr_register()
-  av_lockmgr_register() can be used to register a callback function
-  that lavc (and in the future, libraries that depend on lavc) can use
-  to implement mutexes. The application should provide a callback function
-  that implements the AV_LOCK_* operations described in avcodec.h.
-  When the lock manager is registered, FFmpeg is guaranteed to behave
-  correctly in a multi-threaded application.
-
-2009-04-30 - r18719 - lavc 52.28.0 - av_free_packet
-  av_free_packet() is no longer an inline function. It is now exported.
-
-2009-04-11 - r18431 - lavc 52.25.0 - deprecate av_destruct_packet_nofree
-  Please use NULL instead. This has been supported since r16506
-  (lavf > 52.23.1, lavc > 52.10.0).
-
-2009-04-07 - r18351 - lavc 52.23.0 - avcodec_decode_video/audio/subtitle
-  The old decoding functions are deprecated, all new code should use the
-  new functions avcodec_decode_video2(), avcodec_decode_audio3() and
-  avcodec_decode_subtitle2(). These new functions take an AVPacket *pkt
-  argument instead of a const uint8_t *buf / int buf_size pair.
-
-2009-04-03 - r18321 - lavu 50.3.0 - av_fifo_space
-  Introduce the av_fifo_space() function.
-
-2009-04-02 - r18317 - lavc 52.23.0 - AVPacket
-  Move AVPacket declaration from libavformat/avformat.h to
-  libavcodec/avcodec.h.
-
-2009-03-22 - r18163 - lavu 50.2.0 - RGB32 pixel formats
-  Convert the pixel formats PIX_FMT_ARGB, PIX_FMT_RGBA, PIX_FMT_ABGR,
-  PIX_FMT_BGRA, which were defined as macros, into enum PixelFormat values.
-  Conversely PIX_FMT_RGB32, PIX_FMT_RGB32_1, PIX_FMT_BGR32 and
-  PIX_FMT_BGR32_1 are now macros.
-  avcodec_get_pix_fmt() now recognizes the "rgb32" and "bgr32" aliases.
-  Re-sort the enum PixelFormat list accordingly.
-  This change breaks API/ABI backward compatibility.
-
-2009-03-22 - r18133 - lavu 50.1.0 - PIX_FMT_RGB5X5 endian variants
-  Add the enum PixelFormat values:
-  PIX_FMT_RGB565BE, PIX_FMT_RGB565LE, PIX_FMT_RGB555BE, PIX_FMT_RGB555LE,
-  PIX_FMT_BGR565BE, PIX_FMT_BGR565LE, PIX_FMT_BGR555BE, PIX_FMT_BGR555LE.
-
-2009-03-21 - r18116 - lavu 50.0.0  - av_random*
-  The Mersenne Twister PRNG implemented through the av_random* functions
-  was removed. Use the lagged Fibonacci PRNG through the av_lfg* functions
-  instead.
-
-2009-03-08 - r17869 - lavu 50.0.0  - AVFifoBuffer
-  av_fifo_init, av_fifo_read, av_fifo_write and av_fifo_realloc were dropped
-  and replaced by av_fifo_alloc, av_fifo_generic_read, av_fifo_generic_write
-  and av_fifo_realloc2.
-  In addition, the order of the function arguments of av_fifo_generic_read
-  was changed to match av_fifo_generic_write.
-  The AVFifoBuffer/struct AVFifoBuffer may only be used in an opaque way by
-  applications, they may not use sizeof() or directly access members.
-
-2009-03-01 - r17682 - lavf 52.31.0 - Generic metadata API
-  Introduce a new metadata API (see av_metadata_get() and friends).
-  The old API is now deprecated and should not be used anymore. This especially
-  includes the following structure fields:
-    - AVFormatContext.title
-    - AVFormatContext.author
-    - AVFormatContext.copyright
-    - AVFormatContext.comment
-    - AVFormatContext.album
-    - AVFormatContext.year
-    - AVFormatContext.track
-    - AVFormatContext.genre
-    - AVStream.language
-    - AVStream.filename
-    - AVProgram.provider_name
-    - AVProgram.name
-    - AVChapter.title
diff --git a/doc/TODO b/doc/TODO
deleted file mode 100644
index f03270e..0000000
--- a/doc/TODO
+++ /dev/null
@@ -1,90 +0,0 @@
-ffmpeg TODO list:
-----------------
-
-Fabrice's TODO list: (unordered)
--------------------
-Short term:
-
-- use AVFMTCTX_DISCARD_PKT in ffplay so that DV has a chance to work
-- add RTSP regression test (both client and server)
-- make ffserver allocate AVFormatContext
-- clean up (incompatible change, for 0.5.0):
-    * AVStream -> AVComponent
-    * AVFormatContext -> AVInputStream/AVOutputStream
-    * suppress rate_emu from AVCodecContext
-- add new float/integer audio filterting and conversion : suppress
-  CODEC_ID_PCM_xxc and use CODEC_ID_RAWAUDIO.
-- fix telecine and frame rate conversion
-
-Long term (ask me if you want to help):
-
-- commit new imgconvert API and new PIX_FMT_xxx alpha formats
-- commit new LGPL'ed float and integer-only AC3 decoder
-- add WMA integer-only decoder
-- add new MPEG4-AAC audio decoder (both integer-only and float version)
-
-Michael's TODO list: (unordered) (if anyone wanna help with sth, just ask)
--------------------
-- optimize H264 CABAC
-- more optimizations
-- simper rate control
-
-Francois' TODO list: (unordered, without any timeframe)
--------------------
-- test MACE decoder against the openquicktime one as suggested by A'rpi
-- BeOS audio input grabbing backend
-- BeOS video input grabbing backend
-- publish my BeOS libposix on BeBits so I can officially support ffserver :)
-- check the whole code for thread-safety (global and init stuff)
-
-Philip'a TODO list: (alphabetically ordered) (please help)
-------------------
-- Add a multi-ffm filetype so that feeds can be recorded into multiple files rather
-  than one big file.
-- Authenticated users support -- where the authentication is in the URL
-- Change ASF files so that the embedded timestamp in the frames is right rather
-  than being an offset from the start of the stream
-- Make ffm files more resilient to changes in the codec structures so that you
-  can play old ffm files.
-
-Baptiste's TODO list:
------------------
-- mov edit list support (AVEditList)
-- YUV 10 bit per component support "2vuy"
-- mxf muxer
-- mpeg2 non linear quantizer
-
-unassigned TODO: (unordered)
----------------
-- use AVFrame for audio codecs too
-- rework aviobuf.c buffering strategy and fix url_fskip
-- generate optimal huffman tables for mjpeg encoding
-- fix ffserver regression tests
-- support xvids motion estimation
-- support x264s motion estimation
-- support x264s rate control
-- SNOW: non translational motion compensation
-- SNOW: more optimal quantization
-- SNOW: 4x4 block support
-- SNOW: 1/8 pel motion compensation support
-- SNOW: iterative motion estimation based on subsampled images
-- SNOW: try B frames and MCTF and see how their PSNR/bitrate/complexity behaves
-- SNOW: try to use the wavelet transformed MC-ed reference frame as context for the entropy coder
-- SNOW: think about/analyize how to make snow use multiple cpus/threads
-- SNOW: finish spec
-- FLAC: lossy encoding (viterbi and naive scalar quantization)
-- libavfilter
-- JPEG2000 decoder & encoder
-- MPEG4 GMC encoding support
-- macroblock based pixel format (better cache locality, somewhat complex, one paper claimed it faster for high res)
-- regression tests for codecs which do not have an encoder (I+P-frame bitstream in svn)
-- add support for using mplayers video filters to ffmpeg
-- H264 encoder
-- per MB ratecontrol (so VCD and such do work better)
-- write a script which iteratively changes all functions between always_inline and noinline and benchmarks the result to find the best set of inlined functions
-- convert all the non SIMD asm into small asm vs. C testcases and submit them to the gcc devels so they can improve gcc
-- generic audio mixing API
-- extract PES packetizer from PS muxer and use it for new TS muxer
-- implement automatic AVBistreamFilter activation
-- make cabac encoder use bytestream (see http://trac.videolan.org/x264/changeset/?format=diff&new=651)
-- merge imdct and windowing, the current code does considerable amounts of redundant work
diff --git a/doc/avutil.txt b/doc/avutil.txt
deleted file mode 100644
index 210bd07..0000000
--- a/doc/avutil.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-AVUtil
-======
-libavutil is a small lightweight library of generally useful functions.
-It is not a library for code needed by both libavcodec and libavformat.
-
-
-Overview:
-=========
-adler32.c               adler32 checksum
-aes.c                   AES encryption and decryption
-fifo.c                  resizeable first in first out buffer
-intfloat_readwrite.c    portable reading and writing of floating point values
-log.c                   "printf" with context and level
-md5.c                   MD5 Message-Digest Algorithm
-rational.c              code to perform exact calculations with rational numbers
-tree.c                  generic AVL tree
-crc.c                   generic CRC checksumming code
-integer.c               128bit integer math
-lls.c
-mathematics.c           greatest common divisor, integer sqrt, integer log2, ...
-mem.c                   memory allocation routines with guaranteed alignment
-softfloat.c
-
-Headers:
-bswap.h                 big/little/native-endian conversion code
-x86_cpu.h               a few useful macros for unifying x86-64 and x86-32 code
-avutil.h
-common.h
-intreadwrite.h          reading and writing of unaligned big/little/native-endian integers
-
-
-Goals:
-======
-* Modular (few interdependencies and the possibility of disabling individual parts during ./configure)
-* Small (source and object)
-* Efficient (low CPU and memory usage)
-* Useful (avoid useless features almost no one needs)
diff --git a/doc/developer.texi b/doc/developer.texi
deleted file mode 100644
index edce7ea..0000000
--- a/doc/developer.texi
+++ /dev/null
@@ -1,436 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle Developer Documentation
- at titlepage
- at sp 7
- at center @titlefont{Developer Documentation}
- at sp 3
- at end titlepage
-
-
- at chapter Developers Guide
-
- at section API
- at itemize @bullet
- at item libavcodec is the library containing the codecs (both encoding and
-decoding). Look at @file{libavcodec/apiexample.c} to see how to use it.
-
- at item libavformat is the library containing the file format handling (mux and
-demux code for several formats). Look at @file{ffplay.c} to use it in a
-player. See @file{libavformat/output-example.c} to use it to generate
-audio or video streams.
-
- at end itemize
-
- at section Integrating libavcodec or libavformat in your program
-
-You can integrate all the source code of the libraries to link them
-statically to avoid any version problem. All you need is to provide a
-'config.mak' and a 'config.h' in the parent directory. See the defines
-generated by ./configure to understand what is needed.
-
-You can use libavcodec or libavformat in your commercial program, but
- at emph{any patch you make must be published}. The best way to proceed is
-to send your patches to the FFmpeg mailing list.
-
- at anchor{Coding Rules}
- at section Coding Rules
-
-FFmpeg is programmed in the ISO C90 language with a few additional
-features from ISO C99, namely:
- at itemize @bullet
- at item
-the @samp{inline} keyword;
- at item
- at samp{//} comments;
- at item
-designated struct initializers (@samp{struct s x = @{ .i = 17 @};})
- at item
-compound literals (@samp{x = (struct s) @{ 17, 23 @};})
- at end itemize
-
-These features are supported by all compilers we care about, so we will not
-accept patches to remove their use unless they absolutely do not impair
-clarity and performance.
-
-All code must compile with GCC 2.95 and GCC 3.3. Currently, FFmpeg also
-compiles with several other compilers, such as the Compaq ccc compiler
-or Sun Studio 9, and we would like to keep it that way unless it would
-be exceedingly involved. To ensure compatibility, please do not use any
-additional C99 features or GCC extensions. Especially watch out for:
- at itemize @bullet
- at item
-mixing statements and declarations;
- at item
- at samp{long long} (use @samp{int64_t} instead);
- at item
- at samp{__attribute__} not protected by @samp{#ifdef __GNUC__} or similar;
- at item
-GCC statement expressions (@samp{(x = (@{ int y = 4; y; @})}).
- at end itemize
-
-Indent size is 4.
-The presentation is one inspired by 'indent -i4 -kr -nut'.
-The TAB character is forbidden outside of Makefiles as is any
-form of trailing whitespace. Commits containing either will be
-rejected by the Subversion repository.
-
-The main priority in FFmpeg is simplicity and small code size in order to
-minimize the bug count.
-
-Comments: Use the JavaDoc/Doxygen
-format (see examples below) so that code documentation
-can be generated automatically. All nontrivial functions should have a comment
-above them explaining what the function does, even if it is just one sentence.
-All structures and their member variables should be documented, too.
- at example
-/**
- * @@file mpeg.c
- * MPEG codec.
- * @@author ...
- */
-
-/**
- * Summary sentence.
- * more text ...
- * ...
- */
-typedef struct Foobar@{
-    int var1; /**< var1 description */
-    int var2; ///< var2 description
-    /** var3 description */
-    int var3;
-@} Foobar;
-
-/**
- * Summary sentence.
- * more text ...
- * ...
- * @@param my_parameter description of my_parameter
- * @@return return value description
- */
-int myfunc(int my_parameter)
-...
- at end example
-
-fprintf and printf are forbidden in libavformat and libavcodec,
-please use av_log() instead.
-
-Casts should be used only when necessary. Unneeded parentheses
-should also be avoided if they don't make the code easier to understand.
-
- at section Development Policy
-
- at enumerate
- at item
-   Contributions should be licensed under the LGPL 2.1, including an
-   "or any later version" clause, or the MIT license.  GPL 2 including
-   an "or any later version" clause is also acceptable, but LGPL is
-   preferred.
- at item
-   You must not commit code which breaks FFmpeg! (Meaning unfinished but
-   enabled code which breaks compilation or compiles but does not work or
-   breaks the regression tests)
-   You can commit unfinished stuff (for testing etc), but it must be disabled
-   (#ifdef etc) by default so it does not interfere with other developers'
-   work.
- at item
-   You do not have to over-test things. If it works for you, and you think it
-   should work for others, then commit. If your code has problems
-   (portability, triggers compiler bugs, unusual environment etc) they will be
-   reported and eventually fixed.
- at item
-   Do not commit unrelated changes together, split them into self-contained
-   pieces. Also do not forget that if part B depends on part A, but A does not
-   depend on B, then A can and should be committed first and separate from B.
-   Keeping changes well split into self-contained parts makes reviewing and
-   understanding them on the commit log mailing list easier. This also helps
-   in case of debugging later on.
-   Also if you have doubts about splitting or not splitting, do not hesitate to
-   ask/discuss it on the developer mailing list.
- at item
-   Do not change behavior of the program (renaming options etc) without
-   first discussing it on the ffmpeg-devel mailing list. Do not remove
-   functionality from the code. Just improve!
-
-   Note: Redundant code can be removed.
- at item
-   Do not commit changes to the build system (Makefiles, configure script)
-   which change behavior, defaults etc, without asking first. The same
-   applies to compiler warning fixes, trivial looking fixes and to code
-   maintained by other developers. We usually have a reason for doing things
-   the way we do. Send your changes as patches to the ffmpeg-devel mailing
-   list, and if the code maintainers say OK, you may commit. This does not
-   apply to files you wrote and/or maintain.
- at item
-   We refuse source indentation and other cosmetic changes if they are mixed
-   with functional changes, such commits will be rejected and removed. Every
-   developer has his own indentation style, you should not change it. Of course
-   if you (re)write something, you can use your own style, even though we would
-   prefer if the indentation throughout FFmpeg was consistent (Many projects
-   force a given indentation style - we do not.). If you really need to make
-   indentation changes (try to avoid this), separate them strictly from real
-   changes.
-
-   NOTE: If you had to put if()@{ .. @} over a large (> 5 lines) chunk of code,
-   then either do NOT change the indentation of the inner part within (do not
-   move it to the right)! or do so in a separate commit
- at item
-   Always fill out the commit log message. Describe in a few lines what you
-   changed and why. You can refer to mailing list postings if you fix a
-   particular bug. Comments such as "fixed!" or "Changed it." are unacceptable.
- at item
-   If you apply a patch by someone else, include the name and email address in
-   the log message. Since the ffmpeg-cvslog mailing list is publicly
-   archived you should add some SPAM protection to the email address. Send an
-   answer to ffmpeg-devel (or wherever you got the patch from) saying that
-   you applied the patch.
- at item
-   When applying patches that have been discussed (at length) on the mailing
-   list, reference the thread in the log message.
- at item
-    Do NOT commit to code actively maintained by others without permission.
-    Send a patch to ffmpeg-devel instead. If no one answers within a reasonable
-    timeframe (12h for build failures and security fixes, 3 days small changes,
-    1 week for big patches) then commit your patch if you think it is OK.
-    Also note, the maintainer can simply ask for more time to review!
- at item
-    Subscribe to the ffmpeg-cvslog mailing list. The diffs of all commits
-    are sent there and reviewed by all the other developers. Bugs and possible
-    improvements or general questions regarding commits are discussed there. We
-    expect you to react if problems with your code are uncovered.
- at item
-    Update the documentation if you change behavior or add features. If you are
-    unsure how best to do this, send a patch to ffmpeg-devel, the documentation
-    maintainer(s) will review and commit your stuff.
- at item
-    Try to keep important discussions and requests (also) on the public
-    developer mailing list, so that all developers can benefit from them.
- at item
-    Never write to unallocated memory, never write over the end of arrays,
-    always check values read from some untrusted source before using them
-    as array index or other risky things.
- at item
-    Remember to check if you need to bump versions for the specific libav
-    parts (libavutil, libavcodec, libavformat) you are changing. You need
-    to change the version integer.
-    Incrementing the first component means no backward compatibility to
-    previous versions (e.g. removal of a function from the public API).
-    Incrementing the second component means backward compatible change
-    (e.g. addition of a function to the public API or extension of an
-    existing data structure).
-    Incrementing the third component means a noteworthy binary compatible
-    change (e.g. encoder bug fix that matters for the decoder).
- at item
-    Compiler warnings indicate potential bugs or code with bad style. If a type of
-    warning always points to correct and clean code, that warning should
-    be disabled, not the code changed.
-    Thus the remaining warnings can either be bugs or correct code.
-    If it is a bug, the bug has to be fixed. If it is not, the code should
-    be changed to not generate a warning unless that causes a slowdown
-    or obfuscates the code.
- at item
-    If you add a new file, give it a proper license header. Do not copy and
-    paste it from a random place, use an existing file as template.
- at end enumerate
-
-We think our rules are not too hard. If you have comments, contact us.
-
-Note, these rules are mostly borrowed from the MPlayer project.
-
- at section Submitting patches
-
-First, (@pxref{Coding Rules}) above if you did not yet.
-
-When you submit your patch, try to send a unified diff (diff '-up'
-option). We cannot read other diffs :-)
-
-Also please do not submit a patch which contains several unrelated changes.
-Split it into separate, self-contained pieces. This does not mean splitting
-file by file. Instead, make the patch as small as possible while still
-keeping it as a logical unit that contains an individual change, even
-if it spans multiple files. This makes reviewing your patches much easier
-for us and greatly increases your chances of getting your patch applied.
-
-Use the patcheck tool of FFmpeg to check your patch.
-The tool is located in the tools directory.
-
-Run the regression tests before submitting a patch so that you can
-verify that there are no big problems.
-
-Patches should be posted as base64 encoded attachments (or any other
-encoding which ensures that the patch will not be trashed during
-transmission) to the ffmpeg-devel mailing list, see
- at url{http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel}
-
-It also helps quite a bit if you tell us what the patch does (for example
-'replaces lrint by lrintf'), and why (for example '*BSD isn't C99 compliant
-and has no lrint()')
-
-Also please if you send several patches, send each patch as a separate mail,
-do not attach several unrelated patches to the same mail.
-
-Your patch will be reviewed on the mailing list. You will likely be asked
-to make some changes and are expected to send in an improved version that
-incorporates the requests from the review. This process may go through
-several iterations. Once your patch is deemed good enough, some developer
-will pick it up and commit it to the official FFmpeg tree.
-
-Give us a few days to react. But if some time passes without reaction,
-send a reminder by email. Your patch should eventually be dealt with.
-
-
- at section New codecs or formats checklist
-
- at enumerate
- at item
-    Did you use av_cold for codec initialization and close functions?
- at item
-    Did you add a long_name under NULL_IF_CONFIG_SMALL to the AVCodec or
-    AVInputFormat/AVOutputFormat struct?
- at item
-    Did you bump the minor version number in @file{avcodec.h} or
-    @file{avformat.h}?
- at item
-    Did you register it in @file{allcodecs.c} or @file{allformats.c}?
- at item
-    Did you add the CodecID to @file{avcodec.h}?
- at item
-    If it has a fourcc, did you add it to @file{libavformat/riff.c},
-    even if it is only a decoder?
- at item
-    Did you add a rule to compile the appropriate files in the Makefile?
-    Remember to do this even if you're just adding a format to a file that is
-    already being compiled by some other rule, like a raw demuxer.
- at item
-    Did you add an entry to the table of supported formats or codecs in
-    @file{doc/general.texi}?
- at item
-    Did you add an entry in the Changelog?
- at item
-    If it depends on a parser or a library, did you add that dependency in
-    configure?
- at item
-    Did you "svn add" the appropriate files before commiting?
- at end enumerate
-
- at section patch submission checklist
-
- at enumerate
- at item
-    Do the regression tests pass with the patch applied?
- at item
-    Does @code{make checkheaders} pass with the patch applied?
- at item
-    Is the patch a unified diff?
- at item
-    Is the patch against latest FFmpeg SVN?
- at item
-    Are you subscribed to ffmpeg-dev?
-    (the list is subscribers only due to spam)
- at item
-    Have you checked that the changes are minimal, so that the same cannot be
-    achieved with a smaller patch and/or simpler final code?
- at item
-    If the change is to speed critical code, did you benchmark it?
- at item
-    If you did any benchmarks, did you provide them in the mail?
- at item
-    Have you checked that the patch does not introduce buffer overflows or
-    other security issues?
- at item
-    Did you test your decoder or demuxer against damaged data? If no, see
-    tools/trasher and the noise bitstream filter. Your decoder or demuxer
-    should not crash or end in a (near) infinite loop when fed damaged data.
- at item
-    Is the patch created from the root of the source tree, so it can be
-    applied with @code{patch -p0}?
- at item
-    Does the patch not mix functional and cosmetic changes?
- at item
-    Did you add tabs or trailing whitespace to the code? Both are forbidden.
- at item
-    Is the patch attached to the email you send?
- at item
-    Is the mime type of the patch correct? It should be text/x-diff or
-    text/x-patch or at least text/plain and not application/octet-stream.
- at item
-    If the patch fixes a bug, did you provide a verbose analysis of the bug?
- at item
-    If the patch fixes a bug, did you provide enough information, including
-    a sample, so the bug can be reproduced and the fix can be verified?
-    Note please do not attach samples >100k to mails but rather provide a
-    URL, you can upload to ftp://upload.ffmpeg.org
- at item
-    Did you provide a verbose summary about what the patch does change?
- at item
-    Did you provide a verbose explanation why it changes things like it does?
- at item
-    Did you provide a verbose summary of the user visible advantages and
-    disadvantages if the patch is applied?
- at item
-    Did you provide an example so we can verify the new feature added by the
-    patch easily?
- at item
-    If you added a new file, did you insert a license header? It should be
-    taken from FFmpeg, not randomly copied and pasted from somewhere else.
- at item
-    You should maintain alphabetical order in alphabetically ordered lists as
-    long as doing so does not break API/ABI compatibility.
- at item
-    Lines with similar content should be aligned vertically when doing so
-    improves readability.
- at item
-    Did you provide a suggestion for a clear commit log message?
- at end enumerate
-
- at section Patch review process
-
-All patches posted to ffmpeg-devel will be reviewed, unless they contain a
-clear note that the patch is not for SVN.
-Reviews and comments will be posted as replies to the patch on the
-mailing list. The patch submitter then has to take care of every comment,
-that can be by resubmitting a changed patch or by discussion. Resubmitted
-patches will themselves be reviewed like any other patch. If at some point
-a patch passes review with no comments then it is approved, that can for
-simple and small patches happen immediately while large patches will generally
-have to be changed and reviewed many times before they are approved.
-After a patch is approved it will be committed to the repository.
-
-We will review all submitted patches, but sometimes we are quite busy so
-especially for large patches this can take several weeks.
-
-When resubmitting patches, please do not make any significant changes
-not related to the comments received during review. Such patches will
-be rejected. Instead, submit  significant changes or new features as
-separate patches.
-
- at section Regression tests
-
-Before submitting a patch (or committing to the repository), you should at least
-test that you did not break anything.
-
-The regression tests build a synthetic video stream and a synthetic
-audio stream. These are then encoded and decoded with all codecs or
-formats. The CRC (or MD5) of each generated file is recorded in a
-result file. A 'diff' is launched to compare the reference results and
-the result file. The output is checked immediately after each test
-has run.
-
-The regression tests then go on to test the FFserver code with a
-limited set of streams. It is important that this step runs correctly
-as well.
-
-Run 'make test' to test all the codecs and formats. Commands like
-'make regtest-mpeg2' can be used to run a single test. By default,
-make will abort if any test fails. To run all tests regardless,
-use make -k. To get a more verbose output, use 'make V=1 test' or
-'make V=2 test'.
-
-Run 'make fulltest' to test all the codecs, formats and FFserver.
-
-[Of course, some patches may change the results of the regression tests. In
-this case, the reference results of the regression tests shall be modified
-accordingly].
-
- at bye
diff --git a/doc/faq.texi b/doc/faq.texi
deleted file mode 100644
index ec01b9e..0000000
--- a/doc/faq.texi
+++ /dev/null
@@ -1,503 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle FFmpeg FAQ
- at titlepage
- at sp 7
- at center @titlefont{FFmpeg FAQ}
- at sp 3
- at end titlepage
-
-
- at chapter General Questions
-
- at section When will the next FFmpeg version be released? / Why are FFmpeg releases so few and far between?
-
-Like most open source projects FFmpeg suffers from a certain lack of
-manpower. For this reason the developers have to prioritize the work
-they do and putting out releases is not at the top of the list, fixing
-bugs and reviewing patches takes precedence. Please don't complain or
-request more timely and/or frequent releases unless you are willing to
-help out creating them.
-
- at section I have a problem with an old version of FFmpeg; where should I report it?
-Nowhere. Upgrade to the latest release or if there is no recent release upgrade
-to Subversion HEAD. You could also try to report it. Maybe you will get lucky and
-become the first person in history to get an answer different from "upgrade
-to Subversion HEAD".
-
- at section Why doesn't FFmpeg support feature [xyz]?
-
-Because no one has taken on that task yet. FFmpeg development is
-driven by the tasks that are important to the individual developers.
-If there is a feature that is important to you, the best way to get
-it implemented is to undertake the task yourself or sponsor a developer.
-
- at section FFmpeg does not support codec XXX. Can you include a Windows DLL loader to support it?
-
-No. Windows DLLs are not portable, bloated and often slow.
-Moreover FFmpeg strives to support all codecs natively.
-A DLL loader is not conducive to that goal.
-
- at section My bug report/mail to ffmpeg-devel/user has not received any replies.
-
-Likely reasons
- at itemize
- at item We are busy and haven't had time yet to read your report or
-investigate the issue.
- at item You didn't follow bugreports.html.
- at item You didn't use Subversion HEAD.
- at item You reported a segmentation fault without gdb output.
- at item You describe a problem but not how to reproduce it.
- at item It's unclear if you use ffmpeg as command line tool or use
-libav* from another application.
- at item You speak about a video having problems on playback but
-not what you use to play it.
- at item We have no faint clue what you are talking about besides
-that it is related to FFmpeg.
- at end itemize
-
- at section Is there a forum for FFmpeg? I do not like mailing lists.
-
-You may view our mailing lists with a more forum-alike look here:
- at url{http://dir.gmane.org/gmane.comp.video.ffmpeg.user},
-but, if you post, please remember that our mailing list rules still apply there.
-
- at section I cannot read this file although this format seems to be supported by ffmpeg.
-
-Even if ffmpeg can read the container format, it may not support all its
-codecs. Please consult the supported codec list in the ffmpeg
-documentation.
-
- at section Which codecs are supported by Windows?
-
-Windows does not support standard formats like MPEG very well, unless you
-install some additional codecs.
-
-The following list of video codecs should work on most Windows systems:
- at table @option
- at item msmpeg4v2
-.avi/.asf
- at item msmpeg4
-.asf only
- at item wmv1
-.asf only
- at item wmv2
-.asf only
- at item mpeg4
-Only if you have some MPEG-4 codec like ffdshow or Xvid installed.
- at item mpeg1
-.mpg only
- at end table
-Note, ASF files often have .wmv or .wma extensions in Windows. It should also
-be mentioned that Microsoft claims a patent on the ASF format, and may sue
-or threaten users who create ASF files with non-Microsoft software. It is
-strongly advised to avoid ASF where possible.
-
-The following list of audio codecs should work on most Windows systems:
- at table @option
- at item adpcm_ima_wav
- at item adpcm_ms
- at item pcm
-always
- at item mp3
-If some MP3 codec like LAME is installed.
- at end table
-
-
- at chapter Compilation
-
- at section @code{error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'}
-
-This is a bug in gcc. Do not report it to us. Instead, please report it to
-the gcc developers. Note that we will not add workarounds for gcc bugs.
-
-Also note that (some of) the gcc developers believe this is not a bug or
-not a bug they should fix:
- at url{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11203}.
-Then again, some of them do not know the difference between an undecidable
-problem and an NP-hard problem...
-
- at chapter Usage
-
- at section ffmpeg does not work; what is wrong?
-
-Try a @code{make distclean} in the ffmpeg source directory before the build. If this does not help see
-(@url{http://ffmpeg.org/bugreports.html}).
-
- at section How do I encode single pictures into movies?
-
-First, rename your pictures to follow a numerical sequence.
-For example, img1.jpg, img2.jpg, img3.jpg,...
-Then you may run:
-
- at example
-  ffmpeg -f image2 -i img%d.jpg /tmp/a.mpg
- at end example
-
-Notice that @samp{%d} is replaced by the image number.
-
- at file{img%03d.jpg} means the sequence @file{img001.jpg}, @file{img002.jpg}, etc...
-
-If you have large number of pictures to rename, you can use the
-following command to ease the burden. The command, using the bourne
-shell syntax, symbolically links all files in the current directory
-that match @code{*jpg} to the @file{/tmp} directory in the sequence of
- at file{img001.jpg}, @file{img002.jpg} and so on.
-
- at example
-  x=1; for i in *jpg; do counter=$(printf %03d $x); ln "$i" /tmp/img"$counter".jpg; x=$(($x+1)); done
- at end example
-
-If you want to sequence them by oldest modified first, substitute
- at code{$(ls -r -t *jpg)} in place of @code{*jpg}.
-
-Then run:
-
- at example
-  ffmpeg -f image2 -i /tmp/img%03d.jpg /tmp/a.mpg
- at end example
-
-The same logic is used for any image format that ffmpeg reads.
-
- at section How do I encode movie to single pictures?
-
-Use:
-
- at example
-  ffmpeg -i movie.mpg movie%d.jpg
- at end example
-
-The @file{movie.mpg} used as input will be converted to
- at file{movie1.jpg}, @file{movie2.jpg}, etc...
-
-Instead of relying on file format self-recognition, you may also use
- at table @option
- at item -vcodec ppm
- at item -vcodec png
- at item -vcodec mjpeg
- at end table
-to force the encoding.
-
-Applying that to the previous example:
- at example
-  ffmpeg -i movie.mpg -f image2 -vcodec mjpeg menu%d.jpg
- at end example
-
-Beware that there is no "jpeg" codec. Use "mjpeg" instead.
-
- at section Why do I see a slight quality degradation with multithreaded MPEG* encoding?
-
-For multithreaded MPEG* encoding, the encoded slices must be independent,
-otherwise thread n would practically have to wait for n-1 to finish, so it's
-quite logical that there is a small reduction of quality. This is not a bug.
-
- at section How can I read from the standard input or write to the standard output?
-
-Use @file{-} as file name.
-
- at section Why does the chrominance data seem to be sampled at a different time from the luminance data on bt8x8 captures on Linux?
-
-This is a well-known bug in the bt8x8 driver. For 2.4.26 there is a patch at
-(@url{http://svn.ffmpeg.org/michael/trunk/patches/bttv-420-2.4.26.patch?view=co}). This may also
-apply cleanly to other 2.4-series kernels.
-
- at section How do I avoid the ugly aliasing artifacts in bt8x8 captures on Linux?
-
-Pass 'combfilter=1 lumafilter=1' to the bttv driver. Note though that 'combfilter=1'
-will cause somewhat too strong filtering. A fix is to apply (@url{http://svn.ffmpeg.org/michael/trunk/patches/bttv-comb-2.4.26.patch?view=co})
-or (@url{http://svn.ffmpeg.org/michael/trunk/patches/bttv-comb-2.6.6.patch?view=co})
-and pass 'combfilter=2'.
-
- at section -f jpeg doesn't work.
-
-Try '-f image2 test%d.jpg'.
-
- at section Why can I not change the framerate?
-
-Some codecs, like MPEG-1/2, only allow a small number of fixed framerates.
-Choose a different codec with the -vcodec command line option.
-
- at section How do I encode Xvid or DivX video with ffmpeg?
-
-Both Xvid and DivX (version 4+) are implementations of the ISO MPEG-4
-standard (note that there are many other coding formats that use this
-same standard). Thus, use '-vcodec mpeg4' to encode in these formats. The
-default fourcc stored in an MPEG-4-coded file will be 'FMP4'. If you want
-a different fourcc, use the '-vtag' option. E.g., '-vtag xvid' will
-force the fourcc 'xvid' to be stored as the video fourcc rather than the
-default.
-
- at section How do I encode videos which play on the iPod?
-
- at table @option
- at item needed stuff
--acodec libfaac -vcodec mpeg4 width<=320 height<=240
- at item working stuff
-4mv, title
- at item non-working stuff
-B-frames
- at item example command line
-ffmpeg -i input -acodec libfaac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv -trellis 2 -aic 2 -cmp 2 -subcmp 2 -s 320x180 -metadata title=X output.mp4
- at end table
-
- at section How do I encode videos which play on the PSP?
-
- at table @option
- at item needed stuff
--acodec libfaac -vcodec mpeg4 width*height<=76800 width%16=0 height%16=0 -ar 24000 -r 30000/1001 or 15000/1001 -f psp
- at item working stuff
-4mv, title
- at item non-working stuff
-B-frames
- at item example command line
-ffmpeg -i input -acodec libfaac -ab 128kb -vcodec mpeg4 -b 1200kb -ar 24000 -mbd 2 -flags +4mv -trellis 2 -aic 2 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -metadata title=X -f psp output.mp4
- at item needed stuff for H.264
--acodec libfaac -vcodec libx264 width*height<=76800 width%16=0? height%16=0? -ar 48000 -coder 1 -r 30000/1001 or 15000/1001 -f psp
- at item working stuff for H.264
-title, loop filter
- at item non-working stuff for H.264
-CAVLC
- at item example command line
-ffmpeg -i input -acodec libfaac -ab 128kb -vcodec libx264 -b 1200kb -ar 48000 -mbd 2 -coder 1 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -metadata title=X -f psp -flags loop -trellis 2 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 output.mp4
- at item higher resolution for newer PSP firmwares, width<=480, height<=272
--vcodec libx264 -level 21 -coder 1 -f psp
- at item example command line
-ffmpeg -i input -acodec libfaac -ab 128kb -ac 2 -ar 48000 -vcodec libx264 -level 21 -b 640kb -coder 1 -f psp -flags +loop -trellis 2 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -g 250 -s 480x272 output.mp4
- at end table
-
- at section Which are good parameters for encoding high quality MPEG-4?
-
-'-mbd rd -flags +4mv+aic -trellis 2 -cmp 2 -subcmp 2 -g 300 -pass 1/2',
-things to try: '-bf 2', '-flags qprd', '-flags mv0', '-flags skiprd'.
-
- at section Which are good parameters for encoding high quality MPEG-1/MPEG-2?
-
-'-mbd rd -trellis 2 -cmp 2 -subcmp 2 -g 100 -pass 1/2'
-but beware the '-g 100' might cause problems with some decoders.
-Things to try: '-bf 2', '-flags qprd', '-flags mv0', '-flags skiprd.
-
- at section Interlaced video looks very bad when encoded with ffmpeg, what is wrong?
-
-You should use '-flags +ilme+ildct' and maybe '-flags +alt' for interlaced
-material, and try '-top 0/1' if the result looks really messed-up.
-
- at section How can I read DirectShow files?
-
-If you have built FFmpeg with @code{./configure --enable-avisynth}
-(only possible on MinGW/Cygwin platforms),
-then you may use any file that DirectShow can read as input.
-(Be aware that this feature has been recently added,
-so you will need to help yourself in case of problems.)
-
-Just create an "input.avs" text file with this single line ...
- at example
-  DirectShowSource("C:\path to your file\yourfile.asf")
- at end example
-... and then feed that text file to FFmpeg:
- at example
-  ffmpeg -i input.avs
- at end example
-
-For ANY other help on Avisynth, please visit @url{http://www.avisynth.org/}.
-
- at section How can I join video files?
-
-A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow to join video files by
-merely concatenating them.
-
-Hence you may concatenate your multimedia files by first transcoding them to
-these privileged formats, then using the humble @code{cat} command (or the
-equally humble @code{copy} under Windows), and finally transcoding back to your
-format of choice.
-
- at example
-ffmpeg -i input1.avi -sameq intermediate1.mpg
-ffmpeg -i input2.avi -sameq intermediate2.mpg
-cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg
-ffmpeg -i intermediate_all.mpg -sameq output.avi
- at end example
-
-Notice that you should either use @code{-sameq} or set a reasonably high
-bitrate for your intermediate and output files, if you want to preserve
-video quality.
-
-Also notice that you may avoid the huge intermediate files by taking advantage
-of named pipes, should your platform support it:
-
- at example
-mkfifo intermediate1.mpg
-mkfifo intermediate2.mpg
-ffmpeg -i input1.avi -sameq -y intermediate1.mpg < /dev/null &
-ffmpeg -i input2.avi -sameq -y intermediate2.mpg < /dev/null &
-cat intermediate1.mpg intermediate2.mpg |\
-ffmpeg -f mpeg -i - -sameq -vcodec mpeg4 -acodec libmp3lame output.avi
- at end example
-
-Similarly, the yuv4mpegpipe format, and the raw video, raw audio codecs also
-allow concatenation, and the transcoding step is almost lossless.
-When using multiple yuv4mpegpipe(s), the first line needs to be discarded
-from all but the first stream. This can be accomplished by piping through
- at code{tail} as seen below. Note that when piping through @code{tail} you
-must use command grouping, @code{@{  ;@}}, to background properly.
-
-For example, let's say we want to join two FLV files into an output.flv file:
-
- at example
-mkfifo temp1.a
-mkfifo temp1.v
-mkfifo temp2.a
-mkfifo temp2.v
-mkfifo all.a
-mkfifo all.v
-ffmpeg -i input1.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > temp1.a < /dev/null &
-ffmpeg -i input2.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > temp2.a < /dev/null &
-ffmpeg -i input1.flv -an -f yuv4mpegpipe - > temp1.v < /dev/null &
-@{ ffmpeg -i input2.flv -an -f yuv4mpegpipe - < /dev/null | tail -n +2 > temp2.v ; @} &
-cat temp1.a temp2.a > all.a &
-cat temp1.v temp2.v > all.v &
-ffmpeg -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
-       -f yuv4mpegpipe -i all.v \
-       -sameq -y output.flv
-rm temp[12].[av] all.[av]
- at end example
-
- at section FFmpeg does not adhere to the -maxrate setting, some frames are bigger than maxrate/fps.
-
-Read the MPEG spec about video buffer verifier.
-
- at section I want CBR, but no matter what I do frame sizes differ.
-
-You do not understand what CBR is, please read the MPEG spec.
-Read about video buffer verifier and constant bitrate.
-The one sentence summary is that there is a buffer and the input rate is
-constant, the output can vary as needed.
-
- at section How do I check if a stream is CBR?
-
-To quote the MPEG-2 spec:
-"There is no way to tell that a bitstream is constant bitrate without
-examining all of the vbv_delay values and making complicated computations."
-
-
- at chapter Development
-
- at section Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat?
-
-Yes. Read the Developers Guide of the FFmpeg documentation. Alternatively,
-examine the source code for one of the many open source projects that
-already incorporate FFmpeg at (@url{projects.html}).
-
- at section Can you support my C compiler XXX?
-
-It depends. If your compiler is C99-compliant, then patches to support
-it are likely to be welcome if they do not pollute the source code
-with @code{#ifdef}s related to the compiler.
-
- at section Is Microsoft Visual C++ supported?
-
-No. Microsoft Visual C++ is not compliant to the C99 standard and does
-not - among other things - support the inline assembly used in FFmpeg.
-If you wish to use MSVC++ for your
-project then you can link the MSVC++ code with libav* as long as
-you compile the latter with a working C compiler. For more information, see
-the @emph{Microsoft Visual C++ compatibility} section in the FFmpeg
-documentation.
-
-There have been efforts to make FFmpeg compatible with MSVC++ in the
-past. However, they have all been rejected as too intrusive, especially
-since MinGW does the job adequately. None of the core developers
-work with MSVC++ and thus this item is low priority. Should you find
-the silver bullet that solves this problem, feel free to shoot it at us.
-
-We strongly recommend you to move over from MSVC++ to MinGW tools.
-
- at section Can I use FFmpeg or libavcodec under Windows?
-
-Yes, but the Cygwin or MinGW tools @emph{must} be used to compile FFmpeg.
-Read the @emph{Windows} section in the FFmpeg documentation to find more
-information.
-
-To get help and instructions for building FFmpeg under Windows, check out
-the FFmpeg Windows Help Forum at
- at url{http://ffmpeg.arrozcru.org/}.
-
- at section Can you add automake, libtool or autoconf support?
-
-No. These tools are too bloated and they complicate the build.
-
- at section Why not rewrite ffmpeg in object-oriented C++?
-
-FFmpeg is already organized in a highly modular manner and does not need to
-be rewritten in a formal object language. Further, many of the developers
-favor straight C; it works for them. For more arguments on this matter,
-read "Programming Religion" at (@url{http://www.tux.org/lkml/#s15}).
-
- at section Why are the ffmpeg programs devoid of debugging symbols?
-
-The build process creates ffmpeg_g, ffplay_g, etc. which contain full debug
-information. Those binaries are stripped to create ffmpeg, ffplay, etc. If
-you need the debug information, used the *_g versions.
-
- at section I do not like the LGPL, can I contribute code under the GPL instead?
-
-Yes, as long as the code is optional and can easily and cleanly be placed
-under #if CONFIG_GPL without breaking anything. So for example a new codec
-or filter would be OK under GPL while a bug fix to LGPL code would not.
-
- at section I want to compile xyz.c alone but my compiler produced many errors.
-
-Common code is in its own files in libav* and is used by the individual
-codecs. They will not work without the common parts, you have to compile
-the whole libav*. If you wish, disable some parts with configure switches.
-You can also try to hack it and remove more, but if you had problems fixing
-the compilation failure then you are probably not qualified for this.
-
- at section I'm using libavcodec from within my C++ application but the linker complains about missing symbols which seem to be available.
-
-FFmpeg is a pure C project, so to use the libraries within your C++ application
-you need to explicitly state that you are using a C library. You can do this by
-encompassing your FFmpeg includes using @code{extern "C"}.
-
-See @url{http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.3}
-
- at section I have a file in memory / a API different from *open/*read/ libc how do I use it with libavformat?
-
-You have to implement a URLProtocol, see libavformat/file.c in FFmpeg
-and libmpdemux/demux_lavf.c in MPlayer sources.
-
- at section I get "No compatible shell script interpreter found." in MSys.
-
-The standard MSys bash (2.04) is broken. You need to install 2.05 or later.
-
- at section I get "./configure: line <xxx>: pr: command not found" in MSys.
-
-The standard MSys install doesn't come with pr. You need to get it from the coreutils package.
-
- at section I tried to pass RTP packets into a decoder, but it doesn't work.
-
-RTP is a container format like any other, you must first depacketize the
-codec frames/samples stored in RTP and then feed to the decoder.
-
- at section Where can I find libav* headers for Pascal/Delphi?
-
-see @url{http://www.iversenit.dk/dev/ffmpeg-headers/}
-
- at section Where is the documentation about ffv1, msmpeg4, asv1, 4xm?
-
-see @url{http://svn.ffmpeg.org/michael/trunk/docs/}
-
- at section How do I feed H.263-RTP (and other codecs in RTP) to libavcodec?
-
-Even if peculiar since it is network oriented, RTP is a container like any
-other. You have to @emph{demux} RTP before feeding the payload to libavcodec.
-In this specific case please look at RFC 4629 to see how it should be done.
-
- at section AVStream.r_frame_rate is wrong, it is much larger than the framerate.
-
-r_frame_rate is NOT the average framerate, it is the smallest framerate
-that can accurately represent all timestamps. So no, it is not
-wrong if it is larger than the average!
-For example, if you have mixed 25 and 30 fps content, then r_frame_rate
-will be 150.
-
- at bye
diff --git a/doc/ffmpeg-doc.texi b/doc/ffmpeg-doc.texi
deleted file mode 100644
index 7be11d2..0000000
--- a/doc/ffmpeg-doc.texi
+++ /dev/null
@@ -1,956 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle FFmpeg Documentation
- at titlepage
- at sp 7
- at center @titlefont{FFmpeg Documentation}
- at sp 3
- at end titlepage
-
-
- at chapter Introduction
-
-FFmpeg is a very fast video and audio converter. It can also grab from
-a live audio/video source.
-
-The command line interface is designed to be intuitive, in the sense
-that FFmpeg tries to figure out all parameters that can possibly be
-derived automatically. You usually only have to specify the target
-bitrate you want.
-
-FFmpeg can also convert from any sample rate to any other, and resize
-video on the fly with a high quality polyphase filter.
-
- at chapter Quick Start
-
- at c man begin EXAMPLES
- at section Video and Audio grabbing
-
-FFmpeg can grab video and audio from devices given that you specify the input
-format and device.
-
- at example
-ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
- at end example
-
-Note that you must activate the right video source and channel before
-launching FFmpeg with any TV viewer such as xawtv
-(@url{http://linux.bytesex.org/xawtv/}) by Gerd Knorr. You also
-have to set the audio recording levels correctly with a
-standard mixer.
-
- at section X11 grabbing
-
-FFmpeg can grab the X11 display.
-
- at example
-ffmpeg -f x11grab -s cif -i :0.0 /tmp/out.mpg
- at end example
-
-0.0 is display.screen number of your X11 server, same as
-the DISPLAY environment variable.
-
- at example
-ffmpeg -f x11grab -s cif -i :0.0+10,20 /tmp/out.mpg
- at end example
-
-0.0 is display.screen number of your X11 server, same as the DISPLAY environment
-variable. 10 is the x-offset and 20 the y-offset for the grabbing.
-
- at section Video and Audio file format conversion
-
-* FFmpeg can use any supported file format and protocol as input:
-
-Examples:
-
-* You can use YUV files as input:
-
- at example
-ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
- at end example
-
-It will use the files:
- at example
-/tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
-/tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
- at end example
-
-The Y files use twice the resolution of the U and V files. They are
-raw files, without header. They can be generated by all decent video
-decoders. You must specify the size of the image with the @option{-s} option
-if FFmpeg cannot guess it.
-
-* You can input from a raw YUV420P file:
-
- at example
-ffmpeg -i /tmp/test.yuv /tmp/out.avi
- at end example
-
-test.yuv is a file containing raw YUV planar data. Each frame is composed
-of the Y plane followed by the U and V planes at half vertical and
-horizontal resolution.
-
-* You can output to a raw YUV420P file:
-
- at example
-ffmpeg -i mydivx.avi hugefile.yuv
- at end example
-
-* You can set several input files and output files:
-
- at example
-ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
- at end example
-
-Converts the audio file a.wav and the raw YUV video file a.yuv
-to MPEG file a.mpg.
-
-* You can also do audio and video conversions at the same time:
-
- at example
-ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
- at end example
-
-Converts a.wav to MPEG audio at 22050 Hz sample rate.
-
-* You can encode to several formats at the same time and define a
-mapping from input stream to output streams:
-
- at example
-ffmpeg -i /tmp/a.wav -ab 64k /tmp/a.mp2 -ab 128k /tmp/b.mp2 -map 0:0 -map 0:0
- at end example
-
-Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. '-map
-file:index' specifies which input stream is used for each output
-stream, in the order of the definition of output streams.
-
-* You can transcode decrypted VOBs:
-
- at example
-ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800k -g 300 -bf 2 -acodec libmp3lame -ab 128k snatch.avi
- at end example
-
-This is a typical DVD ripping example; the input is a VOB file, the
-output an AVI file with MPEG-4 video and MP3 audio. Note that in this
-command we use B-frames so the MPEG-4 stream is DivX5 compatible, and
-GOP size is 300 which means one intra frame every 10 seconds for 29.97fps
-input video. Furthermore, the audio stream is MP3-encoded so you need
-to enable LAME support by passing @code{--enable-libmp3lame} to configure.
-The mapping is particularly useful for DVD transcoding
-to get the desired audio language.
-
-NOTE: To see the supported input formats, use @code{ffmpeg -formats}.
-
-* You can extract images from a video, or create a video from many images:
-
-For extracting images from a video:
- at example
-ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
- at end example
-
-This will extract one video frame per second from the video and will
-output them in files named @file{foo-001.jpeg}, @file{foo-002.jpeg},
-etc. Images will be rescaled to fit the new WxH values.
-
-If you want to extract just a limited number of frames, you can use the
-above command in combination with the -vframes or -t option, or in
-combination with -ss to start extracting from a certain point in time.
-
-For creating a video from many images:
- at example
-ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi
- at end example
-
-The syntax @code{foo-%03d.jpeg} specifies to use a decimal number
-composed of three digits padded with zeroes to express the sequence
-number. It is the same syntax supported by the C printf function, but
-only formats accepting a normal integer are suitable.
-
-* You can put many streams of the same type in the output:
-
- at example
-ffmpeg -i test1.avi -i test2.avi -vcodec copy -acodec copy -vcodec copy -acodec copy test12.avi -newvideo -newaudio
- at end example
-
-In addition to the first video and audio streams, the resulting
-output file @file{test12.avi} will contain the second video
-and the second audio stream found in the input streams list.
-
-The @code{-newvideo}, @code{-newaudio} and @code{-newsubtitle}
-options have to be specified immediately after the name of the output
-file to which you want to add them.
- at c man end
-
- at chapter Invocation
-
- at section Syntax
-
-The generic syntax is:
-
- at example
- at c man begin SYNOPSIS
-ffmpeg [[infile options][@option{-i} @var{infile}]]... @{[outfile options] @var{outfile}@}...
- at c man end
- at end example
- at c man begin DESCRIPTION
-As a general rule, options are applied to the next specified
-file. Therefore, order is important, and you can have the same
-option on the command line multiple times. Each occurrence is
-then applied to the next input or output file.
-
-* To set the video bitrate of the output file to 64kbit/s:
- at example
-ffmpeg -i input.avi -b 64k output.avi
- at end example
-
-* To force the frame rate of the output file to 24 fps:
- at example
-ffmpeg -i input.avi -r 24 output.avi
- at end example
-
-* To force the frame rate of the input file (valid for raw formats only)
-to 1 fps and the frame rate of the output file to 24 fps:
- at example
-ffmpeg -r 1 -i input.m2v -r 24 output.avi
- at end example
-
-The format option may be needed for raw input files.
-
-By default, FFmpeg tries to convert as losslessly as possible: It
-uses the same audio and video parameters for the outputs as the one
-specified for the inputs.
- at c man end
-
- at c man begin OPTIONS
-
- at include fftools-common-opts.texi
-
- at section Main options
-
- at table @option
-
- at item -f @var{fmt}
-Force format.
-
- at item -i @var{filename}
-input file name
-
- at item -y
-Overwrite output files.
-
- at item -t @var{duration}
-Restrict the transcoded/captured video sequence
-to the duration specified in seconds.
- at code{hh:mm:ss[.xxx]} syntax is also supported.
-
- at item -fs @var{limit_size}
-Set the file size limit.
-
- at item -ss @var{position}
-Seek to given time position in seconds.
- at code{hh:mm:ss[.xxx]} syntax is also supported.
-
- at item -itsoffset @var{offset}
-Set the input time offset in seconds.
- at code{[-]hh:mm:ss[.xxx]} syntax is also supported.
-This option affects all the input files that follow it.
-The offset is added to the timestamps of the input files.
-Specifying a positive offset means that the corresponding
-streams are delayed by 'offset' seconds.
-
- at item -timestamp @var{time}
-Set the timestamp.
-
- at item -metadata @var{key}=@var{value}
-Set a metadata key/value pair.
-
-For example, for setting the title in the output file:
- at example
-ffmpeg -i in.avi -metadata title="my title" out.flv
- at end example
-
- at item -v @var{number}
-Set the logging verbosity level.
-
- at item -target @var{type}
-Specify target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd",
-"ntsc-svcd", ... ). All the format options (bitrate, codecs,
-buffer sizes) are then set automatically. You can just type:
-
- at example
-ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
- at end example
-
-Nevertheless you can specify additional options as long as you know
-they do not conflict with the standard, as in:
-
- at example
-ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
- at end example
-
- at item -dframes @var{number}
-Set the number of data frames to record.
-
- at item -scodec @var{codec}
-Force subtitle codec ('copy' to copy stream).
-
- at item -newsubtitle
-Add a new subtitle stream to the current output stream.
-
- at item -slang @var{code}
-Set the ISO 639 language code (3 letters) of the current subtitle stream.
-
- at end table
-
- at section Video Options
-
- at table @option
- at item -b @var{bitrate}
-Set the video bitrate in bit/s (default = 200 kb/s).
- at item -vframes @var{number}
-Set the number of video frames to record.
- at item -r @var{fps}
-Set frame rate (Hz value, fraction or abbreviation), (default = 25).
- at item -s @var{size}
-Set frame size. The format is @samp{wxh} (ffserver default = 160x128, ffmpeg default = same as source).
-The following abbreviations are recognized:
- at table @samp
- at item sqcif
-128x96
- at item qcif
-176x144
- at item cif
-352x288
- at item 4cif
-704x576
- at item 16cif
-1408x1152
- at item qqvga
-160x120
- at item qvga
-320x240
- at item vga
-640x480
- at item svga
-800x600
- at item xga
-1024x768
- at item uxga
-1600x1200
- at item qxga
-2048x1536
- at item sxga
-1280x1024
- at item qsxga
-2560x2048
- at item hsxga
-5120x4096
- at item wvga
-852x480
- at item wxga
-1366x768
- at item wsxga
-1600x1024
- at item wuxga
-1920x1200
- at item woxga
-2560x1600
- at item wqsxga
-3200x2048
- at item wquxga
-3840x2400
- at item whsxga
-6400x4096
- at item whuxga
-7680x4800
- at item cga
-320x200
- at item ega
-640x350
- at item hd480
-852x480
- at item hd720
-1280x720
- at item hd1080
-1920x1080
- at end table
-
- at item -aspect @var{aspect}
-Set aspect ratio (4:3, 16:9 or 1.3333, 1.7777).
- at item -croptop @var{size}
-Set top crop band size (in pixels).
- at item -cropbottom @var{size}
-Set bottom crop band size (in pixels).
- at item -cropleft @var{size}
-Set left crop band size (in pixels).
- at item -cropright @var{size}
-Set right crop band size (in pixels).
- at item -padtop @var{size}
-Set top pad band size (in pixels).
- at item -padbottom @var{size}
-Set bottom pad band size (in pixels).
- at item -padleft @var{size}
-Set left pad band size (in pixels).
- at item -padright @var{size}
-Set right pad band size (in pixels).
- at item -padcolor @var{hex_color}
-Set color of padded bands. The value for padcolor is expressed
-as a six digit hexadecimal number where the first two digits
-represent red, the middle two digits green and last two digits
-blue (default = 000000 (black)).
- at item -vn
-Disable video recording.
- at item -bt @var{tolerance}
-Set video bitrate tolerance (in bits, default 4000k).
-Has a minimum value of: (target_bitrate/target_framerate).
-In 1-pass mode, bitrate tolerance specifies how far ratecontrol is
-willing to deviate from the target average bitrate value. This is
-not related to min/max bitrate. Lowering tolerance too much has
-an adverse effect on quality.
- at item -maxrate @var{bitrate}
-Set max video bitrate (in bit/s).
-Requires -bufsize to be set.
- at item -minrate @var{bitrate}
-Set min video bitrate (in bit/s).
-Most useful in setting up a CBR encode:
- at example
-ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
- at end example
-It is of little use elsewise.
- at item -bufsize @var{size}
-Set video buffer verifier buffer size (in bits).
- at item -vcodec @var{codec}
-Force video codec to @var{codec}. Use the @code{copy} special value to
-tell that the raw codec data must be copied as is.
- at item -sameq
-Use same video quality as source (implies VBR).
-
- at item -pass @var{n}
-Select the pass number (1 or 2). It is used to do two-pass
-video encoding. The statistics of the video are recorded in the first
-pass into a log file (see also the option -passlogfile),
-and in the second pass that log file is used to generate the video
-at the exact requested bitrate.
-On pass 1, you may just deactivate audio and set output to null,
-examples for Windows and Unix:
- at example
-ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y NUL
-ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y /dev/null
- at end example
-
- at item -passlogfile @var{prefix}
-Set two-pass log file name prefix to @var{prefix}, the default file name
-prefix is ``ffmpeg2pass''. The complete file name will be
- at file{PREFIX-N.log}, where N is a number specific to the output
-stream.
-
- at item -newvideo
-Add a new video stream to the current output stream.
-
- at item -vlang @var{code}
-Set the ISO 639 language code (3 letters) of the current video stream.
-
- at end table
-
- at section Advanced Video Options
-
- at table @option
- at item -pix_fmt @var{format}
-Set pixel format. Use 'list' as parameter to show all the supported
-pixel formats.
- at item -sws_flags @var{flags}
-Set SwScaler flags.
- at item -g @var{gop_size}
-Set the group of pictures size.
- at item -intra
-Use only intra frames.
- at item -vdt @var{n}
-Discard threshold.
- at item -qscale @var{q}
-Use fixed video quantizer scale (VBR).
- at item -qmin @var{q}
-minimum video quantizer scale (VBR)
- at item -qmax @var{q}
-maximum video quantizer scale (VBR)
- at item -qdiff @var{q}
-maximum difference between the quantizer scales (VBR)
- at item -qblur @var{blur}
-video quantizer scale blur (VBR) (range 0.0 - 1.0)
- at item -qcomp @var{compression}
-video quantizer scale compression (VBR) (default 0.5).
-Constant of ratecontrol equation. Recommended range for default rc_eq: 0.0-1.0
-
- at item -lmin @var{lambda}
-minimum video lagrange factor (VBR)
- at item -lmax @var{lambda}
-max video lagrange factor (VBR)
- at item -mblmin @var{lambda}
-minimum macroblock quantizer scale (VBR)
- at item -mblmax @var{lambda}
-maximum macroblock quantizer scale (VBR)
-
-These four options (lmin, lmax, mblmin, mblmax) use 'lambda' units,
-but you may use the QP2LAMBDA constant to easily convert from 'q' units:
- at example
-ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
- at end example
-
- at item -rc_init_cplx @var{complexity}
-initial complexity for single pass encoding
- at item -b_qfactor @var{factor}
-qp factor between P- and B-frames
- at item -i_qfactor @var{factor}
-qp factor between P- and I-frames
- at item -b_qoffset @var{offset}
-qp offset between P- and B-frames
- at item -i_qoffset @var{offset}
-qp offset between P- and I-frames
- at item -rc_eq @var{equation}
-Set rate control equation (@pxref{FFmpeg formula
-evaluator}) (default = @code{tex^qComp}).
- at item -rc_override @var{override}
-rate control override for specific intervals
- at item -me_method @var{method}
-Set motion estimation method to @var{method}.
-Available methods are (from lowest to best quality):
- at table @samp
- at item zero
-Try just the (0, 0) vector.
- at item phods
- at item log
- at item x1
- at item hex
- at item umh
- at item epzs
-(default method)
- at item full
-exhaustive search (slow and marginally better than epzs)
- at end table
-
- at item -dct_algo @var{algo}
-Set DCT algorithm to @var{algo}. Available values are:
- at table @samp
- at item 0
-FF_DCT_AUTO (default)
- at item 1
-FF_DCT_FASTINT
- at item 2
-FF_DCT_INT
- at item 3
-FF_DCT_MMX
- at item 4
-FF_DCT_MLIB
- at item 5
-FF_DCT_ALTIVEC
- at end table
-
- at item -idct_algo @var{algo}
-Set IDCT algorithm to @var{algo}. Available values are:
- at table @samp
- at item 0
-FF_IDCT_AUTO (default)
- at item 1
-FF_IDCT_INT
- at item 2
-FF_IDCT_SIMPLE
- at item 3
-FF_IDCT_SIMPLEMMX
- at item 4
-FF_IDCT_LIBMPEG2MMX
- at item 5
-FF_IDCT_PS2
- at item 6
-FF_IDCT_MLIB
- at item 7
-FF_IDCT_ARM
- at item 8
-FF_IDCT_ALTIVEC
- at item 9
-FF_IDCT_SH4
- at item 10
-FF_IDCT_SIMPLEARM
- at end table
-
- at item -er @var{n}
-Set error resilience to @var{n}.
- at table @samp
- at item 1
-FF_ER_CAREFUL (default)
- at item 2
-FF_ER_COMPLIANT
- at item 3
-FF_ER_AGGRESSIVE
- at item 4
-FF_ER_VERY_AGGRESSIVE
- at end table
-
- at item -ec @var{bit_mask}
-Set error concealment to @var{bit_mask}. @var{bit_mask} is a bit mask of
-the following values:
- at table @samp
- at item 1
-FF_EC_GUESS_MVS (default = enabled)
- at item 2
-FF_EC_DEBLOCK (default = enabled)
- at end table
-
- at item -bf @var{frames}
-Use 'frames' B-frames (supported for MPEG-1, MPEG-2 and MPEG-4).
- at item -mbd @var{mode}
-macroblock decision
- at table @samp
- at item 0
-FF_MB_DECISION_SIMPLE: Use mb_cmp (cannot change it yet in FFmpeg).
- at item 1
-FF_MB_DECISION_BITS: Choose the one which needs the fewest bits.
- at item 2
-FF_MB_DECISION_RD: rate distortion
- at end table
-
- at item -4mv
-Use four motion vector by macroblock (MPEG-4 only).
- at item -part
-Use data partitioning (MPEG-4 only).
- at item -bug @var{param}
-Work around encoder bugs that are not auto-detected.
- at item -strict @var{strictness}
-How strictly to follow the standards.
- at item -aic
-Enable Advanced intra coding (h263+).
- at item -umv
-Enable Unlimited Motion Vector (h263+)
-
- at item -deinterlace
-Deinterlace pictures.
- at item -ilme
-Force interlacing support in encoder (MPEG-2 and MPEG-4 only).
-Use this option if your input file is interlaced and you want
-to keep the interlaced format for minimum losses.
-The alternative is to deinterlace the input stream with
- at option{-deinterlace}, but deinterlacing introduces losses.
- at item -psnr
-Calculate PSNR of compressed frames.
- at item -vstats
-Dump video coding statistics to @file{vstats_HHMMSS.log}.
- at item -vstats_file @var{file}
-Dump video coding statistics to @var{file}.
- at item -top @var{n}
-top=1/bottom=0/auto=-1 field first
- at item -dc @var{precision}
-Intra_dc_precision.
- at item -vtag @var{fourcc/tag}
-Force video tag/fourcc.
- at item -qphist
-Show QP histogram.
- at item -vbsf @var{bitstream_filter}
-Bitstream filters available are "dump_extra", "remove_extra", "noise", "h264_mp4toannexb", "imxdump", "mjpegadump".
- at example
-ffmpeg -i h264.mp4 -vcodec copy -vbsf h264_mp4toannexb -an out.h264
- at end example
- at end table
-
- at section Audio Options
-
- at table @option
- at item -aframes @var{number}
-Set the number of audio frames to record.
- at item -ar @var{freq}
-Set the audio sampling frequency (default = 44100 Hz).
- at item -ab @var{bitrate}
-Set the audio bitrate in bit/s (default = 64k).
- at item -aq @var{q}
-Set the audio quality (codec-specific, VBR).
- at item -ac @var{channels}
-Set the number of audio channels (default = 1).
- at item -an
-Disable audio recording.
- at item -acodec @var{codec}
-Force audio codec to @var{codec}. Use the @code{copy} special value to
-specify that the raw codec data must be copied as is.
- at item -newaudio
-Add a new audio track to the output file. If you want to specify parameters,
-do so before @code{-newaudio} (@code{-acodec}, @code{-ab}, etc..).
-
-Mapping will be done automatically, if the number of output streams is equal to
-the number of input streams, else it will pick the first one that matches. You
-can override the mapping using @code{-map} as usual.
-
-Example:
- at example
-ffmpeg -i file.mpg -vcodec copy -acodec ac3 -ab 384k test.mpg -acodec mp2 -ab 192k -newaudio
- at end example
- at item -alang @var{code}
-Set the ISO 639 language code (3 letters) of the current audio stream.
- at end table
-
- at section Advanced Audio options:
-
- at table @option
- at item -atag @var{fourcc/tag}
-Force audio tag/fourcc.
- at item -absf @var{bitstream_filter}
-Bitstream filters available are "dump_extra", "remove_extra", "noise", "mp3comp", "mp3decomp".
- at end table
-
- at section Subtitle options:
-
- at table @option
- at item -scodec @var{codec}
-Force subtitle codec ('copy' to copy stream).
- at item -newsubtitle
-Add a new subtitle stream to the current output stream.
- at item -slang @var{code}
-Set the ISO 639 language code (3 letters) of the current subtitle stream.
- at item -sn
-Disable subtitle recording.
- at item -sbsf @var{bitstream_filter}
-Bitstream filters available are "mov2textsub", "text2movsub".
- at example
-ffmpeg -i file.mov -an -vn -sbsf mov2textsub -scodec copy -f rawvideo sub.txt
- at end example
- at end table
-
- at section Audio/Video grab options
-
- at table @option
- at item -vc @var{channel}
-Set video grab channel (DV1394 only).
- at item -tvstd @var{standard}
-Set television standard (NTSC, PAL (SECAM)).
- at item -isync
-Synchronize read on input.
- at end table
-
- at section Advanced options
-
- at table @option
- at item -map @var{input_stream_id}[:@var{sync_stream_id}]
-Set stream mapping from input streams to output streams.
-Just enumerate the input streams in the order you want them in the output.
- at var{sync_stream_id} if specified sets the input stream to sync
-against.
- at item -map_meta_data @var{outfile}:@var{infile}
-Set meta data information of @var{outfile} from @var{infile}.
- at item -debug
-Print specific debug info.
- at item -benchmark
-Show benchmarking information at the end of an encode.
-Shows CPU time used and maximum memory consumption.
-Maximum memory consumption is not supported on all systems,
-it will usually display as 0 if not supported.
- at item -dump
-Dump each input packet.
- at item -hex
-When dumping packets, also dump the payload.
- at item -bitexact
-Only use bit exact algorithms (for codec testing).
- at item -ps @var{size}
-Set RTP payload size in bytes.
- at item -re
-Read input at native frame rate. Mainly used to simulate a grab device.
- at item -loop_input
-Loop over the input stream. Currently it works only for image
-streams. This option is used for automatic FFserver testing.
- at item -loop_output @var{number_of_times}
-Repeatedly loop output for formats that support looping such as animated GIF
-(0 will loop the output infinitely).
- at item -threads @var{count}
-Thread count.
- at item -vsync @var{parameter}
-Video sync method.
-0   Each frame is passed with its timestamp from the demuxer to the muxer
-1   Frames will be duplicated and dropped to achieve exactly the requested
-    constant framerate.
-2   Frames are passed through with their timestamp or dropped so as to prevent
-    2 frames from having the same timestamp
--1  Chooses between 1 and 2 depending on muxer capabilities. This is the default method.
-
-With -map you can select from
-which stream the timestamps should be taken. You can leave either video or
-audio unchanged and sync the remaining stream(s) to the unchanged one.
- at item -async @var{samples_per_second}
-Audio sync method. "Stretches/squeezes" the audio stream to match the timestamps,
-the parameter is the maximum samples per second by which the audio is changed.
--async 1 is a special case where only the start of the audio stream is corrected
-without any later correction.
- at item -copyts
-Copy timestamps from input to output.
- at item -shortest
-Finish encoding when the shortest input stream ends.
- at item -dts_delta_threshold
-Timestamp discontinuity delta threshold.
- at item -muxdelay @var{seconds}
-Set the maximum demux-decode delay.
- at item -muxpreload @var{seconds}
-Set the initial demux-decode delay.
- at end table
-
- at section Preset files
-
-A preset file contains a sequence of @var{option}=@var{value} pairs,
-one for each line, specifying a sequence of options which would be
-awkward to specify on the command line. Lines starting with the hash
-('#') character are ignored and are used to provide comments. Check
-the @file{ffpresets} directory in the FFmpeg source tree for examples.
-
-Preset files are specified with the @code{vpre}, @code{apre},
- at code{spre}, and @code{fpre} options. The @code{fpre} option takes the
-filename of the preset instead of a preset name as input and can be
-used for any kind of codec. For the @code{vpre}, @code{apre}, and
- at code{spre} options, the options specified in a preset file are
-applied to the currently selected codec of the same type as the preset
-option.
-
-The argument passed to the @code{vpre}, @code{apre}, and @code{spre}
-preset options identifies the preset file to use according to the
-following rules:
-
-First ffmpeg searches for a file named @var{arg}.ffpreset in the
-directories @file{$FFMPEG_DATADIR} (if set), and @file{$HOME/.ffmpeg}, and in
-the datadir defined at configuration time (usually @file{PREFIX/share/ffmpeg})
-in that order. For example, if the argument is @code{libx264-max}, it will
-search for the file @file{libx264-max.ffpreset}.
-
-If no such file is found, then ffmpeg will search for a file named
- at var{codec_name}- at var{arg}.ffpreset in the above-mentioned
-directories, where @var{codec_name} is the name of the codec to which
-the preset file options will be applied. For example, if you select
-the video codec with @code{-vcodec libx264} and use @code{-vpre max},
-then it will search for the file @file{libx264-max.ffpreset}.
-
- at anchor{FFmpeg formula evaluator}
- at section FFmpeg formula evaluator
-
-When evaluating a rate control string, FFmpeg uses an internal formula
-evaluator.
-
-The following binary operators are available: @code{+}, @code{-},
- at code{*}, @code{/}, @code{^}.
-
-The following unary operators are available: @code{+}, @code{-},
- at code{(...)}.
-
-The following statements are available: @code{ld}, @code{st},
- at code{while}.
-
-The following functions are available:
- at table @var
- at item sinh(x)
- at item cosh(x)
- at item tanh(x)
- at item sin(x)
- at item cos(x)
- at item tan(x)
- at item atan(x)
- at item asin(x)
- at item acos(x)
- at item exp(x)
- at item log(x)
- at item abs(x)
- at item squish(x)
- at item gauss(x)
- at item mod(x, y)
- at item max(x, y)
- at item min(x, y)
- at item eq(x, y)
- at item gte(x, y)
- at item gt(x, y)
- at item lte(x, y)
- at item lt(x, y)
- at item bits2qp(bits)
- at item qp2bits(qp)
- at end table
-
-The following constants are available:
- at table @var
- at item PI
- at item E
- at item iTex
- at item pTex
- at item tex
- at item mv
- at item fCode
- at item iCount
- at item mcVar
- at item var
- at item isI
- at item isP
- at item isB
- at item avgQP
- at item qComp
- at item avgIITex
- at item avgPITex
- at item avgPPTex
- at item avgBPTex
- at item avgTex
- at end table
-
- at c man end
-
- at ignore
-
- at setfilename ffmpeg
- at settitle FFmpeg video converter
-
- at c man begin SEEALSO
-ffserver(1), ffplay(1) and the HTML documentation of @file{ffmpeg}.
- at c man end
-
- at c man begin AUTHOR
-Fabrice Bellard
- at c man end
-
- at end ignore
-
- at section Protocols
-
-The file name can be @file{-} to read from standard input or to write
-to standard output.
-
-FFmpeg also handles many protocols specified with an URL syntax.
-
-Use 'ffmpeg -protocols' to see a list of the supported protocols.
-
-The protocol @code{http:} is currently used only to communicate with
-FFserver (see the FFserver documentation). When FFmpeg will be a
-video player it will also be used for streaming :-)
-
- at chapter Tips
-
- at itemize
- at item For streaming at very low bitrate application, use a low frame rate
-and a small GOP size. This is especially true for RealVideo where
-the Linux player does not seem to be very fast, so it can miss
-frames. An example is:
-
- at example
-ffmpeg -g 3 -r 3 -t 10 -b 50k -s qcif -f rv10 /tmp/b.rm
- at end example
-
- at item  The parameter 'q' which is displayed while encoding is the current
-quantizer. The value 1 indicates that a very good quality could
-be achieved. The value 31 indicates the worst quality. If q=31 appears
-too often, it means that the encoder cannot compress enough to meet
-your bitrate. You must either increase the bitrate, decrease the
-frame rate or decrease the frame size.
-
- at item If your computer is not fast enough, you can speed up the
-compression at the expense of the compression ratio. You can use
-'-me zero' to speed up motion estimation, and '-intra' to disable
-motion estimation completely (you have only I-frames, which means it
-is about as good as JPEG compression).
-
- at item To have very low audio bitrates, reduce the sampling frequency
-(down to 22050 Hz for MPEG audio, 22050 or 11025 for AC-3).
-
- at item To have a constant quality (but a variable bitrate), use the option
-'-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
-quality).
-
- at item When converting video files, you can use the '-sameq' option which
-uses the same quality factor in the encoder as in the decoder.
-It allows almost lossless encoding.
-
- at end itemize
-
- at bye
diff --git a/doc/ffmpeg_powerpc_performance_evaluation_howto.txt b/doc/ffmpeg_powerpc_performance_evaluation_howto.txt
deleted file mode 100644
index 2eb4ee7..0000000
--- a/doc/ffmpeg_powerpc_performance_evaluation_howto.txt
+++ /dev/null
@@ -1,172 +0,0 @@
-FFmpeg & evaluating performance on the PowerPC Architecture HOWTO
-
-(c) 2003-2004 Romain Dolbeau <romain at dolbeau.org>
-
-
-
-I - Introduction
-
-The PowerPC architecture and its SIMD extension AltiVec offer some
-interesting tools to evaluate performance and improve the code.
-This document tries to explain how to use those tools with FFmpeg.
-
-The architecture itself offers two ways to evaluate the performance of
-a given piece of code:
-
-1) The Time Base Registers (TBL)
-2) The Performance Monitor Counter Registers (PMC)
-
-The first ones are always available, always active, but they're not very
-accurate: the registers increment by one every four *bus* cycles. On
-my 667 Mhz tiBook (ppc7450), this means once every twenty *processor*
-cycles. So we won't use that.
-
-The PMC are much more useful: not only can they report cycle-accurate
-timing, but they can also be used to monitor many other parameters,
-such as the number of AltiVec stalls for every kind of instruction,
-or instruction cache misses. The downside is that not all processors
-support the PMC (all G3, all G4 and the 970 do support them), and
-they're inactive by default - you need to activate them with a
-dedicated tool. Also, the number of available PMC depends on the
-procesor: the various 604 have 2, the various 75x (aka. G3) have 4,
-and the various 74xx (aka G4) have 6.
-
-*WARNING*: The PowerPC 970 is not very well documented, and its PMC
-registers are 64 bits wide. To properly notify the code, you *must*
-tune for the 970 (using --tune=970), or the code will assume 32 bit
-registers.
-
-
-II - Enabling FFmpeg PowerPC performance support
-
-This needs to be done by hand. First, you need to configure FFmpeg as
-usual, but add the "--powerpc-perf-enable" option. For instance:
-
-#####
-./configure --prefix=/usr/local/ffmpeg-svn --cc=gcc-3.3 --tune=7450 --powerpc-perf-enable
-#####
-
-This will configure FFmpeg to install inside /usr/local/ffmpeg-svn,
-compiling with gcc-3.3 (you should try to use this one or a newer
-gcc), and tuning for the PowerPC 7450 (i.e. the newer G4; as a rule of
-thumb, those at 550Mhz and more). It will also enable the PMC.
-
-You may also edit the file "config.h" to enable the following line:
-
-#####
-// #define ALTIVEC_USE_REFERENCE_C_CODE 1
-#####
-
-If you enable this line, then the code will not make use of AltiVec,
-but will use the reference C code instead. This is useful to compare
-performance between two versions of the code.
-
-Also, the number of enabled PMC is defined in "libavcodec/ppc/dsputil_ppc.h":
-
-#####
-#define POWERPC_NUM_PMC_ENABLED 4
-#####
-
-If you have a G4 CPU, you can enable all 6 PMC. DO NOT enable more
-PMC than available on your CPU!
-
-Then, simply compile FFmpeg as usual (make && make install).
-
-
-
-III - Using FFmpeg PowerPC performance support
-
-This FFmeg can be used exactly as usual. But before exiting, FFmpeg
-will dump a per-function report that looks like this:
-
-#####
-PowerPC performance report
- Values are from the PMC registers, and represent whatever the
- registers are set to record.
- Function "gmc1_altivec" (pmc1):
-        min: 231
-        max: 1339867
-        avg: 558.25 (255302)
- Function "gmc1_altivec" (pmc2):
-        min: 93
-        max: 2164
-        avg: 267.31 (255302)
- Function "gmc1_altivec" (pmc3):
-        min: 72
-        max: 1987
-        avg: 276.20 (255302)
-(...)
-#####
-
-In this example, PMC1 was set to record CPU cycles, PMC2 was set to
-record AltiVec Permute Stall Cycles, and PMC3 was set to record AltiVec
-Issue Stalls.
-
-The function "gmc1_altivec" was monitored 255302 times, and the
-minimum execution time was 231 processor cycles. The max and average
-aren't much use, as it's very likely the OS interrupted execution for
-reasons of its own :-(
-
-With the exact same settings and source file, but using the reference C
-code we get:
-
-#####
-PowerPC performance report
- Values are from the PMC registers, and represent whatever the
- registers are set to record.
- Function "gmc1_altivec" (pmc1):
-        min: 592
-        max: 2532235
-        avg: 962.88 (255302)
- Function "gmc1_altivec" (pmc2):
-        min: 0
-        max: 33
-        avg: 0.00 (255302)
- Function "gmc1_altivec" (pmc3):
-        min: 0
-        max: 350
-        avg: 0.03 (255302)
-(...)
-#####
-
-592 cycles, so the fastest AltiVec execution is about 2.5x faster than
-the fastest C execution in this example. It's not perfect but it's not
-bad (well I wrote this function so I can't say otherwise :-).
-
-Once you have that kind of report, you can try to improve things by
-finding what goes wrong and fixing it; in the example above, one
-should try to diminish the number of AltiVec stalls, as this *may*
-improve performance.
-
-
-
-IV) Enabling the PMC in Mac OS X
-
-This is easy. Use "Monster" and "monster". Those tools come from
-Apple's CHUD package, and can be found hidden in the developer web
-site & FTP site. "MONster" is the graphical application, use it to
-generate a config file specifying what each register should
-monitor. Then use the command-line application "monster" to use that
-config file, and enjoy the results.
-
-Note that "MONster" can be used for many other things, but it's
-documented by Apple, it's not my subject.
-
-If you are using CHUD 4.4.2 or later, you'll notice that MONster is
-no longer available. It's been superseeded by Shark, where
-configuration of PMCs is available as a plugin.
-
-
-
-V) Enabling the PMC on Linux
-
-On linux you may use oprofile from http://oprofile.sf.net, depending on the
-version and the cpu you may need to apply a patch[1] to access a set of the
-possibile counters from the userspace application. You can always define them
-using the kernel interface /dev/oprofile/* .
-
-[1] http://dev.gentoo.org/~lu_zero/development/oprofile-g4-20060423.patch
-
---
-Romain Dolbeau <romain at dolbeau.org>
-Luca Barbato <lu_zero at gentoo.org>
diff --git a/doc/ffplay-doc.texi b/doc/ffplay-doc.texi
deleted file mode 100644
index e0ca79d..0000000
--- a/doc/ffplay-doc.texi
+++ /dev/null
@@ -1,160 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle FFplay Documentation
- at titlepage
- at sp 7
- at center @titlefont{FFplay Documentation}
- at sp 3
- at end titlepage
-
-
- at chapter Introduction
-
- at c man begin DESCRIPTION
-FFplay is a very simple and portable media player using the FFmpeg
-libraries and the SDL library. It is mostly used as a testbed for the
-various FFmpeg APIs.
- at c man end
-
- at chapter Invocation
-
- at section Syntax
- at example
- at c man begin SYNOPSIS
-ffplay [options] @file{input_file}
- at c man end
- at end example
-
- at c man begin OPTIONS
-
- at include fftools-common-opts.texi
-
- at section Main options
-
- at table @option
- at item -x @var{width}
-Force displayed width.
- at item -y @var{height}
-Force displayed height.
- at item -s @var{size}
-Set frame size (WxH or abbreviation), needed for videos which don't
-contain a header with the frame size like raw YUV.
- at item -an
-Disable audio.
- at item -vn
-Disable video.
- at item -ss @var{pos}
-Seek to a given position in seconds.
- at item -t @var{duration}
-play <duration> seconds of audio/video
- at item -bytes
-Seek by bytes.
- at item -nodisp
-Disable graphical display.
- at item -f @var{fmt}
-Force format.
- at item -window_title @var{title}
-Set window title (default is the input filename).
- at item -loop @var{number}
-Loops movie playback <number> times. 0 means forever.
- at end table
-
- at section Advanced options
- at table @option
- at item -pix_fmt @var{format}
-Set pixel format.
- at item -stats
-Show the stream duration, the codec parameters, the current position in
-the stream and the audio/video synchronisation drift.
- at item -debug
-Print specific debug info.
- at item -bug
-Work around bugs.
- at item -vismv
-Visualize motion vectors.
- at item -fast
-Non-spec-compliant optimizations.
- at item -genpts
-Generate pts.
- at item -rtp_tcp
-Force RTP/TCP protocol usage instead of RTP/UDP. It is only meaningful
-if you are streaming with the RTSP protocol.
- at item -sync @var{type}
-Set the master clock to audio (@code{type=audio}), video
-(@code{type=video}) or external (@code{type=ext}). Default is audio. The
-master clock is used to control audio-video synchronization. Most media
-players use audio as master clock, but in some cases (streaming or high
-quality broadcast) it is necessary to change that. This option is mainly
-used for debugging purposes.
- at item -threads @var{count}
-Set the thread count.
- at item -ast @var{audio_stream_number}
-Select the desired audio stream number, counting from 0. The number
-refers to the list of all the input audio streams. If it is greater
-than the number of audio streams minus one, then the last one is
-selected, if it is negative the audio playback is disabled.
- at item -vst @var{video_stream_number}
-Select the desired video stream number, counting from 0. The number
-refers to the list of all the input video streams. If it is greater
-than the number of video streams minus one, then the last one is
-selected, if it is negative the video playback is disabled.
- at item -sst @var{subtitle_stream_number}
-Select the desired subtitle stream number, counting from 0. The number
-refers to the list of all the input subtitle streams. If it is greater
-than the number of subtitle streams minus one, then the last one is
-selected, if it is negative the subtitle rendering is disabled.
- at end table
-
- at section While playing
-
- at table @key
- at item q, ESC
-Quit.
-
- at item f
-Toggle full screen.
-
- at item p, SPC
-Pause.
-
- at item a
-Cycle audio channel.
-
- at item v
-Cycle video channel.
-
- at item t
-Cycle subtitle channel.
-
- at item w
-Show audio waves.
-
- at item left/right
-Seek backward/forward 10 seconds.
-
- at item down/up
-Seek backward/forward 1 minute.
-
- at item mouse click
-Seek to percentage in file corresponding to fraction of width.
-
- at end table
-
- at c man end
-
- at ignore
-
- at setfilename ffplay
- at settitle FFplay media player
-
- at c man begin SEEALSO
-ffmpeg(1), ffserver(1) and the HTML documentation of @file{ffmpeg}.
- at c man end
-
- at c man begin AUTHOR
-Fabrice Bellard
- at c man end
-
- at end ignore
-
- at bye
diff --git a/doc/ffprobe-doc.texi b/doc/ffprobe-doc.texi
deleted file mode 100644
index 8eb3ed9..0000000
--- a/doc/ffprobe-doc.texi
+++ /dev/null
@@ -1,121 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle FFprobe Documentation
- at titlepage
- at sp 7
- at center @titlefont{FFprobe Documentation}
- at sp 3
- at end titlepage
-
- at chapter Introduction
-
- at c man begin DESCRIPTION
-
-FFprobe gathers information from multimedia streams and prints it in
-human- and machine-readable fashion.
-
-For example it can be used to check the format of the container used
-by a multimedia stream and the format and type of each media stream
-contained in it.
-
-If a filename is specified in input, ffprobe will try to open and
-probe the file content. If the file cannot be opened or recognized as
-a multimedia file, a positive exit code is returned.
-
-FFprobe may be employed both as a standalone application or in
-combination with a textual filter, which may perform more
-sophisticated processing, e.g. statistical processing or plotting.
-
-Options are used to list some of the formats supported by ffprobe or
-for specifying which information to display, and for setting how
-ffprobe will show it.
-
-FFprobe output is designed to be easily parsable by a textual filter,
-and consists of one or more sections of the form:
- at example
-[SECTION]
-key1=val1
-...
-keyN=valN
-[/SECTION]
- at end example
-
-Metadata tags stored in the container or in the streams are recognized
-and printed in the corresponding ``FORMAT'' or ``STREAM'' section, and
-are prefixed by the string ``TAG:''.
-
- at c man end
-
- at chapter Invocation
-
- at section Syntax
-
-The generic syntax is:
-
- at example
- at c man begin SYNOPSIS
-ffprobe [options] [@file{input_file}]
- at c man end
- at end example
-
- at c man begin OPTIONS
-
- at include fftools-common-opts.texi
-
- at section Main options
-
- at table @option
-
- at item -convert_tags
-Convert the tag names in the format container to the generic FFmpeg tag names.
-
- at item -f @var{format}
-Force format to use.
-
- at item -unit
-Show the unit of the displayed values.
-
- at item -prefix
-Show a SI prefixes of the displayed values.
-Unless ``-byte_binary_prefix'' option is used all the prefix
-are decimal.
-
- at item -byte_binary_prefix
-Force the use of binary prefixes for byte values.
-
- at item -sexagesimal
-Use sexagesimal format HH:MM:SS.MICROSECONDS for time values.
-
- at item -pretty
-Prettify the format of the displayed values, it corresponds to the
-options ``-unit -prefix -byte_binary_prefix -sexagesimal''.
-
- at item -show_format
-Show information about the container format of the input multimedia
-stream.
-
-All the container format information is printed within a section with
-name ``FORMAT''.
-
- at item -show_streams
-Show information about each media stream contained in the input
-multimedia stream.
-
-Each media stream information is printed within a dedicated section
-with name ``STREAM''.
-
- at end table
- at c man end
-
- at ignore
-
- at setfilename ffprobe
- at settitle FFprobe media prober
-
- at c man begin SEEALSO
-ffmpeg(1), ffplay(1), ffserver(1)
- at c man end
-
- at end ignore
-
- at bye
diff --git a/doc/ffserver-doc.texi b/doc/ffserver-doc.texi
deleted file mode 100644
index 0a2440a..0000000
--- a/doc/ffserver-doc.texi
+++ /dev/null
@@ -1,274 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle FFserver Documentation
- at titlepage
- at sp 7
- at center @titlefont{FFserver Documentation}
- at sp 3
- at end titlepage
-
-
- at chapter Introduction
-
- at c man begin DESCRIPTION
-FFserver is a streaming server for both audio and video. It supports
-several live feeds, streaming from files and time shifting on live feeds
-(you can seek to positions in the past on each live feed, provided you
-specify a big enough feed storage in ffserver.conf).
-
-FFserver runs in daemon mode by default; that is, it puts itself in
-the background and detaches from its TTY, unless it is launched in
-debug mode or a NoDaemon option is specified in the configuration
-file.
-
-This documentation covers only the streaming aspects of ffserver /
-ffmpeg. All questions about parameters for ffmpeg, codec questions,
-etc. are not covered here. Read @file{ffmpeg-doc.html} for more
-information.
-
- at section How does it work?
-
-FFserver receives prerecorded files or FFM streams from some ffmpeg
-instance as input, then streams them over RTP/RTSP/HTTP.
-
-An ffserver instance will listen on some port as specified in the
-configuration file. You can launch one or more instances of ffmpeg and
-send one or more FFM streams to the port where ffserver is expecting
-to receive them. Alternately, you can make ffserver launch such ffmpeg
-instances at startup.
-
-Input streams are called feeds, and each one is specified by a <Feed>
-section in the configuration file.
-
-For each feed you can have different output streams in various
-formats, each one specified by a <Stream> section in the configuration
-file.
-
- at section Status stream
-
-FFserver supports an HTTP interface which exposes the current status
-of the server.
-
-Simply point your browser to the address of the special status stream
-specified in the configuration file.
-
-For example if you have:
- at example
-<Stream status.html>
-Format status
-
-# Only allow local people to get the status
-ACL allow localhost
-ACL allow 192.168.0.0 192.168.255.255
-</Stream>
- at end example
-
-then the server will post a page with the status information when
-the special stream @file{status.html} is requested.
-
- at section What can this do?
-
-When properly configured and running, you can capture video and audio in real
-time from a suitable capture card, and stream it out over the Internet to
-either Windows Media Player or RealAudio player (with some restrictions).
-
-It can also stream from files, though that is currently broken. Very often, a
-web server can be used to serve up the files just as well.
-
-It can stream prerecorded video from .ffm files, though it is somewhat tricky
-to make it work correctly.
-
- at section What do I need?
-
-I use Linux on a 900 MHz Duron with a cheapo Bt848 based TV capture card. I'm
-using stock Linux 2.4.17 with the stock drivers. [Actually that isn't true,
-I needed some special drivers for my motherboard-based sound card.]
-
-I understand that FreeBSD systems work just fine as well.
-
- at section How do I make it work?
-
-First, build the kit. It *really* helps to have installed LAME first. Then when
-you run the ffserver ./configure, make sure that you have the
- at code{--enable-libmp3lame} flag turned on.
-
-LAME is important as it allows for streaming audio to Windows Media Player.
-Don't ask why the other audio types do not work.
-
-As a simple test, just run the following two command lines where INPUTFILE
-is some file which you can decode with ffmpeg:
-
- at example
-./ffserver -f doc/ffserver.conf &
-./ffmpeg -i INPUTFILE http://localhost:8090/feed1.ffm
- at end example
-
-At this point you should be able to go to your Windows machine and fire up
-Windows Media Player (WMP). Go to Open URL and enter
-
- at example
-    http://<linuxbox>:8090/test.asf
- at end example
-
-You should (after a short delay) see video and hear audio.
-
-WARNING: trying to stream test1.mpg doesn't work with WMP as it tries to
-transfer the entire file before starting to play.
-The same is true of AVI files.
-
- at section What happens next?
-
-You should edit the ffserver.conf file to suit your needs (in terms of
-frame rates etc). Then install ffserver and ffmpeg, write a script to start
-them up, and off you go.
-
- at section Troubleshooting
-
- at subsection I don't hear any audio, but video is fine.
-
-Maybe you didn't install LAME, or got your ./configure statement wrong. Check
-the ffmpeg output to see if a line referring to MP3 is present. If not, then
-your configuration was incorrect. If it is, then maybe your wiring is not
-set up correctly. Maybe the sound card is not getting data from the right
-input source. Maybe you have a really awful audio interface (like I do)
-that only captures in stereo and also requires that one channel be flipped.
-If you are one of these people, then export 'AUDIO_FLIP_LEFT=1' before
-starting ffmpeg.
-
- at subsection The audio and video loose sync after a while.
-
-Yes, they do.
-
- at subsection After a long while, the video update rate goes way down in WMP.
-
-Yes, it does. Who knows why?
-
- at subsection WMP 6.4 behaves differently to WMP 7.
-
-Yes, it does. Any thoughts on this would be gratefully received. These
-differences extend to embedding WMP into a web page. [There are two
-object IDs that you can use: The old one, which does not play well, and
-the new one, which does (both tested on the same system). However,
-I suspect that the new one is not available unless you have installed WMP 7].
-
- at section What else can it do?
-
-You can replay video from .ffm files that was recorded earlier.
-However, there are a number of caveats, including the fact that the
-ffserver parameters must match the original parameters used to record the
-file. If they do not, then ffserver deletes the file before recording into it.
-(Now that I write this, it seems broken).
-
-You can fiddle with many of the codec choices and encoding parameters, and
-there are a bunch more parameters that you cannot control. Post a message
-to the mailing list if there are some 'must have' parameters. Look in
-ffserver.conf for a list of the currently available controls.
-
-It will automatically generate the ASX or RAM files that are often used
-in browsers. These files are actually redirections to the underlying ASF
-or RM file. The reason for this is that the browser often fetches the
-entire file before starting up the external viewer. The redirection files
-are very small and can be transferred quickly. [The stream itself is
-often 'infinite' and thus the browser tries to download it and never
-finishes.]
-
- at section Tips
-
-* When you connect to a live stream, most players (WMP, RA, etc) want to
-buffer a certain number of seconds of material so that they can display the
-signal continuously. However, ffserver (by default) starts sending data
-in realtime. This means that there is a pause of a few seconds while the
-buffering is being done by the player. The good news is that this can be
-cured by adding a '?buffer=5' to the end of the URL. This means that the
-stream should start 5 seconds in the past -- and so the first 5 seconds
-of the stream are sent as fast as the network will allow. It will then
-slow down to real time. This noticeably improves the startup experience.
-
-You can also add a 'Preroll 15' statement into the ffserver.conf that will
-add the 15 second prebuffering on all requests that do not otherwise
-specify a time. In addition, ffserver will skip frames until a key_frame
-is found. This further reduces the startup delay by not transferring data
-that will be discarded.
-
-* You may want to adjust the MaxBandwidth in the ffserver.conf to limit
-the amount of bandwidth consumed by live streams.
-
- at section Why does the ?buffer / Preroll stop working after a time?
-
-It turns out that (on my machine at least) the number of frames successfully
-grabbed is marginally less than the number that ought to be grabbed. This
-means that the timestamp in the encoded data stream gets behind realtime.
-This means that if you say 'Preroll 10', then when the stream gets 10
-or more seconds behind, there is no Preroll left.
-
-Fixing this requires a change in the internals of how timestamps are
-handled.
-
- at section Does the @code{?date=} stuff work.
-
-Yes (subject to the limitation outlined above). Also note that whenever you
-start ffserver, it deletes the ffm file (if any parameters have changed),
-thus wiping out what you had recorded before.
-
-The format of the @code{?date=xxxxxx} is fairly flexible. You should use one
-of the following formats (the 'T' is literal):
-
- at example
-* YYYY-MM-DDTHH:MM:SS     (localtime)
-* YYYY-MM-DDTHH:MM:SSZ    (UTC)
- at end example
-
-You can omit the YYYY-MM-DD, and then it refers to the current day. However
-note that @samp{?date=16:00:00} refers to 16:00 on the current day -- this
-may be in the future and so is unlikely to be useful.
-
-You use this by adding the ?date= to the end of the URL for the stream.
-For example:   @samp{http://localhost:8080/test.asf?date=2002-07-26T23:05:00}.
- at c man end
-
- at chapter Invocation
- at section Syntax
- at example
- at c man begin SYNOPSIS
-ffserver [options]
- at c man end
- at end example
-
- at section Options
- at c man begin OPTIONS
-
- at include fftools-common-opts.texi
-
- at section Main options
-
- at table @option
- at item -f @var{configfile}
-Use @file{configfile} instead of @file{/etc/ffserver.conf}.
- at item -n
-Enable no-launch mode. This option disables all the Launch directives
-within the various <Stream> sections. FFserver will not launch any
-ffmpeg instance, so you will have to launch them manually.
- at item -d
-Enable debug mode. This option increases log verbosity, directs log
-messages to stdout and causes ffserver to run in the foreground
-rather than as a daemon.
- at end table
- at c man end
-
- at ignore
-
- at setfilename ffserver
- at settitle FFserver video server
-
- at c man begin SEEALSO
-ffmpeg(1), ffplay(1), the @file{ffmpeg/doc/ffserver.conf} example and
-the HTML documentation of @file{ffmpeg}.
- at c man end
-
- at c man begin AUTHOR
-Fabrice Bellard
- at c man end
-
- at end ignore
-
- at bye
diff --git a/doc/ffserver.conf b/doc/ffserver.conf
deleted file mode 100644
index 2fbfecd..0000000
--- a/doc/ffserver.conf
+++ /dev/null
@@ -1,356 +0,0 @@
-# Port on which the server is listening. You must select a different
-# port from your standard HTTP web server if it is running on the same
-# computer.
-Port 8090
-
-# Address on which the server is bound. Only useful if you have
-# several network interfaces.
-BindAddress 0.0.0.0
-
-# Number of simultaneous HTTP connections that can be handled. It has
-# to be defined *before* the MaxClients parameter, since it defines the
-# MaxClients maximum limit.
-MaxHTTPConnections 2000
-
-# Number of simultaneous requests that can be handled. Since FFServer
-# is very fast, it is more likely that you will want to leave this high
-# and use MaxBandwidth, below.
-MaxClients 1000
-
-# This the maximum amount of kbit/sec that you are prepared to
-# consume when streaming to clients.
-MaxBandwidth 1000
-
-# Access log file (uses standard Apache log file format)
-# '-' is the standard output.
-CustomLog -
-
-# Suppress that if you want to launch ffserver as a daemon.
-NoDaemon
-
-
-##################################################################
-# Definition of the live feeds. Each live feed contains one video
-# and/or audio sequence coming from an ffmpeg encoder or another
-# ffserver. This sequence may be encoded simultaneously with several
-# codecs at several resolutions.
-
-<Feed feed1.ffm>
-
-# You must use 'ffmpeg' to send a live feed to ffserver. In this
-# example, you can type:
-#
-# ffmpeg http://localhost:8090/feed1.ffm
-
-# ffserver can also do time shifting. It means that it can stream any
-# previously recorded live stream. The request should contain:
-# "http://xxxx?date=[YYYY-MM-DDT][[HH:]MM:]SS[.m...]".You must specify
-# a path where the feed is stored on disk. You also specify the
-# maximum size of the feed, where zero means unlimited. Default:
-# File=/tmp/feed_name.ffm FileMaxSize=5M
-File /tmp/feed1.ffm
-FileMaxSize 200K
-
-# You could specify
-# ReadOnlyFile /saved/specialvideo.ffm
-# This marks the file as readonly and it will not be deleted or updated.
-
-# Specify launch in order to start ffmpeg automatically.
-# First ffmpeg must be defined with an appropriate path if needed,
-# after that options can follow, but avoid adding the http:// field
-#Launch ffmpeg
-
-# Only allow connections from localhost to the feed.
-ACL allow 127.0.0.1
-
-</Feed>
-
-
-##################################################################
-# Now you can define each stream which will be generated from the
-# original audio and video stream. Each format has a filename (here
-# 'test1.mpg'). FFServer will send this stream when answering a
-# request containing this filename.
-
-<Stream test1.mpg>
-
-# coming from live feed 'feed1'
-Feed feed1.ffm
-
-# Format of the stream : you can choose among:
-# mpeg       : MPEG-1 multiplexed video and audio
-# mpegvideo  : only MPEG-1 video
-# mp2        : MPEG-2 audio (use AudioCodec to select layer 2 and 3 codec)
-# ogg        : Ogg format (Vorbis audio codec)
-# rm         : RealNetworks-compatible stream. Multiplexed audio and video.
-# ra         : RealNetworks-compatible stream. Audio only.
-# mpjpeg     : Multipart JPEG (works with Netscape without any plugin)
-# jpeg       : Generate a single JPEG image.
-# asf        : ASF compatible streaming (Windows Media Player format).
-# swf        : Macromedia Flash compatible stream
-# avi        : AVI format (MPEG-4 video, MPEG audio sound)
-Format mpeg
-
-# Bitrate for the audio stream. Codecs usually support only a few
-# different bitrates.
-AudioBitRate 32
-
-# Number of audio channels: 1 = mono, 2 = stereo
-AudioChannels 1
-
-# Sampling frequency for audio. When using low bitrates, you should
-# lower this frequency to 22050 or 11025. The supported frequencies
-# depend on the selected audio codec.
-AudioSampleRate 44100
-
-# Bitrate for the video stream
-VideoBitRate 64
-
-# Ratecontrol buffer size
-VideoBufferSize 40
-
-# Number of frames per second
-VideoFrameRate 3
-
-# Size of the video frame: WxH (default: 160x128)
-# The following abbreviations are defined: sqcif, qcif, cif, 4cif, qqvga,
-# qvga, vga, svga, xga, uxga, qxga, sxga, qsxga, hsxga, wvga, wxga, wsxga,
-# wuxga, woxga, wqsxga, wquxga, whsxga, whuxga, cga, ega, hd480, hd720,
-# hd1080
-VideoSize 160x128
-
-# Transmit only intra frames (useful for low bitrates, but kills frame rate).
-#VideoIntraOnly
-
-# If non-intra only, an intra frame is transmitted every VideoGopSize
-# frames. Video synchronization can only begin at an intra frame.
-VideoGopSize 12
-
-# More MPEG-4 parameters
-# VideoHighQuality
-# Video4MotionVector
-
-# Choose your codecs:
-#AudioCodec mp2
-#VideoCodec mpeg1video
-
-# Suppress audio
-#NoAudio
-
-# Suppress video
-#NoVideo
-
-#VideoQMin 3
-#VideoQMax 31
-
-# Set this to the number of seconds backwards in time to start. Note that
-# most players will buffer 5-10 seconds of video, and also you need to allow
-# for a keyframe to appear in the data stream.
-#Preroll 15
-
-# ACL:
-
-# You can allow ranges of addresses (or single addresses)
-#ACL ALLOW <first address> <last address>
-
-# You can deny ranges of addresses (or single addresses)
-#ACL DENY <first address> <last address>
-
-# You can repeat the ACL allow/deny as often as you like. It is on a per
-# stream basis. The first match defines the action. If there are no matches,
-# then the default is the inverse of the last ACL statement.
-#
-# Thus 'ACL allow localhost' only allows access from localhost.
-# 'ACL deny 1.0.0.0 1.255.255.255' would deny the whole of network 1 and
-# allow everybody else.
-
-</Stream>
-
-
-##################################################################
-# Example streams
-
-
-# Multipart JPEG
-
-#<Stream test.mjpg>
-#Feed feed1.ffm
-#Format mpjpeg
-#VideoFrameRate 2
-#VideoIntraOnly
-#NoAudio
-#Strict -1
-#</Stream>
-
-
-# Single JPEG
-
-#<Stream test.jpg>
-#Feed feed1.ffm
-#Format jpeg
-#VideoFrameRate 2
-#VideoIntraOnly
-##VideoSize 352x240
-#NoAudio
-#Strict -1
-#</Stream>
-
-
-# Flash
-
-#<Stream test.swf>
-#Feed feed1.ffm
-#Format swf
-#VideoFrameRate 2
-#VideoIntraOnly
-#NoAudio
-#</Stream>
-
-
-# ASF compatible
-
-<Stream test.asf>
-Feed feed1.ffm
-Format asf
-VideoFrameRate 15
-VideoSize 352x240
-VideoBitRate 256
-VideoBufferSize 40
-VideoGopSize 30
-AudioBitRate 64
-StartSendOnKey
-</Stream>
-
-
-# MP3 audio
-
-#<Stream test.mp3>
-#Feed feed1.ffm
-#Format mp2
-#AudioCodec mp3
-#AudioBitRate 64
-#AudioChannels 1
-#AudioSampleRate 44100
-#NoVideo
-#</Stream>
-
-
-# Ogg Vorbis audio
-
-#<Stream test.ogg>
-#Feed feed1.ffm
-#Title "Stream title"
-#AudioBitRate 64
-#AudioChannels 2
-#AudioSampleRate 44100
-#NoVideo
-#</Stream>
-
-
-# Real with audio only at 32 kbits
-
-#<Stream test.ra>
-#Feed feed1.ffm
-#Format rm
-#AudioBitRate 32
-#NoVideo
-#NoAudio
-#</Stream>
-
-
-# Real with audio and video at 64 kbits
-
-#<Stream test.rm>
-#Feed feed1.ffm
-#Format rm
-#AudioBitRate 32
-#VideoBitRate 128
-#VideoFrameRate 25
-#VideoGopSize 25
-#NoAudio
-#</Stream>
-
-
-##################################################################
-# A stream coming from a file: you only need to set the input
-# filename and optionally a new format. Supported conversions:
-#    AVI -> ASF
-
-#<Stream file.rm>
-#File "/usr/local/httpd/htdocs/tlive.rm"
-#NoAudio
-#</Stream>
-
-#<Stream file.asf>
-#File "/usr/local/httpd/htdocs/test.asf"
-#NoAudio
-#Author "Me"
-#Copyright "Super MegaCorp"
-#Title "Test stream from disk"
-#Comment "Test comment"
-#</Stream>
-
-
-##################################################################
-# RTSP examples
-#
-# You can access this stream with the RTSP URL:
-#   rtsp://localhost:5454/test1-rtsp.mpg
-#
-# A non-standard RTSP redirector is also created. Its URL is:
-#   http://localhost:8090/test1-rtsp.rtsp
-
-#<Stream test1-rtsp.mpg>
-#Format rtp
-#File "/usr/local/httpd/htdocs/test1.mpg"
-#</Stream>
-
-
-##################################################################
-# SDP/multicast examples
-#
-# If you want to send your stream in multicast, you must set the
-# multicast address with MulticastAddress. The port and the TTL can
-# also be set.
-#
-# An SDP file is automatically generated by ffserver by adding the
-# 'sdp' extension to the stream name (here
-# http://localhost:8090/test1-sdp.sdp). You should usually give this
-# file to your player to play the stream.
-#
-# The 'NoLoop' option can be used to avoid looping when the stream is
-# terminated.
-
-#<Stream test1-sdp.mpg>
-#Format rtp
-#File "/usr/local/httpd/htdocs/test1.mpg"
-#MulticastAddress 224.124.0.1
-#MulticastPort 5000
-#MulticastTTL 16
-#NoLoop
-#</Stream>
-
-
-##################################################################
-# Special streams
-
-# Server status
-
-<Stream stat.html>
-Format status
-
-# Only allow local people to get the status
-ACL allow localhost
-ACL allow 192.168.0.0 192.168.255.255
-
-#FaviconURL http://pond1.gladstonefamily.net:8080/favicon.ico
-</Stream>
-
-
-# Redirect index.html to the appropriate site
-
-<Redirect index.html>
-URL http://www.ffmpeg.org/
-</Redirect>
-
-
diff --git a/doc/fftools-common-opts.texi b/doc/fftools-common-opts.texi
deleted file mode 100644
index 4fc271d..0000000
--- a/doc/fftools-common-opts.texi
+++ /dev/null
@@ -1,72 +0,0 @@
- at section Generic options
-
-These options are shared amongst the ff* tools.
-
- at table @option
-
- at item -L
-Show license.
-
- at item -h, -?, -help, --help
-Show help.
-
- at item -version
-Show version.
-
- at item -formats
-Show available formats.
-
-The fields preceding the format names have the following meanings:
- at table @samp
- at item D
-Decoding available
- at item E
-Encoding available
- at end table
-
- at item -codecs
-Show available codecs.
-
-The fields preceding the codec names have the following meanings:
- at table @samp
- at item D
-Decoding available
- at item E
-Encoding available
- at item V/A/S
-Video/audio/subtitle codec
- at item S
-Codec supports slices
- at item D
-Codec supports direct rendering
- at item T
-Codec can handle input truncated at random locations instead of only at frame boundaries
- at end table
-
- at item -bsfs
-Show available bitstream filters.
-
- at item -protocols
-Show available protocols.
-
- at item -filters
-Show available libavfilter filters.
-
- at item -pix_fmts
-Show available pixel formats.
-
- at item -loglevel @var{loglevel}
-Set the logging level used by the library.
- at var{loglevel} is a number or a string containing one of the following values:
- at table @samp
- at item quiet
- at item panic
- at item fatal
- at item error
- at item warning
- at item info
- at item verbose
- at item debug
- at end table
-
- at end table
diff --git a/doc/general.texi b/doc/general.texi
deleted file mode 100644
index dfa5b07..0000000
--- a/doc/general.texi
+++ /dev/null
@@ -1,1061 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle General Documentation
- at titlepage
- at sp 7
- at center @titlefont{General Documentation}
- at sp 3
- at end titlepage
-
-
- at chapter external libraries
-
-FFmpeg can be hooked up with a number of external libraries to add support
-for more formats. None of them are used by default, their use has to be
-explicitly requested by passing the appropriate flags to @file{./configure}.
-
- at section OpenCORE AMR
-
-FFmpeg can make use of the OpenCORE libraries for AMR-NB
-decoding/encoding and AMR-WB decoding.
-
-Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the instructions for
-installing the libraries. Then pass @code{--enable-libopencore-amrnb} and/or
- at code{--enable-libopencore-amrwb} to configure to enable the libraries.
-
-Note that OpenCORE is under the Apache License 2.0 (see
- at url{http://www.apache.org/licenses/LICENSE-2.0} for details), which is
-incompatible with the LGPL version 2.1 and GPL version 2. You have to
-upgrade FFmpeg's license to LGPL version 3 (or if you have enabled
-GPL components, GPL version 3) to use it.
-
-
- at chapter Supported File Formats and Codecs
-
-You can use the @code{-formats} and @code{-codecs} options to have an exhaustive list.
-
- at section File Formats
-
-FFmpeg supports the following file formats through the @code{libavformat}
-library:
-
- at multitable @columnfractions .4 .1 .1 .4
- at item Name @tab Encoding @tab Decoding @tab Comments
- at item 4xm                       @tab   @tab X
-    @tab 4X Technologies format, used in some games.
- at item 8088flex TMV              @tab   @tab X
- at item Adobe Filmstrip           @tab X @tab X
- at item Audio IFF (AIFF)          @tab X @tab X
- at item American Laser Games MM   @tab   @tab X
-    @tab Multimedia format used in games like Mad Dog McCree.
- at item 3GPP AMR                  @tab X @tab X
- at item ASF                       @tab X @tab X
- at item AVI                       @tab X @tab X
- at item AVISynth                  @tab   @tab X
- at item AVS                       @tab   @tab X
-    @tab Multimedia format used by the Creature Shock game.
- at item Beam Software SIFF        @tab   @tab X
-    @tab Audio and video format used in some games by Beam Software.
- at item Bethesda Softworks VID    @tab   @tab X
-    @tab Used in some games from Bethesda Softworks.
- at item Bink                      @tab   @tab X
-    @tab Multimedia format used by many games.
- at item Brute Force & Ignorance   @tab   @tab X
-    @tab Used in the game Flash Traffic: City of Angels.
- at item Interplay C93             @tab   @tab X
-    @tab Used in the game Cyberia from Interplay.
- at item Delphine Software International CIN @tab   @tab X
-    @tab Multimedia format used by Delphine Software games.
- at item CD+G                      @tab   @tab X
-    @tab Video format used by CD+G karaoke disks
- at item Core Audio Format         @tab   @tab X
-    @tab Apple Core Audio Format
- at item CRC testing format        @tab X @tab
- at item Creative Voice            @tab X @tab X
-    @tab Created for the Sound Blaster Pro.
- at item CRYO APC                  @tab   @tab X
-    @tab Audio format used in some games by CRYO Interactive Entertainment.
- at item D-Cinema audio            @tab X @tab X
- at item Deluxe Paint Animation    @tab   @tab X
- at item DV video                  @tab X @tab X
- at item DXA                       @tab   @tab X
-    @tab This format is used in the non-Windows version of the Feeble Files
-         game and different game cutscenes repacked for use with ScummVM.
- at item Electronic Arts cdata  @tab    @tab X
- at item Electronic Arts Multimedia  @tab    @tab X
-    @tab Used in various EA games; files have extensions like WVE and UV2.
- at item FFM (FFserver live feed)  @tab X @tab X
- at item Flash (SWF)               @tab X @tab X
- at item Flash 9 (AVM2)            @tab X @tab X
-    @tab Only embedded audio is decoded.
- at item FLI/FLC/FLX animation     @tab   @tab X
-    @tab .fli/.flc files
- at item Flash Video (FLV)         @tab   @tab X
-    @tab Macromedia Flash video files
- at item framecrc testing format   @tab X @tab
- at item FunCom ISS                @tab   @tab X
-    @tab Audio format used in various games from FunCom like The Longest Journey.
- at item GIF Animation             @tab X @tab
- at item GXF                       @tab X @tab X
-    @tab General eXchange Format SMPTE 360M, used by Thomson Grass Valley
-         playout servers.
- at item id Quake II CIN video     @tab   @tab X
- at item id RoQ                    @tab X @tab X
-    @tab Used in Quake III, Jedi Knight 2, other computer games.
- at item IEC61937 encapsulation @tab X @tab
- at item IFF                       @tab   @tab X
-    @tab Interchange File Format
- at item Interplay MVE             @tab   @tab X
-    @tab Format used in various Interplay computer games.
- at item IV8                       @tab   @tab X
-    @tab A format generated by IndigoVision 8000 video server.
- at item LMLM4                     @tab   @tab X
-    @tab Used by Linux Media Labs MPEG-4 PCI boards
- at item Matroska                  @tab X @tab X
- at item Matroska audio            @tab X @tab
- at item MAXIS XA                  @tab   @tab X
-    @tab Used in Sim City 3000; file extension .xa.
- at item MD Studio                 @tab   @tab X
- at item Monkey's Audio            @tab   @tab X
- at item Motion Pixels MVI         @tab   @tab X
- at item MOV/QuickTime/MP4         @tab X @tab X
-    @tab 3GP, 3GP2, PSP, iPod variants supported
- at item MP2                       @tab X @tab X
- at item MP3                       @tab X @tab X
- at item MPEG-1 System             @tab X @tab X
-    @tab muxed audio and video, VCD format supported
- at item MPEG-PS (program stream)  @tab X @tab X
-    @tab also known as @code{VOB} file, SVCD and DVD format supported
- at item MPEG-TS (transport stream) @tab X @tab X
-    @tab also known as DVB Transport Stream
- at item MPEG-4                    @tab X @tab X
-    @tab MPEG-4 is a variant of QuickTime.
- at item MIME multipart JPEG       @tab X @tab
- at item MSN TCP webcam            @tab   @tab X
-    @tab Used by MSN Messenger webcam streams.
- at item MTV                       @tab   @tab X
- at item Musepack                  @tab   @tab X
- at item Musepack SV8              @tab   @tab X
- at item Material eXchange Format (MXF) @tab X @tab X
-    @tab SMPTE 377M, used by D-Cinema, broadcast industry.
- at item Material eXchange Format (MXF), D-10 Mapping @tab X @tab X
-    @tab SMPTE 386M, D-10/IMX Mapping.
- at item NC camera feed            @tab   @tab X
-    @tab NC (AVIP NC4600) camera streams
- at item NTT TwinVQ (VQF)          @tab   @tab X
-    @tab Nippon Telegraph and Telephone Corporation TwinVQ.
- at item Nullsoft Streaming Video  @tab   @tab X
- at item NuppelVideo               @tab   @tab X
- at item NUT                       @tab X @tab X
-    @tab NUT Open Container Format
- at item Ogg                       @tab X @tab X
- at item TechnoTrend PVA           @tab   @tab X
-    @tab Used by TechnoTrend DVB PCI boards.
- at item QCP                       @tab   @tab X
- at item raw ADTS (AAC)            @tab X @tab X
- at item raw AC-3                  @tab X @tab X
- at item raw Chinese AVS video     @tab   @tab X
- at item raw CRI ADX               @tab X @tab X
- at item raw Dirac                 @tab X @tab X
- at item raw DNxHD                 @tab X @tab X
- at item raw DTS                   @tab X @tab X
- at item raw E-AC-3                @tab X @tab X
- at item raw FLAC                  @tab X @tab X
- at item raw GSM                   @tab   @tab X
- at item raw H.261                 @tab X @tab X
- at item raw H.263                 @tab X @tab X
- at item raw H.264                 @tab X @tab X
- at item raw Ingenient MJPEG       @tab   @tab X
- at item raw MJPEG                 @tab X @tab X
- at item raw MLP                   @tab   @tab X
- at item raw MPEG                  @tab   @tab X
- at item raw MPEG-1                @tab   @tab X
- at item raw MPEG-2                @tab   @tab X
- at item raw MPEG-4                @tab X @tab X
- at item raw NULL                  @tab X @tab
- at item raw video                 @tab X @tab X
- at item raw id RoQ                @tab X @tab
- at item raw Shorten               @tab   @tab X
- at item raw TrueHD                @tab X @tab X
- at item raw VC-1                  @tab   @tab X
- at item raw PCM A-law             @tab X @tab X
- at item raw PCM mu-law            @tab X @tab X
- at item raw PCM signed 8 bit      @tab X @tab X
- at item raw PCM signed 16 bit big-endian  @tab X @tab X
- at item raw PCM signed 16 bit little-endian  @tab X @tab X
- at item raw PCM signed 24 bit big-endian  @tab X @tab X
- at item raw PCM signed 24 bit little-endian  @tab X @tab X
- at item raw PCM signed 32 bit big-endian  @tab X @tab X
- at item raw PCM signed 32 bit little-endian  @tab X @tab X
- at item raw PCM unsigned 8 bit    @tab X @tab X
- at item raw PCM unsigned 16 bit big-endian  @tab X @tab X
- at item raw PCM unsigned 16 bit little-endian  @tab X @tab X
- at item raw PCM unsigned 24 bit big-endian  @tab X @tab X
- at item raw PCM unsigned 24 bit little-endian  @tab X @tab X
- at item raw PCM unsigned 32 bit big-endian  @tab X @tab X
- at item raw PCM unsigned 32 bit little-endian  @tab X @tab X
- at item raw PCM floating-point 32 bit big-endian  @tab X @tab X
- at item raw PCM floating-point 32 bit little-endian  @tab X @tab X
- at item raw PCM floating-point 64 bit big-endian  @tab X @tab X
- at item raw PCM floating-point 64 bit little-endian  @tab X @tab X
- at item RDT                       @tab   @tab X
- at item REDCODE R3D               @tab   @tab X
-    @tab File format used by RED Digital cameras, contains JPEG 2000 frames and PCM audio.
- at item RealMedia                 @tab X @tab X
- at item Redirector                @tab   @tab X
- at item Renderware TeXture Dictionary @tab   @tab X
- at item RL2                       @tab   @tab X
-    @tab Audio and video format used in some games by Entertainment Software Partners.
- at item RPL/ARMovie               @tab   @tab X
- at item RTMP                      @tab X @tab X
-    @tab Output is performed by publishing stream to RTMP server
- at item RTP                       @tab   @tab X
- at item RTSP                      @tab X @tab X
- at item SDP                       @tab   @tab X
- at item Sega FILM/CPK             @tab   @tab X
-    @tab Used in many Sega Saturn console games.
- at item Sierra SOL                @tab   @tab X
-    @tab .sol files used in Sierra Online games.
- at item Sierra VMD                @tab   @tab X
-    @tab Used in Sierra CD-ROM games.
- at item Smacker                   @tab   @tab X
-    @tab Multimedia format used by many games.
- at item Sony OpenMG (OMA)         @tab   @tab X
-    @tab Audio format used in Sony Sonic Stage and Sony Vegas.
- at item Sony PlayStation STR      @tab   @tab X
- at item Sony Wave64 (W64)         @tab   @tab X
- at item SoX native format         @tab X @tab X
- at item SUN AU format             @tab X @tab X
- at item THP                       @tab   @tab X
-    @tab Used on the Nintendo GameCube.
- at item Tiertex Limited SEQ       @tab   @tab X
-    @tab Tiertex .seq files used in the DOS CD-ROM version of the game Flashback.
- at item True Audio                @tab   @tab X
- at item VC-1 test bitstream       @tab X @tab X
- at item WAV                       @tab X @tab X
- at item WavPack                   @tab   @tab X
- at item WebM                      @tab X @tab X
- at item Wing Commander III movie  @tab   @tab X
-    @tab Multimedia format used in Origin's Wing Commander III computer game.
- at item Westwood Studios audio    @tab   @tab X
-    @tab Multimedia format used in Westwood Studios games.
- at item Westwood Studios VQA      @tab   @tab X
-    @tab Multimedia format used in Westwood Studios games.
- at item YUV4MPEG pipe             @tab X @tab X
- at item Psygnosis YOP             @tab   @tab X
- at end multitable
-
- at code{X} means that encoding (resp. decoding) is supported.
-
- at section Image Formats
-
-FFmpeg can read and write images for each frame of a video sequence. The
-following image formats are supported:
-
- at multitable @columnfractions .4 .1 .1 .4
- at item Name @tab Encoding @tab Decoding @tab Comments
- at item .Y.U.V       @tab X @tab X
-    @tab one raw file per component
- at item animated GIF @tab X @tab X
-    @tab Only uncompressed GIFs are generated.
- at item BMP          @tab X @tab X
-    @tab Microsoft BMP image
- at item DPX          @tab   @tab X
-    @tab Digital Picture Exchange
- at item JPEG         @tab X @tab X
-    @tab Progressive JPEG is not supported.
- at item JPEG 2000    @tab   @tab E
-    @tab decoding supported through external library libopenjpeg
- at item JPEG-LS      @tab X @tab X
- at item LJPEG        @tab X @tab
-    @tab Lossless JPEG
- at item PAM          @tab X @tab X
-    @tab PAM is a PNM extension with alpha support.
- at item PBM          @tab X @tab X
-    @tab Portable BitMap image
- at item PCX          @tab X @tab X
-    @tab PC Paintbrush
- at item PGM          @tab X @tab X
-    @tab Portable GrayMap image
- at item PGMYUV       @tab X @tab X
-    @tab PGM with U and V components in YUV 4:2:0
- at item PNG          @tab X @tab X
-    @tab 2/4 bpp not supported yet
- at item PPM          @tab X @tab X
-    @tab Portable PixelMap image
- at item PTX          @tab   @tab X
-    @tab V.Flash PTX format
- at item SGI          @tab X @tab X
-    @tab SGI RGB image format
- at item Sun Rasterfile  @tab   @tab X
-    @tab Sun RAS image format
- at item TIFF         @tab X @tab X
-    @tab YUV, JPEG and some extension is not supported yet.
- at item Truevision Targa  @tab X @tab X
-    @tab Targa (.TGA) image format
- at end multitable
-
- at code{X} means that encoding (resp. decoding) is supported.
-
- at code{E} means that support is provided through an external library.
-
- at section Video Codecs
-
- at multitable @columnfractions .4 .1 .1 .4
- at item Name @tab Encoding @tab Decoding @tab Comments
- at item 4X Movie               @tab     @tab  X
-    @tab Used in certain computer games.
- at item 8088flex TMV           @tab     @tab  X
- at item 8SVX exponential       @tab     @tab  X
- at item 8SVX fibonacci         @tab     @tab  X
- at item American Laser Games MM  @tab    @tab X
-    @tab Used in games like Mad Dog McCree.
- at item AMV Video              @tab     @tab  X
-    @tab Used in Chinese MP3 players.
- at item Apple MJPEG-B          @tab     @tab  X
- at item Apple QuickDraw        @tab     @tab  X
-    @tab fourcc: qdrw
- at item Asus v1                @tab  X  @tab  X
-    @tab fourcc: ASV1
- at item Asus v2                @tab  X  @tab  X
-    @tab fourcc: ASV2
- at item ATI VCR1               @tab     @tab  X
-    @tab fourcc: VCR1
- at item ATI VCR2               @tab     @tab  X
-    @tab fourcc: VCR2
- at item Auravision Aura        @tab     @tab  X
- at item Auravision Aura 2      @tab     @tab  X
- at item Autodesk Animator Flic video  @tab     @tab  X
- at item Autodesk RLE           @tab     @tab  X
-    @tab fourcc: AASC
- at item AVS (Audio Video Standard) video  @tab     @tab  X
-    @tab Video encoding used by the Creature Shock game.
- at item Beam Software VB       @tab     @tab  X
- at item Bethesda VID video     @tab     @tab  X
-    @tab Used in some games from Bethesda Softworks.
- at item Bink Video             @tab     @tab  X
-    @tab Support for version 'b' is missing.
- at item Brute Force & Ignorance   @tab   @tab X
-    @tab Used in the game Flash Traffic: City of Angels.
- at item C93 video              @tab     @tab  X
-    @tab Codec used in Cyberia game.
- at item CamStudio              @tab     @tab  X
-    @tab fourcc: CSCD
- at item CD+G                   @tab     @tab  X
-    @tab Video codec for CD+G karaoke disks
- at item Chinese AVS video      @tab     @tab  X
-    @tab AVS1-P2, JiZhun profile
- at item Delphine Software International CIN video  @tab     @tab  X
-    @tab Codec used in Delphine Software International games.
- at item Cinepak                @tab     @tab  X
- at item Cirrus Logic AccuPak   @tab     @tab  X
-    @tab fourcc: CLJR
- at item Creative YUV (CYUV)    @tab     @tab  X
- at item Dirac                  @tab  E  @tab  E
-    @tab supported through external libdirac/libschroedinger libraries
- at item Deluxe Paint Animation @tab     @tab  X
- at item DNxHD                  @tab   X @tab  X
-    @tab aka SMPTE VC3
- at item Duck TrueMotion 1.0   @tab     @tab  X
-    @tab fourcc: DUCK
- at item Duck TrueMotion 2.0    @tab     @tab  X
-    @tab fourcc: TM20
- at item DV (Digital Video)     @tab  X  @tab  X
- at item Feeble Files/ScummVM DXA  @tab     @tab  X
-    @tab Codec originally used in Feeble Files game.
- at item Electronic Arts CMV video  @tab     @tab  X
-    @tab Used in NHL 95 game.
- at item Electronic Arts Madcow video  @tab     @tab  X
- at item Electronic Arts TGV video  @tab     @tab  X
- at item Electronic Arts TGQ video  @tab     @tab  X
- at item Electronic Arts TQI video  @tab     @tab  X
- at item Escape 124             @tab     @tab  X
- at item FFmpeg video codec #1  @tab  X  @tab  X
-    @tab experimental lossless codec (fourcc: FFV1)
- at item Flash Screen Video v1  @tab  X  @tab  X
-    @tab fourcc: FSV1
- at item Flash Video (FLV)      @tab  X  @tab  X
-    @tab Sorenson H.263 used in Flash
- at item Fraps                  @tab     @tab  X
- at item H.261                  @tab  X  @tab  X
- at item H.263 / H.263-1996     @tab  X  @tab  X
- at item H.263+ / H.263-1998 / H.263 version 2  @tab  X  @tab  X
- at item H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10  @tab  E  @tab  X
-    @tab encoding supported through external library libx264
- at item H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)  @tab  E  @tab  X
- at item HuffYUV                @tab  X  @tab  X
- at item HuffYUV FFmpeg variant @tab  X  @tab  X
- at item IBM Ultimotion         @tab     @tab  X
-    @tab fourcc: ULTI
- at item id Cinematic video     @tab     @tab  X
-    @tab Used in Quake II.
- at item id RoQ video           @tab  X  @tab  X
-    @tab Used in Quake III, Jedi Knight 2, other computer games.
- at item IFF ILBM               @tab     @tab  X
-    @tab IFF interlaved bitmap
- at item IFF ByteRun1           @tab     @tab  X
-    @tab IFF run length encoded bitmap
- at item Intel H.263            @tab     @tab  X
- at item Intel Indeo 2          @tab     @tab  X
- at item Intel Indeo 3          @tab     @tab  X
- at item Intel Indeo 5          @tab     @tab  X
- at item Interplay C93          @tab     @tab  X
-    @tab Used in the game Cyberia from Interplay.
- at item Interplay MVE video    @tab     @tab  X
-    @tab Used in Interplay .MVE files.
- at item Karl Morton's video codec  @tab     @tab  X
-    @tab Codec used in Worms games.
- at item Kega Game Video (KGV1) @tab      @tab  X
-    @tab Kega emulator screen capture codec.
- at item LCL (LossLess Codec Library) MSZH  @tab     @tab  X
- at item LCL (LossLess Codec Library) ZLIB  @tab  E  @tab  E
- at item LOCO                   @tab     @tab  X
- at item lossless MJPEG         @tab  X  @tab  X
- at item Microsoft RLE          @tab     @tab  X
- at item Microsoft Video 1      @tab     @tab  X
- at item Mimic                  @tab     @tab  X
-    @tab Used in MSN Messenger Webcam streams.
- at item Miro VideoXL           @tab     @tab  X
-    @tab fourcc: VIXL
- at item MJPEG (Motion JPEG)    @tab  X  @tab  X
- at item Motion Pixels video    @tab     @tab  X
- at item MPEG-1 video           @tab  X  @tab  X
- at item MPEG-1/2 video XvMC (X-Video Motion Compensation)  @tab     @tab  X
- at item MPEG-1/2 video (VDPAU acceleration)  @tab     @tab  X
- at item MPEG-2 video           @tab  X  @tab  X
- at item MPEG-4 part 2          @tab  X  @tab  X
-    @ libxvidcore can be used alternatively for encoding.
- at item MPEG-4 part 2 Microsoft variant version 1  @tab  X  @tab  X
- at item MPEG-4 part 2 Microsoft variant version 2  @tab  X  @tab  X
- at item MPEG-4 part 2 Microsoft variant version 3  @tab  X  @tab  X
- at item Nintendo Gamecube THP video  @tab     @tab  X
- at item NuppelVideo/RTjpeg     @tab     @tab  X
-    @tab Video encoding used in NuppelVideo files.
- at item On2 VP3                @tab     @tab  X
-    @tab still experimental
- at item On2 VP5                @tab     @tab  X
-    @tab fourcc: VP50
- at item On2 VP6                @tab     @tab  X
-    @tab fourcc: VP60,VP61,VP62
- at item VP8                    @tab  X  @tab  X
-    @tab fourcc: VP80, de/encoding supported through external library libvpx
- at item planar RGB             @tab     @tab  X
-    @tab fourcc: 8BPS
- at item Q-team QPEG            @tab     @tab  X
-    @tab fourccs: QPEG, Q1.0, Q1.1
- at item QuickTime 8BPS video   @tab     @tab  X
- at item QuickTime Animation (RLE) video  @tab  X  @tab  X
-    @tab fourcc: 'rle '
- at item QuickTime Graphics (SMC)  @tab     @tab  X
-    @tab fourcc: 'smc '
- at item QuickTime video (RPZA) @tab     @tab  X
-    @tab fourcc: rpza
- at item R210 Quicktime Uncompressed RGB 10-bit     @tab     @tab  X
- at item Raw Video              @tab  X  @tab  X
- at item RealVideo 1.0          @tab  X  @tab  X
- at item RealVideo 2.0          @tab  X  @tab  X
- at item RealVideo 3.0          @tab     @tab  X
-    @tab still far from ideal
- at item RealVideo 4.0          @tab     @tab  X
- at item Renderware TXD (TeXture Dictionary)  @tab     @tab  X
-    @tab Texture dictionaries used by the Renderware Engine.
- at item RL2 video              @tab     @tab  X
-    @tab used in some games by Entertainment Software Partners
- at item Sierra VMD video       @tab     @tab  X
-    @tab Used in Sierra VMD files.
- at item Smacker video          @tab     @tab  X
-    @tab Video encoding used in Smacker.
- at item SMPTE VC-1             @tab     @tab  X
- at item Snow                   @tab  X  @tab  X
-    @tab experimental wavelet codec (fourcc: SNOW)
- at item Sony PlayStation MDEC (Motion DECoder)  @tab     @tab  X
- at item Sorenson Vector Quantizer 1  @tab  X  @tab  X
-    @tab fourcc: SVQ1
- at item Sorenson Vector Quantizer 3  @tab     @tab  X
-    @tab fourcc: SVQ3
- at item Sunplus JPEG (SP5X)    @tab     @tab  X
-    @tab fourcc: SP5X
- at item TechSmith Screen Capture Codec  @tab     @tab  X
-    @tab fourcc: TSCC
- at item Theora                 @tab  E  @tab  X
-    @tab encoding supported through external library libtheora
- at item Tiertex Limited SEQ video  @tab     @tab  X
-    @tab Codec used in DOS CD-ROM FlashBack game.
- at item V210 Quicktime Uncompressed 4:2:2 10-bit     @tab  X  @tab  X
- at item VMware Screen Codec / VMware Video  @tab     @tab  X
-    @tab Codec used in videos captured by VMware.
- at item Westwood Studios VQA (Vector Quantized Animation) video  @tab     @tab  X
- at item Windows Media Video 7  @tab  X  @tab  X
- at item Windows Media Video 8  @tab  X  @tab  X
- at item Windows Media Video 9  @tab     @tab  X
-    @tab not completely working
- at item Wing Commander III / Xan  @tab     @tab  X
-    @tab Used in Wing Commander III .MVE files.
- at item Winnov WNV1            @tab     @tab  X
- at item WMV7                   @tab  X  @tab  X
- at item YAMAHA SMAF            @tab  X  @tab  X
- at item Psygnosis YOP Video    @tab     @tab  X
- at item ZLIB                   @tab  X  @tab  X
-    @tab part of LCL, encoder experimental
- at item Zip Motion Blocks Video  @tab   X @tab  X
-    @tab Encoder works only in PAL8.
- at end multitable
-
- at code{X} means that encoding (resp. decoding) is supported.
-
- at code{E} means that support is provided through an external library.
-
- at section Audio Codecs
-
- at multitable @columnfractions .4 .1 .1 .4
- at item Name @tab Encoding @tab Decoding @tab Comments
- at item 8SVX audio             @tab     @tab  X
- at item AAC                    @tab  E  @tab  X
-    @tab encoding supported through external library libfaac
- at item AC-3                   @tab IX  @tab  X
- at item ADPCM 4X Movie         @tab     @tab  X
- at item ADPCM CDROM XA         @tab     @tab  X
- at item ADPCM Creative Technology @tab     @tab  X
-    @tab 16 -> 4, 8 -> 4, 8 -> 3, 8 -> 2
- at item ADPCM Electronic Arts  @tab     @tab  X
-    @tab Used in various EA titles.
- at item ADPCM Electronic Arts Maxis CDROM XS  @tab     @tab  X
-    @tab Used in Sim City 3000.
- at item ADPCM Electronic Arts R1  @tab     @tab  X
- at item ADPCM Electronic Arts R2  @tab     @tab  X
- at item ADPCM Electronic Arts R3  @tab     @tab  X
- at item ADPCM Electronic Arts XAS @tab     @tab  X
- at item ADPCM G.726            @tab  X  @tab  X
- at item ADPCM IMA AMV          @tab     @tab  X
-    @tab Used in AMV files
- at item ADPCM IMA Electronic Arts EACS  @tab     @tab  X
- at item ADPCM IMA Electronic Arts SEAD  @tab     @tab  X
- at item ADPCM IMA Funcom       @tab     @tab  X
- at item ADPCM IMA QuickTime    @tab  X  @tab  X
- at item ADPCM IMA Loki SDL MJPEG  @tab     @tab  X
- at item ADPCM IMA WAV          @tab  X  @tab  X
- at item ADPCM IMA Westwood     @tab     @tab  X
- at item ADPCM ISS IMA          @tab     @tab  X
-    @tab Used in FunCom games.
- at item ADPCM IMA Duck DK3     @tab     @tab  X
-    @tab Used in some Sega Saturn console games.
- at item ADPCM IMA Duck DK4     @tab     @tab  X
-    @tab Used in some Sega Saturn console games.
- at item ADPCM Microsoft        @tab  X  @tab  X
- at item ADPCM MS IMA           @tab  X  @tab  X
- at item ADPCM Nintendo Gamecube THP  @tab     @tab  X
- at item ADPCM QT IMA           @tab  X  @tab  X
- at item ADPCM SEGA CRI ADX     @tab  X  @tab  X
-    @tab Used in Sega Dreamcast games.
- at item ADPCM Shockwave Flash  @tab  X  @tab  X
- at item ADPCM SMJPEG IMA       @tab     @tab  X
-    @tab Used in certain Loki game ports.
- at item ADPCM Sound Blaster Pro 2-bit  @tab     @tab  X
- at item ADPCM Sound Blaster Pro 2.6-bit  @tab     @tab  X
- at item ADPCM Sound Blaster Pro 4-bit  @tab     @tab  X
- at item ADPCM Westwood Studios IMA @tab     @tab  X
-    @tab Used in Westwood Studios games like Command and Conquer.
- at item ADPCM Yamaha           @tab  X  @tab  X
- at item AMR-NB                 @tab  E  @tab  X
-    @tab encoding supported through external library libopencore-amrnb
- at item AMR-WB                 @tab     @tab  E
-    @tab decoding supported through external library libopencore-amrwb
- at item Apple lossless audio   @tab  X  @tab  X
-    @tab QuickTime fourcc 'alac'
- at item Atrac 1                @tab     @tab  X
- at item Atrac 3                @tab     @tab  X
- at item Bink Audio             @tab     @tab  X
-    @tab Used in Bink and Smacker files in many games.
- at item Delphine Software International CIN audio  @tab     @tab  X
-    @tab Codec used in Delphine Software International games.
- at item COOK                   @tab     @tab  X
-    @tab All versions except 5.1 are supported.
- at item DCA (DTS Coherent Acoustics)  @tab     @tab  X
- at item DPCM id RoQ            @tab  X  @tab  X
-    @tab Used in Quake III, Jedi Knight 2, other computer games.
- at item DPCM Interplay         @tab     @tab  X
-    @tab Used in various Interplay computer games.
- at item DPCM Sierra Online     @tab     @tab  X
-    @tab Used in Sierra Online game audio files.
- at item DPCM Sol               @tab     @tab  X
- at item DPCM Xan               @tab     @tab  X
-    @tab Used in Origin's Wing Commander IV AVI files.
- at item DSP Group TrueSpeech   @tab     @tab  X
- at item DV audio               @tab     @tab  X
- at item Enhanced AC-3          @tab     @tab  X
- at item FLAC (Free Lossless Audio Codec)  @tab  X  @tab  IX
- at item G.729                  @tab     @tab  X
- at item GSM                    @tab  E  @tab  E
-    @tab supported through external library libgsm
- at item GSM Microsoft variant  @tab  E  @tab  E
-    @tab supported through external library libgsm
- at item IMC (Intel Music Coder)  @tab     @tab  X
- at item MACE (Macintosh Audio Compression/Expansion) 3:1  @tab     @tab  X
- at item MACE (Macintosh Audio Compression/Expansion) 6:1  @tab     @tab  X
- at item MLP (Meridian Lossless Packing)  @tab     @tab  X
-    @tab Used in DVD-Audio discs.
- at item Monkey's Audio         @tab     @tab  X
-    @tab Only versions 3.97-3.99 are supported.
- at item MP1 (MPEG audio layer 1)  @tab     @tab IX
- at item MP2 (MPEG audio layer 2)  @tab IX  @tab IX
- at item MP3 (MPEG audio layer 3)  @tab  E  @tab IX
-    @tab encoding supported through external library LAME, ADU MP3 and MP3onMP4 also supported
- at item MPEG-4 Audio Lossless Coding (ALS)  @tab     @tab  X
- at item Musepack SV7           @tab     @tab  X
- at item Musepack SV8           @tab     @tab  X
- at item Nellymoser Asao        @tab  X  @tab  X
- at item PCM A-law              @tab  X  @tab  X
- at item PCM mu-law             @tab  X  @tab  X
- at item PCM 16-bit little-endian planar  @tab     @tab  X
- at item PCM 32-bit floating point big-endian  @tab  X  @tab  X
- at item PCM 32-bit floating point little-endian  @tab  X  @tab  X
- at item PCM 64-bit floating point big-endian  @tab  X  @tab  X
- at item PCM 64-bit floating point little-endian  @tab  X  @tab  X
- at item PCM D-Cinema audio signed 24-bit   @tab  X  @tab  X
- at item PCM signed 8-bit       @tab  X  @tab  X
- at item PCM signed 16-bit big-endian  @tab  X  @tab  X
- at item PCM signed 16-bit little-endian  @tab  X  @tab  X
- at item PCM signed 24-bit big-endian  @tab  X  @tab  X
- at item PCM signed 24-bit little-endian  @tab  X  @tab  X
- at item PCM signed 32-bit big-endian  @tab  X  @tab  X
- at item PCM signed 32-bit little-endian  @tab  X  @tab  X
- at item PCM signed 16/20/24-bit big-endian in MPEG-TS  @tab     @tab  X
- at item PCM unsigned 8-bit     @tab  X  @tab  X
- at item PCM unsigned 16-bit big-endian  @tab  X  @tab  X
- at item PCM unsigned 16-bit little-endian  @tab  X  @tab  X
- at item PCM unsigned 24-bit big-endian  @tab  X  @tab  X
- at item PCM unsigned 24-bit little-endian  @tab  X  @tab  X
- at item PCM unsigned 32-bit big-endian  @tab  X  @tab  X
- at item PCM unsigned 32-bit little-endian  @tab  X  @tab  X
- at item PCM Zork               @tab  X  @tab  X
- at item QCELP / PureVoice      @tab     @tab  X
- at item QDesign Music Codec 2  @tab     @tab  X
-    @tab There are still some distortions.
- at item RealAudio 1.0 (14.4K)  @tab     @tab  X
-    @tab Real 14400 bit/s codec
- at item RealAudio 2.0 (28.8K)  @tab     @tab  X
-    @tab Real 28800 bit/s codec
- at item RealAudio 3.0 (dnet)   @tab IX  @tab  X
-    @tab Real low bitrate AC-3 codec
- at item RealAudio SIPR / ACELP.NET @tab     @tab  X
- at item Shorten                @tab     @tab  X
- at item Sierra VMD audio       @tab     @tab  X
-    @tab Used in Sierra VMD files.
- at item Smacker audio          @tab     @tab  X
- at item Sonic                  @tab  X  @tab  X
-    @tab experimental codec
- at item Sonic lossless         @tab  X  @tab  X
-    @tab experimental codec
- at item Speex                  @tab     @tab  E
-    @tab supported through external library libspeex
- at item True Audio (TTA)       @tab     @tab  X
- at item TrueHD                 @tab     @tab  X
-    @tab Used in HD-DVD and Blu-Ray discs.
- at item TwinVQ (VQF flavor)    @tab     @tab  X
- at item Vorbis                 @tab  E  @tab  X
-    @tab A native but very primitive encoder exists.
- at item WavPack                @tab     @tab  X
- at item Westwood Audio (SND1)  @tab     @tab  X
- at item Windows Media Audio 1  @tab  X  @tab  X
- at item Windows Media Audio 2  @tab  X  @tab  X
- at item Windows Media Audio Pro @tab    @tab  X
- at item Windows Media Audio Voice @tab  @tab  X
- at end multitable
-
- at code{X} means that encoding (resp. decoding) is supported.
-
- at code{E} means that support is provided through an external library.
-
- at code{I} means that an integer-only version is available, too (ensures high
-performance on systems without hardware floating point support).
-
- at section Subtitle Formats
-
- at multitable @columnfractions .4 .1 .1 .1 .1
- at item Name @tab Muxing @tab Demuxing @tab Encoding @tab Decoding
- at item SSA/ASS      @tab X @tab X
- at item DVB          @tab X @tab X @tab X @tab X
- at item DVD          @tab X @tab X @tab X @tab X
- at item PGS          @tab   @tab   @tab   @tab X
- at item XSUB         @tab   @tab   @tab X @tab X
- at end multitable
-
- at code{X} means that the feature is supported.
-
- at section Network Protocols
-
- at multitable @columnfractions .4 .1
- at item Name         @tab Support
- at item file         @tab X
- at item Gopher       @tab X
- at item HTTP         @tab X
- at item pipe         @tab X
- at item RTP          @tab X
- at item TCP          @tab X
- at item UDP          @tab X
- at end multitable
-
- at code{X} means that the protocol is supported.
-
-
- at section Input/Output Devices
-
- at multitable @columnfractions .4 .1 .1
- at item Name              @tab Input  @tab Output
- at item ALSA              @tab X      @tab X
- at item BEOS audio        @tab X      @tab X
- at item BKTR              @tab X      @tab
- at item DV1394            @tab X      @tab
- at item JACK              @tab X      @tab
- at item LIBDC1394         @tab X      @tab
- at item OSS               @tab X      @tab X
- at item Video4Linux       @tab X      @tab
- at item Video4Linux2      @tab X      @tab
- at item VfW capture       @tab X      @tab
- at item X11 grabbing      @tab X      @tab
- at end multitable
-
- at code{X} means that input/output is supported.
-
-
- at chapter Platform Specific information
-
- at section BeOS
-
-BeOS support is broken in mysterious ways.
-
- at section DOS
-
-Using a cross-compiler is preferred for various reasons.
-
- at subsection DJGPP
-
-FFmpeg cannot be compiled because of broken system headers, add
- at code{--extra-cflags=-U__STRICT_ANSI__} to the configure options as a
-workaround.
-
- at section OS/2
-
-For information about compiling FFmpeg on OS/2 see
- at url{http://www.edm2.com/index.php/FFmpeg}.
-
- at section Unix-like
-
-Some parts of FFmpeg cannot be built with version 2.15 of the GNU
-assembler which is still provided by a few AMD64 distributions. To
-make sure your compiler really uses the required version of gas
-after a binutils upgrade, run:
-
- at example
-$(gcc -print-prog-name=as) --version
- at end example
-
-If not, then you should install a different compiler that has no
-hard-coded path to gas. In the worst case pass @code{--disable-asm}
-to configure.
-
- at subsection BSD
-
-BSD make will not build FFmpeg, you need to install and use GNU Make
-(@file{gmake}).
-
- at subsubsection FreeBSD
-
-FreeBSD will not compile out-of-the-box due to broken system headers.
-Passing @code{--extra-cflags=-D__BSD_VISIBLE} to configure will work
-around the problem. This may have unexpected sideeffects, so use it at
-your own risk. If you care about FreeBSD, please make an attempt at
-getting the system headers fixed.
-
- at subsection (Open)Solaris
-
-GNU Make is required to build FFmpeg, so you have to invoke (@file{gmake}),
-standard Solaris Make will not work. When building with a non-c99 front-end
-(gcc, generic suncc) add either @code{--extra-libs=/usr/lib/values-xpg6.o}
-or @code{--extra-libs=/usr/lib/64/values-xpg6.o} to the configure options
-since the libc is not c99-compliant by default. The probes performed by
-configure may raise an exception leading to the death of configure itself
-due to a bug in the system shell. Simply invoke a different shell such as
-bash directly to work around this:
-
- at example
-bash ./configure
- at end example
-
- at section Windows
-
-To get help and instructions for building FFmpeg under Windows, check out
-the FFmpeg Windows Help Forum at
- at url{http://ffmpeg.arrozcru.org/}.
-
- at subsection Native Windows compilation
-
-FFmpeg can be built to run natively on Windows using the MinGW tools. Install
-the latest versions of MSYS and MinGW from @url{http://www.mingw.org/}.
-You can find detailed installation
-instructions in the download section and the FAQ.
-
-FFmpeg does not build out-of-the-box with the packages the automated MinGW
-installer provides. It also requires coreutils to be installed and many other
-packages updated to the latest version. The minimum version for some packages
-are listed below:
-
- at itemize
- at item bash 3.1
- at item msys-make 3.81-2 (note: not mingw32-make)
- at item w32api 3.13
- at item mingw-runtime 3.15
- at end itemize
-
-FFmpeg automatically passes @code{-fno-common} to the compiler to work around
-a GCC bug (see @url{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216}).
-
-Within the MSYS shell, configure and make with:
-
- at example
-./configure --enable-memalign-hack
-make
-make install
- at end example
-
-This will install @file{ffmpeg.exe} along with many other development files
-to @file{/usr/local}. You may specify another install path using the
- at code{--prefix} option in @file{configure}.
-
-Notes:
-
- at itemize
-
- at item Building natively using MSYS can be sped up by disabling implicit rules
-in the Makefile by calling @code{make -r} instead of plain @code{make}. This
-speed up is close to non-existent for normal one-off builds and is only
-noticeable when running make for a second time (for example in
- at code{make install}).
-
- at item In order to compile FFplay, you must have the MinGW development library
-of SDL. Get it from @url{http://www.libsdl.org}.
-Edit the @file{bin/sdl-config} script so that it points to the correct prefix
-where SDL was installed. Verify that @file{sdl-config} can be launched from
-the MSYS command line.
-
- at item By using @code{./configure --enable-shared} when configuring FFmpeg,
-you can build libavutil, libavcodec and libavformat as DLLs.
-
- at end itemize
-
- at subsection Microsoft Visual C++ compatibility
-
-As stated in the FAQ, FFmpeg will not compile under MSVC++. However, if you
-want to use the libav* libraries in your own applications, you can still
-compile those applications using MSVC++. But the libav* libraries you link
-to @emph{must} be built with MinGW. However, you will not be able to debug
-inside the libav* libraries, since MSVC++ does not recognize the debug
-symbols generated by GCC.
-We strongly recommend you to move over from MSVC++ to MinGW tools.
-
-This description of how to use the FFmpeg libraries with MSVC++ is based on
-Microsoft Visual C++ 2005 Express Edition. If you have a different version,
-you might have to modify the procedures slightly.
-
- at subsubsection Using static libraries
-
-Assuming you have just built and installed FFmpeg in @file{/usr/local}.
-
- at enumerate
-
- at item Create a new console application ("File / New / Project") and then
-select "Win32 Console Application". On the appropriate page of the
-Application Wizard, uncheck the "Precompiled headers" option.
-
- at item Write the source code for your application, or, for testing, just
-copy the code from an existing sample application into the source file
-that MSVC++ has already created for you. For example, you can copy
- at file{libavformat/output-example.c} from the FFmpeg distribution.
-
- at item Open the "Project / Properties" dialog box. In the "Configuration"
-combo box, select "All Configurations" so that the changes you make will
-affect both debug and release builds. In the tree view on the left hand
-side, select "C/C++ / General", then edit the "Additional Include
-Directories" setting to contain the path where the FFmpeg includes were
-installed (i.e. @file{c:\msys\1.0\local\include}).
-Do not add MinGW's include directory here, or the include files will
-conflict with MSVC's.
-
- at item Still in the "Project / Properties" dialog box, select
-"Linker / General" from the tree view and edit the
-"Additional Library Directories" setting to contain the @file{lib}
-directory where FFmpeg was installed (i.e. @file{c:\msys\1.0\local\lib}),
-the directory where MinGW libs are installed (i.e. @file{c:\mingw\lib}),
-and the directory where MinGW's GCC libs are installed
-(i.e. @file{C:\mingw\lib\gcc\mingw32\4.2.1-sjlj}). Then select
-"Linker / Input" from the tree view, and add the files @file{libavformat.a},
- at file{libavcodec.a}, @file{libavutil.a}, @file{libmingwex.a},
- at file{libgcc.a}, and any other libraries you used (i.e. @file{libz.a})
-to the end of "Additional Dependencies".
-
- at item Now, select "C/C++ / Code Generation" from the tree view. Select
-"Debug" in the "Configuration" combo box. Make sure that "Runtime
-Library" is set to "Multi-threaded Debug DLL". Then, select "Release" in
-the "Configuration" combo box and make sure that "Runtime Library" is
-set to "Multi-threaded DLL".
-
- at item Click "OK" to close the "Project / Properties" dialog box.
-
- at item MSVC++ lacks some C99 header files that are fundamental for FFmpeg.
-Get msinttypes from @url{http://code.google.com/p/msinttypes/downloads/list}
-and install it in MSVC++'s include directory
-(i.e. @file{C:\Program Files\Microsoft Visual Studio 8\VC\include}).
-
- at item MSVC++ also does not understand the @code{inline} keyword used by
-FFmpeg, so you must add this line before @code{#include}ing libav*:
- at example
-#define inline _inline
- at end example
-
- at item Build your application, everything should work.
-
- at end enumerate
-
- at subsubsection Using shared libraries
-
-This is how to create DLL and LIB files that are compatible with MSVC++:
-
- at enumerate
-
- at item Add a call to @file{vcvars32.bat} (which sets up the environment
-variables for the Visual C++ tools) as the first line of @file{msys.bat}.
-The standard location for @file{vcvars32.bat} is
- at file{C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat},
-and the standard location for @file{msys.bat} is @file{C:\msys\1.0\msys.bat}.
-If this corresponds to your setup, add the following line as the first line
-of @file{msys.bat}:
-
- at example
-call "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat"
- at end example
-
-Alternatively, you may start the @file{Visual Studio 2005 Command Prompt},
-and run @file{c:\msys\1.0\msys.bat} from there.
-
- at item Within the MSYS shell, run @code{lib.exe}. If you get a help message
-from @file{Microsoft (R) Library Manager}, this means your environment
-variables are set up correctly, the @file{Microsoft (R) Library Manager}
-is on the path and will be used by FFmpeg to create
-MSVC++-compatible import libraries.
-
- at item Build FFmpeg with
-
- at example
-./configure --enable-shared --enable-memalign-hack
-make
-make install
- at end example
-
-Your install path (@file{/usr/local/} by default) should now have the
-necessary DLL and LIB files under the @file{bin} directory.
-
- at end enumerate
-
-To use those files with MSVC++, do the same as you would do with
-the static libraries, as described above. But in Step 4,
-you should only need to add the directory where the LIB files are installed
-(i.e. @file{c:\msys\usr\local\bin}). This is not a typo, the LIB files are
-installed in the @file{bin} directory. And instead of adding @file{libxx.a}
-files, you should add @file{avcodec.lib}, @file{avformat.lib}, and
- at file{avutil.lib}. There should be no need for @file{libmingwex.a},
- at file{libgcc.a}, and @file{wsock32.lib}, nor any other external library
-statically linked into the DLLs. The @file{bin} directory contains a bunch
-of DLL files, but the ones that are actually used to run your application
-are the ones with a major version number in their filenames
-(i.e. @file{avcodec-51.dll}).
-
- at subsection Cross compilation for Windows with Linux
-
-You must use the MinGW cross compilation tools available at
- at url{http://www.mingw.org/}.
-
-Then configure FFmpeg with the following options:
- at example
-./configure --target-os=mingw32 --cross-prefix=i386-mingw32msvc-
- at end example
-(you can change the cross-prefix according to the prefix chosen for the
-MinGW tools).
-
-Then you can easily test FFmpeg with Wine
-(@url{http://www.winehq.com/}).
-
- at subsection Compilation under Cygwin
-
-Please use Cygwin 1.7.x as the obsolete 1.5.x Cygwin versions lack
-llrint() in its C library.
-
-Install your Cygwin with all the "Base" packages, plus the
-following "Devel" ones:
- at example
-binutils, gcc4-core, make, subversion, mingw-runtime, texi2html
- at end example
-
-And the following "Utils" one:
- at example
-diffutils
- at end example
-
-Then run
-
- at example
-./configure --enable-static --disable-shared
- at end example
-
-to make a static build.
-
-The current @code{gcc4-core} package is buggy and needs this flag to build
-shared libraries:
-
- at example
-./configure --enable-shared --disable-static --extra-cflags=-fno-reorder-functions
- at end example
-
-If you want to build FFmpeg with additional libraries, download Cygwin
-"Devel" packages for Ogg and Vorbis from any Cygwin packages repository:
- at example
-libogg-devel, libvorbis-devel
- at end example
-
-These library packages are only available from Cygwin Ports
-(@url{http://sourceware.org/cygwinports/}) :
-
- at example
-yasm, libSDL-devel, libdirac-devel, libfaac-devel, libfaad-devel, libgsm-devel,
-libmp3lame-devel, libschroedinger1.0-devel, speex-devel, libtheora-devel,
-libxvidcore-devel
- at end example
-
-The recommendation for libnut and x264 is to build them from source by
-yourself, as they evolve too quickly for Cygwin Ports to be up to date.
-
-Cygwin 1.7.x has IPv6 support. You can add IPv6 to Cygwin 1.5.x by means
-of the @code{libgetaddrinfo-devel} package, available at Cygwin Ports.
-
- at subsection Crosscompilation for Windows under Cygwin
-
-With Cygwin you can create Windows binaries that do not need the cygwin1.dll.
-
-Just install your Cygwin as explained before, plus these additional
-"Devel" packages:
- at example
-gcc-mingw-core, mingw-runtime, mingw-zlib
- at end example
-
-and add some special flags to your configure invocation.
-
-For a static build run
- at example
-./configure --target-os=mingw32 --enable-memalign-hack --enable-static --disable-shared --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
- at end example
-
-and for a build with shared libraries
- at example
-./configure --target-os=mingw32 --enable-memalign-hack --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
- at end example
-
- at bye
diff --git a/doc/issue_tracker.txt b/doc/issue_tracker.txt
deleted file mode 100644
index e5a74db..0000000
--- a/doc/issue_tracker.txt
+++ /dev/null
@@ -1,228 +0,0 @@
-FFmpeg's bug/patch/feature request tracker manual
-=================================================
-
-NOTE: This is a draft.
-
-Overview:
----------
-FFmpeg uses Roundup for tracking issues, new issues and changes to
-existing issues can be done through a web interface and through email.
-It is possible to subscribe to individual issues by adding yourself to the
-nosy list or to subscribe to the ffmpeg-issues mailing list which receives
-a mail for every change to every issue. Replies to such mails will also
-be properly added to the respective issue.
-(the above does all work already after light testing)
-The subscription URL for the ffmpeg-issues list is:
-http://live.polito/mailman/listinfo/ffmpeg-issues
-The URL of the webinterface of the tracker is:
-http(s)://roundup.ffmpeg/roundup/ffmpeg/
-Note the URLs in this document are obfuscated, you must append the top level
-domain for non-profit organizations to the tracker, and of Italy to the
-mailing list.
-
-Email Interface:
-----------------
-There is a mailing list to which all new issues and changes to existing issues
-are sent. You can subscribe through
-http://live.polito/mailman/listinfo/ffmpeg-issues
-Replies to messages there will have their text added to the specific issues.
-Attachments will be added as if they had been uploaded via the web interface.
-You can change the status, substatus, topic, ... by changing the subject in
-your reply like:
-Re: [issue94] register_avcodec and allcodecs.h [type=patch;status=open;substatus=approved]
-Roundup will then change things as you requested and remove the [...] from
-the subject before forwarding the mail to the mailing list.
-
-
-NOTE: issue = (bug report || patch || feature request)
-
-Type:
------
-bug
-    An error, flaw, mistake, failure, or fault in FFmpeg or libav* that
-    prevents it from behaving as intended.
-
-feature request
-    Request of support for encoding or decoding of a new codec, container
-    or variant.
-    Request of support for more, less or plain different output or behavior
-    where the current implementation cannot be considered wrong.
-
-patch
-    A patch as generated by diff which conforms to the patch submission and
-    development policy.
-
-
-Priority:
----------
-critical
-    Bugs and patches which deal with data loss and security issues.
-    No feature request can be critical.
-
-important
-    Bugs which make FFmpeg unusable for a significant number of users, and
-    patches fixing them.
-    Examples here might be completely broken MPEG-4 decoding or a build issue
-    on Linux.
-    While broken 4xm decoding or a broken OS/2 build would not be important,
-    the separation to normal is somewhat fuzzy.
-    For feature requests this priority would be used for things many people
-    want.
-
-normal
-
-
-minor
-    Bugs and patches about things like spelling errors, "mp2" instead of
-    "mp3" being shown and such.
-    Feature requests about things few people want or which do not make a big
-    difference.
-
-wish
-    Something that is desirable to have but that there is no urgency at
-    all to implement, e.g. something completely cosmetic like a website
-    restyle or a personalized doxy template or the FFmpeg logo.
-    This priority is not valid for bugs.
-
-
-Status:
--------
-new
-    initial state
-
-open
-    intermediate states
-
-closed
-    final state
-
-
-Type/Status/Substatus:
-----------
-*/new/new
-    Initial state of new bugs, patches and feature requests submitted by
-    users.
-
-*/open/open
-    Issues which have been briefly looked at and which did not look outright
-    invalid.
-    This implicates that no real more detailed state applies yet. Conversely,
-    the more detailed states below implicate that the issue has been briefly
-    looked at.
-
-*/closed/duplicate
-    Bugs, patches or feature requests which are duplicates.
-    Note that patches dealing with the same thing in a different way are not
-    duplicates.
-    Note, if you mark something as duplicate, do not forget setting the
-    superseder so bug reports are properly linked.
-
-*/closed/invalid
-    Bugs caused by user errors, random ineligible or otherwise nonsense stuff.
-
-*/closed/needs_more_info
-    Issues for which some information has been requested by the developers,
-    but which has not been provided by anyone within reasonable time.
-
-bug/open/reproduced
-    Bugs which have been reproduced.
-
-bug/open/analyzed
-    Bugs which have been analyzed and where it is understood what causes them
-    and which exact chain of events triggers them. This analysis should be
-    available as a message in the bug report.
-    Note, do not change the status to analyzed without also providing a clear
-    and understandable analysis.
-    This state implicates that the bug either has been reproduced or that
-    reproduction is not needed as the bug is already understood.
-
-bug/open/needs_more_info
-    Bug reports which are incomplete and or where more information is needed
-    from the submitter or another person who can provide it.
-    This state implicates that the bug has not been analyzed or reproduced.
-    Note, the idea behind needs_more_info is to offload work from the
-    developers to the users whenever possible.
-
-bug/closed/fixed
-    Bugs which have to the best of our knowledge been fixed.
-
-bug/closed/wont_fix
-    Bugs which we will not fix. Possible reasons include legality, high
-    complexity for the sake of supporting obscure corner cases, speed loss
-    for similarly esoteric purposes, et cetera.
-    This also means that we would reject a patch.
-    If we are just too lazy to fix a bug then the correct state is open
-    and unassigned. Closed means that the case is closed which is not
-    the case if we are just waiting for a patch.
-
-bug/closed/works_for_me
-    Bugs for which sufficient information was provided to reproduce but
-    reproduction failed - that is the code seems to work correctly to the
-    best of our knowledge.
-
-patch/open/approved
-    Patches which have been reviewed and approved by a developer.
-    Such patches can be applied anytime by any other developer after some
-    reasonable testing (compile + regression tests + does the patch do
-    what the author claimed).
-
-patch/open/needs_changes
-    Patches which have been reviewed and need changes to be accepted.
-
-patch/closed/applied
-    Patches which have been applied.
-
-patch/closed/rejected
-    Patches which have been rejected.
-
-feature_request/open/needs_more_info
-    Feature requests where it is not clear what exactly is wanted
-    (these also could be closed as invalid ...).
-
-feature_request/closed/implemented
-    Feature requests which have been implemented.
-
-feature_request/closed/wont_implement
-    Feature requests which will not be implemented. The reasons here could
-    be legal, philosophical or others.
-
-Note, please do not use type-status-substatus combinations other than the
-above without asking on ffmpeg-dev first!
-
-Note2, if you provide the requested info do not forget to remove the
-needs_more_info substate.
-
-Topic:
-------
-A topic is a tag you should add to your issue in order to make grouping them
-easier.
-
-avcodec
-    issues in libavcodec/*
-
-avformat
-    issues in libavformat/*
-
-avutil
-    issues in libavutil/*
-
-regression test
-    issues in tests/*
-
-ffmpeg
-    issues in or related to ffmpeg.c
-
-ffplay
-    issues in or related to ffplay.c
-
-ffserver
-    issues in or related to ffserver.c
-
-build system
-    issues in or related to configure/Makefile
-
-regression
-    bugs which were working in a past revision
-
-roundup
-    issues related to our issue tracker
diff --git a/doc/libavfilter.texi b/doc/libavfilter.texi
deleted file mode 100644
index 20ef445..0000000
--- a/doc/libavfilter.texi
+++ /dev/null
@@ -1,307 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle Libavfilter Documentation
- at titlepage
- at sp 7
- at center @titlefont{Libavfilter Documentation}
- at sp 3
- at end titlepage
-
-
- at chapter Introduction
-
-Libavfilter is the filtering API of FFmpeg. It is the substitute of the
-now deprecated 'vhooks' and started as a Google Summer of Code project.
-
-Integrating libavfilter into the main FFmpeg repository is a work in
-progress. If you wish to try the unfinished development code of
-libavfilter then check it out from the libavfilter repository into
-some directory of your choice by:
-
- at example
-   svn checkout svn://svn.ffmpeg.org/soc/libavfilter
- at end example
-
-And then read the README file in the top directory to learn how to
-integrate it into ffmpeg and ffplay.
-
-But note that there may still be serious bugs in the code and its API
-and ABI should not be considered stable yet!
-
- at chapter Tutorial
-
-In libavfilter, it is possible for filters to have multiple inputs and
-multiple outputs.
-To illustrate the sorts of things that are possible, we can
-use a complex filter graph. For example, the following one:
-
- at example
-input --> split --> fifo -----------------------> overlay --> output
-            |                                        ^
-            |                                        |
-            +------> fifo --> crop --> vflip --------+
- at end example
-
-splits the stream in two streams, sends one stream through the crop filter
-and the vflip filter before merging it back with the other stream by
-overlaying it on top. You can use the following command to achieve this:
-
- at example
-./ffmpeg -i in.avi -s 240x320 -vfilters "[in] split [T1], fifo, [T2] overlay= 0:240 [out]; [T1] fifo, crop=0:0:-1:240, vflip [T2]
- at end example
-
-where input_video.avi has a vertical resolution of 480 pixels. The
-result will be that in output the top half of the video is mirrored
-onto the bottom half.
-
-Video filters are loaded using the @var{-vfilters} option passed to
-ffmpeg or to ffplay. Filters in the same linear chain are separated by
-commas. In our example, @var{split, fifo, overlay} are in one linear
-chain, and @var{fifo, crop, vflip} are in another. The points where
-the linear chains join are labeled by names enclosed in square
-brackets. In our example, that is @var{[T1]} and @var{[T2]}. The magic
-labels @var{[in]} and @var{[out]} are the points where video is input
-and output.
-
-Some filters take in input a list of parameters: they are specified
-after the filter name and an equal sign, and are separated each other
-by a semicolon.
-
-There exist so-called @var{source filters} that do not have a video
-input, and we expect in the future some @var{sink filters} that will
-not have video output.
-
- at chapter graph2dot
-
-The @file{graph2dot} program included in the FFmpeg @file{tools}
-directory can be used to parse a filter graph description and issue a
-corresponding textual representation in the dot language.
-
-Invoke the command:
- at example
-graph2dot -h
- at end example
-
-to see how to use @file{graph2dot}.
-
-You can then pass the dot description to the @file{dot} program (from
-the graphviz suite of programs) and obtain a graphical representation
-of the filter graph.
-
-For example the sequence of commands:
- at example
-echo @var{GRAPH_DESCRIPTION} | \
-tools/graph2dot -o graph.tmp && \
-dot -Tpng graph.tmp -o graph.png && \
-display graph.png
- at end example
-
-can be used to create and display an image representing the graph
-described by the @var{GRAPH_DESCRIPTION} string.
-
- at chapter Available video filters
-
-When you configure your FFmpeg build, you can disable any of the
-existing video filters.
-The configure output will show the video filters included in your
-build.
-
-Below is a description of the currently available video filters.
-
- at section crop
-
-Crop the input video to @var{x}:@var{y}:@var{width}:@var{height}.
-
- at example
-./ffmpeg -i in.avi -vfilters "crop=0:0:0:240" out.avi
- at end example
-
- at var{x} and @var{y} specify the position of the top-left corner of the
-output (non-cropped) area.
-
-The default value of @var{x} and @var{y} is 0.
-
-The @var{width} and @var{height} parameters specify the width and height
-of the output (non-cropped) area.
-
-A value of 0 is interpreted as the maximum possible size contained in
-the area delimited by the top-left corner at position x:y.
-
-For example the parameters:
-
- at example
-"crop=100:100:0:0"
- at end example
-
-will delimit the rectangle with the top-left corner placed at position
-100:100 and the right-bottom corner corresponding to the right-bottom
-corner of the input image.
-
-The default value of @var{width} and @var{height} is 0.
-
- at section format
-
-Convert the input video to one of the specified pixel formats.
-Libavfilter will try to pick one that is supported for the input to
-the next filter.
-
-The filter accepts a list of pixel format names, separated by ``:'',
-for example ``yuv420p:monow:rgb24''.
-
-The following command:
-
- at example
-./ffmpeg -i in.avi -vfilters "format=yuv420p" out.avi
- at end example
-
-will convert the input video to the format ``yuv420p''.
-
- at section noformat
-
-Force libavfilter not to use any of the specified pixel formats for the
-input to the next filter.
-
-The filter accepts a list of pixel format names, separated by ``:'',
-for example ``yuv420p:monow:rgb24''.
-
-The following command:
-
- at example
-./ffmpeg -i in.avi -vfilters "noformat=yuv420p, vflip" out.avi
- at end example
-
-will make libavfilter use a format different from ``yuv420p'' for the
-input to the vflip filter.
-
- at section null
-
-Pass the source unchanged to the output.
-
- at section scale
-
-Scale the input video to @var{width}:@var{height} and/or convert the image format.
-
-For example the command:
-
- at example
-./ffmpeg -i in.avi -vfilters "scale=200:100" out.avi
- at end example
-
-will scale the input video to a size of 200x100.
-
-If the input image format is different from the format requested by
-the next filter, the scale filter will convert the input to the
-requested format.
-
-If the value for @var{width} or @var{height} is 0, the respective input
-size is used for the output.
-
-If the value for @var{width} or @var{height} is -1, the scale filter will
-use, for the respective output size, a value that maintains the aspect
-ratio of the input image.
-
-The default value of @var{width} and @var{height} is 0.
-
- at section slicify
-
-Pass the images of input video on to next video filter as multiple
-slices.
-
- at example
-./ffmpeg -i in.avi -vfilters "slicify=32" out.avi
- at end example
-
-The filter accepts the slice height as parameter. If the parameter is
-not specified it will use the default value of 16.
-
-Adding this in the beginning of filter chains should make filtering
-faster due to better use of the memory cache.
-
- at section unsharp
-
-Sharpen or blur the input video. It accepts the following parameters:
-
- at multitable @columnfractions .2 .5 .1 .1 .1
- at headitem Name @tab Description @tab Min @tab Max @tab Default
- at item @var{luma_msize_x}
- at tab Luma matrix horizontal size
- at tab 3
- at tab 13
- at tab 5
- at item @var{luma_msize_y}
- at tab Luma matrix vertical size
- at tab 3
- at tab 13
- at tab 5
- at item @var{luma_amount}
- at tab Luma effect strength
- at tab -2.0
- at tab 5.0
- at tab 1.0
- at item @var{chroma_msize_x}
- at tab Chroma matrix horizontal size
- at tab 3
- at tab 13
- at tab 0
- at item @var{chroma_msize_y}
- at tab Chroma matrix vertical size
- at tab 3
- at tab 13
- at tab 0
- at item @var{chroma_amount}
- at tab Chroma effect strength
- at tab -2.0
- at tab 5.0
- at tab 0.0
- at end multitable
-
-Negative values for the amount will blur the input video, while positive
-values will sharpen. All parameters are optional and default to the
-equivalent of the string '5:5:1.0:0:0:0.0'.
-
- at example
-# Strong luma sharpen effect parameters
-unsharp=7:7:2.5
-
-# Strong blur of both luma and chroma parameters
-unsharp=7:7:-2:7:7:-2
-
-# Use the default values with @command{ffmpeg}
-./ffmpeg -i in.avi -vfilters "unsharp" out.mp4
- at end example
-
- at section vflip
-
-Flip the input video vertically.
-
- at example
-./ffmpeg -i in.avi -vfilters "vflip" out.avi
- at end example
-
- at chapter Available video sources
-
-Below is a description of the currently available video sources.
-
- at section nullsrc
-
-Null video source, never return images. It is mainly useful as a
-template and to be employed in analysis / debugging tools.
-
-It accepts as optional parameter a string of the form
- at var{width}:@var{height}, where @var{width} and @var{height} specify the size of
-the configured source.
-
-The default values of @var{width} and @var{height} are respectively 352
-and 288 (corresponding to the CIF size format).
-
- at chapter Available video sinks
-
-Below is a description of the currently available video sinks.
-
- at section nullsink
-
-Null video sink, do absolutely nothing with the input video. It is
-mainly useful as a template and to be employed in analysis / debugging
-tools.
-
- at bye
diff --git a/doc/optimization.txt b/doc/optimization.txt
deleted file mode 100644
index 5469adc..0000000
--- a/doc/optimization.txt
+++ /dev/null
@@ -1,235 +0,0 @@
-optimization Tips (for libavcodec):
-===================================
-
-What to optimize:
------------------
-If you plan to do non-x86 architecture specific optimizations (SIMD normally),
-then take a look in the x86/ directory, as most important functions are
-already optimized for MMX.
-
-If you want to do x86 optimizations then you can either try to finetune the
-stuff in the x86 directory or find some other functions in the C source to
-optimize, but there aren't many left.
-
-
-Understanding these overoptimized functions:
---------------------------------------------
-As many functions tend to be a bit difficult to understand because
-of optimizations, it can be hard to optimize them further, or write
-architecture-specific versions. It is recommended to look at older
-revisions of the interesting files (for a web frontend try ViewVC at
-http://svn.ffmpeg.org/ffmpeg/trunk/).
-Alternatively, look into the other architecture-specific versions in
-the x86/, ppc/, alpha/ subdirectories. Even if you don't exactly
-comprehend the instructions, it could help understanding the functions
-and how they can be optimized.
-
-NOTE: If you still don't understand some function, ask at our mailing list!!!
-(http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel)
-
-
-When is an optimization justified?
-----------------------------------
-Normally, clean and simple optimizations for widely used codecs are
-justified even if they only achieve an overall speedup of 0.1%. These
-speedups accumulate and can make a big difference after awhile. Also, if
-none of the following factors get worse due to an optimization -- speed,
-binary code size, source size, source readability -- and at least one
-factor improves, then an optimization is always a good idea even if the
-overall gain is less than 0.1%. For obscure codecs that are not often
-used, the goal is more toward keeping the code clean, small, and
-readable instead of making it 1% faster.
-
-
-WTF is that function good for ....:
------------------------------------
-The primary purpose of this list is to avoid wasting time optimizing functions
-which are rarely used.
-
-put(_no_rnd)_pixels{,_x2,_y2,_xy2}
-    Used in motion compensation (en/decoding).
-
-avg_pixels{,_x2,_y2,_xy2}
-    Used in motion compensation of B-frames.
-    These are less important than the put*pixels functions.
-
-avg_no_rnd_pixels*
-    unused
-
-pix_abs16x16{,_x2,_y2,_xy2}
-    Used in motion estimation (encoding) with SAD.
-
-pix_abs8x8{,_x2,_y2,_xy2}
-    Used in motion estimation (encoding) with SAD of MPEG-4 4MV only.
-    These are less important than the pix_abs16x16* functions.
-
-put_mspel8_mc* / wmv2_mspel8*
-    Used only in WMV2.
-    it is not recommended that you waste your time with these, as WMV2
-    is an ugly and relatively useless codec.
-
-mpeg4_qpel* / *qpel_mc*
-    Used in MPEG-4 qpel motion compensation (encoding & decoding).
-    The qpel8 functions are used only for 4mv,
-    the avg_* functions are used only for B-frames.
-    Optimizing them should have a significant impact on qpel
-    encoding & decoding.
-
-qpel{8,16}_mc??_old_c / *pixels{8,16}_l4
-    Just used to work around a bug in an old libavcodec encoder version.
-    Don't optimize them.
-
-tpel_mc_func {put,avg}_tpel_pixels_tab
-    Used only for SVQ3, so only optimize them if you need fast SVQ3 decoding.
-
-add_bytes/diff_bytes
-    For huffyuv only, optimize if you want a faster ffhuffyuv codec.
-
-get_pixels / diff_pixels
-    Used for encoding, easy.
-
-clear_blocks
-    easiest to optimize
-
-gmc
-    Used for MPEG-4 gmc.
-    Optimizing this should have a significant effect on the gmc decoding
-    speed.
-
-gmc1
-    Used for chroma blocks in MPEG-4 gmc with 1 warp point
-    (there are 4 luma & 2 chroma blocks per macroblock, so
-    only 1/3 of the gmc blocks use this, the other 2/3
-    use the normal put_pixel* code, but only if there is
-    just 1 warp point).
-    Note: DivX5 gmc always uses just 1 warp point.
-
-pix_sum
-    Used for encoding.
-
-hadamard8_diff / sse / sad == pix_norm1 / dct_sad / quant_psnr / rd / bit
-    Specific compare functions used in encoding, it depends upon the
-    command line switches which of these are used.
-    Don't waste your time with dct_sad & quant_psnr, they aren't
-    really useful.
-
-put_pixels_clamped / add_pixels_clamped
-    Used for en/decoding in the IDCT, easy.
-    Note, some optimized IDCTs have the add/put clamped code included and
-    then put_pixels_clamped / add_pixels_clamped will be unused.
-
-idct/fdct
-    idct (encoding & decoding)
-    fdct (encoding)
-    difficult to optimize
-
-dct_quantize_trellis
-    Used for encoding with trellis quantization.
-    difficult to optimize
-
-dct_quantize
-    Used for encoding.
-
-dct_unquantize_mpeg1
-    Used in MPEG-1 en/decoding.
-
-dct_unquantize_mpeg2
-    Used in MPEG-2 en/decoding.
-
-dct_unquantize_h263
-    Used in MPEG-4/H.263 en/decoding.
-
-FIXME remaining functions?
-BTW, most of these functions are in dsputil.c/.h, some are in mpegvideo.c/.h.
-
-
-
-Alignment:
-Some instructions on some architectures have strict alignment restrictions,
-for example most SSE/SSE2 instructions on x86.
-The minimum guaranteed alignment is written in the .h files, for example:
-    void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size);
-
-
-General Tips:
--------------
-Use asm loops like:
-__asm__(
-    "1: ....
-    ...
-    "jump_instruciton ....
-Do not use C loops:
-do{
-    __asm__(
-        ...
-}while()
-
-Use __asm__() instead of intrinsics. The latter requires a good optimizing compiler
-which gcc is not.
-
-
-Links:
-======
-http://www.aggregate.org/MAGIC/
-
-x86-specific:
--------------
-http://developer.intel.com/design/pentium4/manuals/248966.htm
-
-The IA-32 Intel Architecture Software Developer's Manual, Volume 2:
-Instruction Set Reference
-http://developer.intel.com/design/pentium4/manuals/245471.htm
-
-http://www.agner.org/assem/
-
-AMD Athlon Processor x86 Code Optimization Guide:
-http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/22007.pdf
-
-
-ARM-specific:
--------------
-ARM Architecture Reference Manual (up to ARMv5TE):
-http://www.arm.com/community/university/eulaarmarm.html
-
-Procedure Call Standard for the ARM Architecture:
-http://www.arm.com/pdfs/aapcs.pdf
-
-Optimization guide for ARM9E (used in Nokia 770 Internet Tablet):
-http://infocenter.arm.com/help/topic/com.arm.doc.ddi0240b/DDI0240A.pdf
-Optimization guide for ARM11 (used in Nokia N800 Internet Tablet):
-http://infocenter.arm.com/help/topic/com.arm.doc.ddi0211j/DDI0211J_arm1136_r1p5_trm.pdf
-Optimization guide for Intel XScale (used in Sharp Zaurus PDA):
-http://download.intel.com/design/intelxscale/27347302.pdf
-Intel Wireless MMX2 Coprocessor: Programmers Reference Manual
-http://download.intel.com/design/intelxscale/31451001.pdf
-
-PowerPC-specific:
------------------
-PowerPC32/AltiVec PIM:
-www.freescale.com/files/32bit/doc/ref_manual/ALTIVECPEM.pdf
-
-PowerPC32/AltiVec PEM:
-www.freescale.com/files/32bit/doc/ref_manual/ALTIVECPIM.pdf
-
-CELL/SPU:
-http://www-01.ibm.com/chips/techlib/techlib.nsf/techdocs/30B3520C93F437AB87257060006FFE5E/$file/Language_Extensions_for_CBEA_2.4.pdf
-http://www-01.ibm.com/chips/techlib/techlib.nsf/techdocs/9F820A5FFA3ECE8C8725716A0062585F/$file/CBE_Handbook_v1.1_24APR2007_pub.pdf
-
-SPARC-specific:
----------------
-SPARC Joint Programming Specification (JPS1): Commonality
-http://www.fujitsu.com/downloads/PRMPWR/JPS1-R1.0.4-Common-pub.pdf
-
-UltraSPARC III Processor User's Manual (contains instruction timings)
-http://www.sun.com/processors/manuals/USIIIv2.pdf
-
-VIS Whitepaper (contains optimization guidelines)
-http://www.sun.com/processors/vis/download/vis/vis_whitepaper.pdf
-
-GCC asm links:
---------------
-official doc but quite ugly
-http://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html
-
-a bit old (note "+" is valid for input-output, even though the next disagrees)
-http://www.cs.virginia.edu/~clc5q/gcc-inline-asm.pdf
diff --git a/doc/rate_distortion.txt b/doc/rate_distortion.txt
deleted file mode 100644
index a7d2c87..0000000
--- a/doc/rate_distortion.txt
+++ /dev/null
@@ -1,61 +0,0 @@
-A Quick Description Of Rate Distortion Theory.
-
-We want to encode a video, picture or piece of music optimally. What does
-"optimally" really mean? It means that we want to get the best quality at a
-given filesize OR we want to get the smallest filesize at a given quality
-(in practice, these 2 goals are usually the same).
-
-Solving this directly is not practical; trying all byte sequences 1
-megabyte in length and selecting the "best looking" sequence will yield
-256^1000000 cases to try.
-
-But first, a word about quality, which is also called distortion.
-Distortion can be quantified by almost any quality measurement one chooses.
-Commonly, the sum of squared differences is used but more complex methods
-that consider psychovisual effects can be used as well. It makes no
-difference in this discussion.
-
-
-First step: that rate distortion factor called lambda...
-Let's consider the problem of minimizing:
-
-  distortion + lambda*rate
-
-rate is the filesize
-distortion is the quality
-lambda is a fixed value choosen as a tradeoff between quality and filesize
-Is this equivalent to finding the best quality for a given max
-filesize? The answer is yes. For each filesize limit there is some lambda
-factor for which minimizing above will get you the best quality (using your
-chosen quality measurement) at the desired (or lower) filesize.
-
-
-Second step: splitting the problem.
-Directly splitting the problem of finding the best quality at a given
-filesize is hard because we do not know how many bits from the total
-filesize should be allocated to each of the subproblems. But the formula
-from above:
-
-  distortion + lambda*rate
-
-can be trivially split. Consider:
-
-  (distortion0 + distortion1) + lambda*(rate0 + rate1)
-
-This creates a problem made of 2 independent subproblems. The subproblems
-might be 2 16x16 macroblocks in a frame of 32x16 size. To minimize:
-
-  (distortion0 + distortion1) + lambda*(rate0 + rate1)
-
-we just have to minimize:
-
-  distortion0 + lambda*rate0
-
-and
-
-  distortion1 + lambda*rate1
-
-I.e, the 2 problems can be solved independently.
-
-Author: Michael Niedermayer
-Copyright: LGPL
diff --git a/doc/snow.txt b/doc/snow.txt
deleted file mode 100644
index f991339..0000000
--- a/doc/snow.txt
+++ /dev/null
@@ -1,630 +0,0 @@
-=============================================
-Snow Video Codec Specification Draft 20080110
-=============================================
-
-Introduction:
-=============
-This specification describes the Snow bitstream syntax and semantics as
-well as the formal Snow decoding process.
-
-The decoding process is described precisely and any compliant decoder
-MUST produce the exact same output for a spec-conformant Snow stream.
-For encoding, though, any process which generates a stream compliant to
-the syntactical and semantic requirements and which is decodable by
-the process described in this spec shall be considered a conformant
-Snow encoder.
-
-Definitions:
-============
-
-MUST    the specific part must be done to conform to this standard
-SHOULD  it is recommended to be done that way, but not strictly required
-
-ilog2(x) is the rounded down logarithm of x with basis 2
-ilog2(0) = 0
-
-Type definitions:
-=================
-
-b   1-bit range coded
-u   unsigned scalar value range coded
-s   signed scalar value range coded
-
-
-Bitstream syntax:
-=================
-
-frame:
-    header
-    prediction
-    residual
-
-header:
-    keyframe                            b   MID_STATE
-    if(keyframe || always_reset)
-        reset_contexts
-    if(keyframe){
-        version                         u   header_state
-        always_reset                    b   header_state
-        temporal_decomposition_type     u   header_state
-        temporal_decomposition_count    u   header_state
-        spatial_decomposition_count     u   header_state
-        colorspace_type                 u   header_state
-        chroma_h_shift                  u   header_state
-        chroma_v_shift                  u   header_state
-        spatial_scalability             b   header_state
-        max_ref_frames-1                u   header_state
-        qlogs
-    }
-    if(!keyframe){
-        update_mc                       b   header_state
-        if(update_mc){
-            for(plane=0; plane<2; plane++){
-                diag_mc                 b   header_state
-                htaps/2-1               u   header_state
-                for(i= p->htaps/2; i; i--)
-                    |hcoeff[i]|         u   header_state
-            }
-        }
-        update_qlogs                    b   header_state
-        if(update_qlogs){
-            spatial_decomposition_count u   header_state
-            qlogs
-        }
-    }
-
-    spatial_decomposition_type          s   header_state
-    qlog                                s   header_state
-    mv_scale                            s   header_state
-    qbias                               s   header_state
-    block_max_depth                     s   header_state
-
-qlogs:
-    for(plane=0; plane<2; plane++){
-        quant_table[plane][0][0]        s   header_state
-        for(level=0; level < spatial_decomposition_count; level++){
-            quant_table[plane][level][1]s   header_state
-            quant_table[plane][level][3]s   header_state
-        }
-    }
-
-reset_contexts
-    *_state[*]= MID_STATE
-
-prediction:
-    for(y=0; y<block_count_vertical; y++)
-        for(x=0; x<block_count_horizontal; x++)
-            block(0)
-
-block(level):
-    mvx_diff=mvy_diff=y_diff=cb_diff=cr_diff=0
-    if(keyframe){
-        intra=1
-    }else{
-        if(level!=max_block_depth){
-            s_context= 2*left->level + 2*top->level + topleft->level + topright->level
-            leaf                        b   block_state[4 + s_context]
-        }
-        if(level==max_block_depth || leaf){
-            intra                       b   block_state[1 + left->intra + top->intra]
-            if(intra){
-                y_diff                  s   block_state[32]
-                cb_diff                 s   block_state[64]
-                cr_diff                 s   block_state[96]
-            }else{
-                ref_context= ilog2(2*left->ref) + ilog2(2*top->ref)
-                if(ref_frames > 1)
-                    ref                 u   block_state[128 + 1024 + 32*ref_context]
-                mx_context= ilog2(2*abs(left->mx - top->mx))
-                my_context= ilog2(2*abs(left->my - top->my))
-                mvx_diff                s   block_state[128 + 32*(mx_context + 16*!!ref)]
-                mvy_diff                s   block_state[128 + 32*(my_context + 16*!!ref)]
-            }
-        }else{
-            block(level+1)
-            block(level+1)
-            block(level+1)
-            block(level+1)
-        }
-    }
-
-
-residual:
-    residual2(luma)
-    residual2(chroma_cr)
-    residual2(chroma_cb)
-
-residual2:
-    for(level=0; level<spatial_decomposition_count; level++){
-        if(level==0)
-            subband(LL, 0)
-        subband(HL, level)
-        subband(LH, level)
-        subband(HH, level)
-    }
-
-subband:
-    FIXME
-
-
-
-Tag description:
-----------------
-
-version
-    0
-    this MUST NOT change within a bitstream
-
-always_reset
-    if 1 then the range coder contexts will be reset after each frame
-
-temporal_decomposition_type
-    0
-
-temporal_decomposition_count
-    0
-
-spatial_decomposition_count
-    FIXME
-
-colorspace_type
-    0
-    this MUST NOT change within a bitstream
-
-chroma_h_shift
-    log2(luma.width / chroma.width)
-    this MUST NOT change within a bitstream
-
-chroma_v_shift
-    log2(luma.height / chroma.height)
-    this MUST NOT change within a bitstream
-
-spatial_scalability
-    0
-
-max_ref_frames
-    maximum number of reference frames
-    this MUST NOT change within a bitstream
-
-update_mc
-    indicates that motion compensation filter parameters are stored in the
-    header
-
-diag_mc
-    flag to enable faster diagonal interpolation
-    this SHOULD be 1 unless it turns out to be covered by a valid patent
-
-htaps
-    number of half pel interpolation filter taps, MUST be even, >0 and <10
-
-hcoeff
-    half pel interpolation filter coefficients, hcoeff[0] are the 2 middle
-    coefficients [1] are the next outer ones and so on, resulting in a filter
-    like: ...eff[2], hcoeff[1], hcoeff[0], hcoeff[0], hcoeff[1], hcoeff[2] ...
-    the sign of the coefficients is not explicitly stored but alternates
-    after each coeff and coeff[0] is positive, so ...,+,-,+,-,+,+,-,+,-,+,...
-    hcoeff[0] is not explicitly stored but found by subtracting the sum
-    of all stored coefficients with signs from 32
-    hcoeff[0]= 32 - hcoeff[1] - hcoeff[2] - ...
-    a good choice for hcoeff and htaps is
-    htaps= 6
-    hcoeff={40,-10,2}
-    an alternative which requires more computations at both encoder and
-    decoder side and may or may not be better is
-    htaps= 8
-    hcoeff={42,-14,6,-2}
-
-
-ref_frames
-    minimum of the number of available reference frames and max_ref_frames
-    for example the first frame after a key frame always has ref_frames=1
-
-spatial_decomposition_type
-    wavelet type
-    0 is a 9/7 symmetric compact integer wavelet
-    1 is a 5/3 symmetric compact integer wavelet
-    others are reserved
-    stored as delta from last, last is reset to 0 if always_reset || keyframe
-
-qlog
-    quality (logarthmic quantizer scale)
-    stored as delta from last, last is reset to 0 if always_reset || keyframe
-
-mv_scale
-    stored as delta from last, last is reset to 0 if always_reset || keyframe
-    FIXME check that everything works fine if this changes between frames
-
-qbias
-    dequantization bias
-    stored as delta from last, last is reset to 0 if always_reset || keyframe
-
-block_max_depth
-    maximum depth of the block tree
-    stored as delta from last, last is reset to 0 if always_reset || keyframe
-
-quant_table
-    quantiztation table
-
-
-Highlevel bitstream structure:
-=============================
- --------------------------------------------
-|                   Header                   |
- --------------------------------------------
-|    ------------------------------------    |
-|   |               Block0               |   |
-|   |             split?                 |   |
-|   |     yes              no            |   |
-|   |  .........         intra?          |   |
-|   | : Block01 :    yes         no      |   |
-|   | : Block02 :  .......   ..........  |   |
-|   | : Block03 : :  y DC : : ref index: |   |
-|   | : Block04 : : cb DC : : motion x : |   |
-|   |  .........  : cr DC : : motion y : |   |
-|   |              .......   ..........  |   |
-|    ------------------------------------    |
-|    ------------------------------------    |
-|   |               Block1               |   |
-|                    ...                     |
- --------------------------------------------
-| ------------   ------------   ------------ |
-|| Y subbands | | Cb subbands| | Cr subbands||
-||  ---  ---  | |  ---  ---  | |  ---  ---  ||
-|| |LL0||HL0| | | |LL0||HL0| | | |LL0||HL0| ||
-||  ---  ---  | |  ---  ---  | |  ---  ---  ||
-||  ---  ---  | |  ---  ---  | |  ---  ---  ||
-|| |LH0||HH0| | | |LH0||HH0| | | |LH0||HH0| ||
-||  ---  ---  | |  ---  ---  | |  ---  ---  ||
-||  ---  ---  | |  ---  ---  | |  ---  ---  ||
-|| |HL1||LH1| | | |HL1||LH1| | | |HL1||LH1| ||
-||  ---  ---  | |  ---  ---  | |  ---  ---  ||
-||  ---  ---  | |  ---  ---  | |  ---  ---  ||
-|| |HH1||HL2| | | |HH1||HL2| | | |HH1||HL2| ||
-||    ...     | |    ...     | |    ...     ||
-| ------------   ------------   ------------ |
- --------------------------------------------
-
-Decoding process:
-=================
-
-                                         ------------
-                                        |            |
-                                        |  Subbands  |
-                   ------------         |            |
-                  |            |         ------------
-                  |  Intra DC  |               |
-                  |            |    LL0 subband prediction
-                   ------------                |
-                                \        Dequantizaton
- -------------------             \             |
-|  Reference frames |             \           IDWT
-| -------   ------- |    Motion    \           |
-||Frame 0| |Frame 1|| Compensation  .   OBMC   v      -------
-| -------   ------- | --------------. \------> + --->|Frame n|-->output
-| -------   ------- |                                 -------
-||Frame 2| |Frame 3||<----------------------------------/
-|        ...        |
- -------------------
-
-
-Range Coder:
-============
-
-Binary Range Coder:
--------------------
-The implemented range coder is an adapted version based upon "Range encoding:
-an algorithm for removing redundancy from a digitised message." by G. N. N.
-Martin.
-The symbols encoded by the Snow range coder are bits (0|1). The
-associated probabilities are not fix but change depending on the symbol mix
-seen so far.
-
-
-bit seen | new state
----------+-----------------------------------------------
-    0    | 256 - state_transition_table[256 - old_state];
-    1    |       state_transition_table[      old_state];
-
-state_transition_table = {
-  0,   0,   0,   0,   0,   0,   0,   0,  20,  21,  22,  23,  24,  25,  26,  27,
- 28,  29,  30,  31,  32,  33,  34,  35,  36,  37,  37,  38,  39,  40,  41,  42,
- 43,  44,  45,  46,  47,  48,  49,  50,  51,  52,  53,  54,  55,  56,  56,  57,
- 58,  59,  60,  61,  62,  63,  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,
- 74,  75,  75,  76,  77,  78,  79,  80,  81,  82,  83,  84,  85,  86,  87,  88,
- 89,  90,  91,  92,  93,  94,  94,  95,  96,  97,  98,  99, 100, 101, 102, 103,
-104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 114, 115, 116, 117, 118,
-119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 133,
-134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
-150, 151, 152, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
-165, 166, 167, 168, 169, 170, 171, 171, 172, 173, 174, 175, 176, 177, 178, 179,
-180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 190, 191, 192, 194, 194,
-195, 196, 197, 198, 199, 200, 201, 202, 202, 204, 205, 206, 207, 208, 209, 209,
-210, 211, 212, 213, 215, 215, 216, 217, 218, 219, 220, 220, 222, 223, 224, 225,
-226, 227, 227, 229, 229, 230, 231, 232, 234, 234, 235, 236, 237, 238, 239, 240,
-241, 242, 243, 244, 245, 246, 247, 248, 248,   0,   0,   0,   0,   0,   0,   0};
-
-FIXME
-
-
-Range Coding of integers:
--------------------------
-FIXME
-
-
-Neighboring Blocks:
-===================
-left and top are set to the respective blocks unless they are outside of
-the image in which case they are set to the Null block
-
-top-left is set to the top left block unless it is outside of the image in
-which case it is set to the left block
-
-if this block has no larger parent block or it is at the left side of its
-parent block and the top right block is not outside of the image then the
-top right block is used for top-right else the top-left block is used
-
-Null block
-y,cb,cr are 128
-level, ref, mx and my are 0
-
-
-Motion Vector Prediction:
-=========================
-1. the motion vectors of all the neighboring blocks are scaled to
-compensate for the difference of reference frames
-
-scaled_mv= (mv * (256 * (current_reference+1) / (mv.reference+1)) + 128)>>8
-
-2. the median of the scaled left, top and top-right vectors is used as
-motion vector prediction
-
-3. the used motion vector is the sum of the predictor and
-   (mvx_diff, mvy_diff)*mv_scale
-
-
-Intra DC Predicton:
-======================
-the luma and chroma values of the left block are used as predictors
-
-the used luma and chroma is the sum of the predictor and y_diff, cb_diff, cr_diff
-to reverse this in the decoder apply the following:
-block[y][x].dc[0] = block[y][x-1].dc[0] +  y_diff;
-block[y][x].dc[1] = block[y][x-1].dc[1] + cb_diff;
-block[y][x].dc[2] = block[y][x-1].dc[2] + cr_diff;
-block[*][-1].dc[*]= 128;
-
-
-Motion Compensation:
-====================
-
-Halfpel interpolation:
-----------------------
-halfpel interpolation is done by convolution with the halfpel filter stored
-in the header:
-
-horizontal halfpel samples are found by
-H1[y][x] =    hcoeff[0]*(F[y][x  ] + F[y][x+1])
-            + hcoeff[1]*(F[y][x-1] + F[y][x+2])
-            + hcoeff[2]*(F[y][x-2] + F[y][x+3])
-            + ...
-h1[y][x] = (H1[y][x] + 32)>>6;
-
-vertical halfpel samples are found by
-H2[y][x] =    hcoeff[0]*(F[y  ][x] + F[y+1][x])
-            + hcoeff[1]*(F[y-1][x] + F[y+2][x])
-            + ...
-h2[y][x] = (H2[y][x] + 32)>>6;
-
-vertical+horizontal halfpel samples are found by
-H3[y][x] =    hcoeff[0]*(H2[y][x  ] + H2[y][x+1])
-            + hcoeff[1]*(H2[y][x-1] + H2[y][x+2])
-            + ...
-H3[y][x] =    hcoeff[0]*(H1[y  ][x] + H1[y+1][x])
-            + hcoeff[1]*(H1[y+1][x] + H1[y+2][x])
-            + ...
-h3[y][x] = (H3[y][x] + 2048)>>12;
-
-
-                   F   H1  F
-                   |   |   |
-                   |   |   |
-                   |   |   |
-                   F   H1  F
-                   |   |   |
-                   |   |   |
-                   |   |   |
-   F-------F-------F-> H1<-F-------F-------F
-                   v   v   v
-                  H2   H3  H2
-                   ^   ^   ^
-   F-------F-------F-> H1<-F-------F-------F
-                   |   |   |
-                   |   |   |
-                   |   |   |
-                   F   H1  F
-                   |   |   |
-                   |   |   |
-                   |   |   |
-                   F   H1  F
-
-
-unavailable fullpel samples (outside the picture for example) shall be equal
-to the closest available fullpel sample
-
-
-Smaller pel interpolation:
---------------------------
-if diag_mc is set then points which lie on a line between 2 vertically,
-horiziontally or diagonally adjacent halfpel points shall be interpolated
-linearls with rounding to nearest and halfway values rounded up.
-points which lie on 2 diagonals at the same time should only use the one
-diagonal not containing the fullpel point
-
-
-
-           F-->O---q---O<--h1->O---q---O<--F
-           v \           / v \           / v
-           O   O       O   O   O       O   O
-           |         /     |     \         |
-           q       q       q       q       q
-           |     /         |         \     |
-           O   O       O   O   O       O   O
-           ^ /           \ ^ /           \ ^
-          h2-->O---q---O<--h3->O---q---O<--h2
-           v \           / v \           / v
-           O   O       O   O   O       O   O
-           |     \         |         /     |
-           q       q       q       q       q
-           |         \     |     /         |
-           O   O       O   O   O       O   O
-           ^ /           \ ^ /           \ ^
-           F-->O---q---O<--h1->O---q---O<--F
-
-
-
-the remaining points shall be bilinearly interpolated from the
-up to 4 surrounding halfpel and fullpel points, again rounding should be to
-nearest and halfway values rounded up
-
-compliant Snow decoders MUST support 1-1/8 pel luma and 1/2-1/16 pel chroma
-interpolation at least
-
-
-Overlapped block motion compensation:
--------------------------------------
-FIXME
-
-LL band prediction:
-===================
-Each sample in the LL0 subband is predicted by the median of the left, top and
-left+top-topleft samples, samples outside the subband shall be considered to
-be 0. To reverse this prediction in the decoder apply the following.
-for(y=0; y<height; y++){
-    for(x=0; x<width; x++){
-        sample[y][x] += median(sample[y-1][x],
-                               sample[y][x-1],
-                               sample[y-1][x]+sample[y][x-1]-sample[y-1][x-1]);
-    }
-}
-sample[-1][*]=sample[*][-1]= 0;
-width,height here are the width and height of the LL0 subband not of the final
-video
-
-
-Dequantizaton:
-==============
-FIXME
-
-Wavelet Transform:
-==================
-
-Snow supports 2 wavelet transforms, the symmetric biorthogonal 5/3 integer
-transform and a integer approximation of the symmetric biorthogonal 9/7
-daubechies wavelet.
-
-2D IDWT (inverse discrete wavelet transform)
---------------------------------------------
-The 2D IDWT applies a 2D filter recursively, each time combining the
-4 lowest frequency subbands into a single subband until only 1 subband
-remains.
-The 2D filter is done by first applying a 1D filter in the vertical direction
-and then applying it in the horizontal one.
- ---------------    ---------------    ---------------    ---------------
-|LL0|HL0|       |  |   |   |       |  |       |       |  |       |       |
-|---+---|  HL1  |  | L0|H0 |  HL1  |  |  LL1  |  HL1  |  |       |       |
-|LH0|HH0|       |  |   |   |       |  |       |       |  |       |       |
-|-------+-------|->|-------+-------|->|-------+-------|->|   L1  |  H1   |->...
-|       |       |  |       |       |  |       |       |  |       |       |
-|  LH1  |  HH1  |  |  LH1  |  HH1  |  |  LH1  |  HH1  |  |       |       |
-|       |       |  |       |       |  |       |       |  |       |       |
- ---------------    ---------------    ---------------    ---------------
-
-
-1D Filter:
-----------
-1. interleave the samples of the low and high frequency subbands like
-s={L0, H0, L1, H1, L2, H2, L3, H3, ... }
-note, this can end with a L or a H, the number of elements shall be w
-s[-1] shall be considered equivalent to s[1  ]
-s[w ] shall be considered equivalent to s[w-2]
-
-2. perform the lifting steps in order as described below
-
-5/3 Integer filter:
-1. s[i] -= (s[i-1] + s[i+1] + 2)>>2; for all even i < w
-2. s[i] += (s[i-1] + s[i+1]    )>>1; for all odd  i < w
-
-\ | /|\ | /|\ | /|\ | /|\
- \|/ | \|/ | \|/ | \|/ |
-  +  |  +  |  +  |  +  |   -1/4
- /|\ | /|\ | /|\ | /|\ |
-/ | \|/ | \|/ | \|/ | \|/
-  |  +  |  +  |  +  |  +   +1/2
-
-
-Snow's 9/7 Integer filter:
-1. s[i] -= (3*(s[i-1] + s[i+1])         + 4)>>3; for all even i < w
-2. s[i] -=     s[i-1] + s[i+1]                 ; for all odd  i < w
-3. s[i] += (   s[i-1] + s[i+1] + 4*s[i] + 8)>>4; for all even i < w
-4. s[i] += (3*(s[i-1] + s[i+1])            )>>1; for all odd  i < w
-
-\ | /|\ | /|\ | /|\ | /|\
- \|/ | \|/ | \|/ | \|/ |
-  +  |  +  |  +  |  +  |   -3/8
- /|\ | /|\ | /|\ | /|\ |
-/ | \|/ | \|/ | \|/ | \|/
- (|  + (|  + (|  + (|  +   -1
-\ + /|\ + /|\ + /|\ + /|\  +1/4
- \|/ | \|/ | \|/ | \|/ |
-  +  |  +  |  +  |  +  |   +1/16
- /|\ | /|\ | /|\ | /|\ |
-/ | \|/ | \|/ | \|/ | \|/
-  |  +  |  +  |  +  |  +   +3/2
-
-optimization tips:
-following are exactly identical
-(3a)>>1 == a + (a>>1)
-(a + 4b + 8)>>4 == ((a>>2) + b + 2)>>2
-
-16bit implementation note:
-The IDWT can be implemented with 16bits, but this requires some care to
-prevent overflows, the following list, lists the minimum number of bits needed
-for some terms
-1. lifting step
-A= s[i-1] + s[i+1]                              16bit
-3*A + 4                                         18bit
-A + (A>>1) + 2                                  17bit
-
-3. lifting step
-s[i-1] + s[i+1]                                 17bit
-
-4. lifiting step
-3*(s[i-1] + s[i+1])                             17bit
-
-
-TODO:
-=====
-Important:
-finetune initial contexts
-flip wavelet?
-try to use the wavelet transformed predicted image (motion compensated image) as context for coding the residual coefficients
-try the MV length as context for coding the residual coefficients
-use extradata for stuff which is in the keyframes now?
-the MV median predictor is patented IIRC
-implement per picture halfpel interpolation
-try different range coder state transition tables for different contexts
-
-Not Important:
-compare the 6 tap and 8 tap hpel filters (psnr/bitrate and subjective quality)
-spatial_scalability b vs u (!= 0 breaks syntax anyway so we can add a u later)
-
-
-Credits:
-========
-Michael Niedermayer
-Loren Merritt
-
-
-Copyright:
-==========
-GPL + GFDL + whatever is needed to make this a RFC
diff --git a/doc/soc.txt b/doc/soc.txt
deleted file mode 100644
index 8b4a86d..0000000
--- a/doc/soc.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-Google Summer of Code and similar project guidelines
-
-Summer of Code is a project by Google in which students are paid to implement
-some nice new features for various participating open source projects ...
-
-This text is a collection of things to take care of for the next soc as
-it's a little late for this year's soc (2006).
-
-The Goal:
-Our goal in respect to soc is and must be of course exactly one thing and
-that is to improve FFmpeg, to reach this goal, code must
-* conform to the svn policy and patch submission guidelines
-* must improve FFmpeg somehow (faster, smaller, "better",
-  more codecs supported, fewer bugs, cleaner, ...)
-
-for mentors and other developers to help students to reach that goal it is
-essential that changes to their codebase are publicly visible, clean and
-easy reviewable that again leads us to:
-* use of a revision control system like svn
-* separation of cosmetic from non-cosmetic changes (this is almost entirely
-  ignored by mentors and students in soc 2006 which might lead to a suprise
-  when the code will be reviewed at the end before a possible inclusion in
-  FFmpeg, individual changes were generally not reviewable due to cosmetics).
-* frequent commits, so that comments can be provided early
diff --git a/doc/swscale.txt b/doc/swscale.txt
deleted file mode 100644
index 4c62e67..0000000
--- a/doc/swscale.txt
+++ /dev/null
@@ -1,99 +0,0 @@
-    The official guide to swscale for confused developers.
-   ========================================================
-
-Current (simplified) Architecture:
----------------------------------
-                        Input
-                          v
-                   _______OR_________
-                 /                   \
-               /                       \
-       special converter     [Input to YUV converter]
-              |                         |
-              |          (8bit YUV 4:4:4 / 4:2:2 / 4:2:0 / 4:0:0 )
-              |                         |
-              |                         v
-              |                  Horizontal scaler
-              |                         |
-              |      (15bit YUV 4:4:4 / 4:2:2 / 4:2:0 / 4:1:1 / 4:0:0 )
-              |                         |
-              |                         v
-              |          Vertical scaler and output converter
-              |                         |
-              v                         v
-                         output
-
-
-Swscale has 2 scaler paths. Each side must be capable of handling
-slices, that is, consecutive non-overlapping rectangles of dimension
-(0,slice_top) - (picture_width, slice_bottom).
-
-special converter
-    These generally are unscaled converters of common
-    formats, like YUV 4:2:0/4:2:2 -> RGB12/15/16/24/32. Though it could also
-    in principle contain scalers optimized for specific common cases.
-
-Main path
-    The main path is used when no special converter can be used. The code
-    is designed as a destination line pull architecture. That is, for each
-    output line the vertical scaler pulls lines from a ring buffer. When
-    the ring buffer does not contain the wanted line, then it is pulled from
-    the input slice through the input converter and horizontal scaler.
-    The result is also stored in the ring buffer to serve future vertical
-    scaler requests.
-    When no more output can be generated because lines from a future slice
-    would be needed, then all remaining lines in the current slice are
-    converted, horizontally scaled and put in the ring buffer.
-    [This is done for luma and chroma, each with possibly different numbers
-     of lines per picture.]
-
-Input to YUV Converter
-    When the input to the main path is not planar 8 bits per component YUV or
-    8-bit gray, it is converted to planar 8-bit YUV. Two sets of converters
-    exist for this currently: One performs horizontal downscaling by 2
-    before the conversion, the other leaves the full chroma resolution,
-    but is slightly slower. The scaler will try to preserve full chroma
-    when the output uses it. It is possible to force full chroma with
-    SWS_FULL_CHR_H_INP even for cases where the scaler thinks it is useless.
-
-Horizontal scaler
-    There are several horizontal scalers. A special case worth mentioning is
-    the fast bilinear scaler that is made of runtime-generated MMX2 code
-    using specially tuned pshufw instructions.
-    The remaining scalers are specially-tuned for various filter lengths.
-    They scale 8-bit unsigned planar data to 16-bit signed planar data.
-    Future >8 bits per component inputs will need to add a new horizontal
-    scaler that preserves the input precision.
-
-Vertical scaler and output converter
-    There is a large number of combined vertical scalers + output converters.
-    Some are:
-    * unscaled output converters
-    * unscaled output converters that average 2 chroma lines
-    * bilinear converters                (C, MMX and accurate MMX)
-    * arbitrary filter length converters (C, MMX and accurate MMX)
-    And
-    * Plain C  8-bit 4:2:2 YUV -> RGB converters using LUTs
-    * Plain C 17-bit 4:4:4 YUV -> RGB converters using multiplies
-    * MMX     11-bit 4:2:2 YUV -> RGB converters
-    * Plain C 16-bit Y -> 16-bit gray
-      ...
-
-    RGB with less than 8 bits per component uses dither to improve the
-    subjective quality and low-frequency accuracy.
-
-
-Filter coefficients:
---------------------
-There are several different scalers (bilinear, bicubic, lanczos, area,
-sinc, ...). Their coefficients are calculated in initFilter().
-Horizontal filter coefficients have a 1.0 point at 1 << 14, vertical ones at
-1 << 12. The 1.0 points have been chosen to maximize precision while leaving
-a little headroom for convolutional filters like sharpening filters and
-minimizing SIMD instructions needed to apply them.
-It would be trivial to use a different 1.0 point if some specific scaler
-would benefit from it.
-Also, as already hinted at, initFilter() accepts an optional convolutional
-filter as input that can be used for contrast, saturation, blur, sharpening
-shift, chroma vs. luma shift, ...
-
diff --git a/doc/tablegen.txt b/doc/tablegen.txt
deleted file mode 100644
index 8dfcd7d..0000000
--- a/doc/tablegen.txt
+++ /dev/null
@@ -1,64 +0,0 @@
-Writing a table generator
-
-This documentation is preliminary.
-Parts of the API are not good and should be changed.
-
-Basic concepts
-
-A table generator consists of two files, *_tablegen.c and *_tablegen.h.
-The .h file will provide the variable declarations and initialization
-code for the tables, the .c calls the initialization code and then prints
-the tables as a header file using the tableprint.h helpers.
-Both of these files will be compiled for the host system, so to avoid
-breakage with cross-compilation neither of them may include, directly
-or indirectly, config.h or avconfig.h.
-Due to this, the .c file or Makefile may have to provide additional defines
-or stubs, though if possible this should be avoided.
-In particular, CONFIG_HARDCODED_TABLES should always be defined to 0.
-
-The .c file
-
-This file should include the *_tablegen.h and tableprint.h files and
-anything else it needs as long as it does not depend on config.h or
-avconfig.h.
-In addition to that it must contain a main() function which initializes
-all tables by calling the init functions from the .h file and then prints
-them.
-The printing code typically looks like this:
-    write_fileheader();
-    printf("static const uint8_t my_array[100] = {\n");
-    write_uint8_array(my_array, 100);
-    printf("};\n");
-
-write_fileheader() adds some minor things like a "this is a generated file"
-comment and some standard includes.
-tablegen.h defines some write functions for one- and two-dimensional arrays
-for standard types - they print only the "core" parts so they are easier
-to reuse for multi-dimensional arrays so the outermost {} must be printed
-separately.
-If there's no standard function for printing the type you need, the
-WRITE_1D_FUNC_ARGV macro is a very quick way to create one.
-See libavcodec/dv_tablegen.c for an example.
-
-
-The .h file
-
-This file should contain:
- - one or more initialization functions
- - the table variable declarations
-If CONFIG_HARDCODED_TABLES is set, the initialization functions should
-not do anything, and instead of the variable declarations the
-generated *_tables.h file should be included.
-Since that will be generated in the build directory, the path must be
-included, i.e.
-#include "libavcodec/example_tables.h"
-not
-#include "example_tables.h"
-
-Makefile changes
-
-To make the automatic table creation work, you must manually declare the
-new dependency.
-For this add a line similar to this:
-$(SUBDIR)example.o: $(SUBDIR)example_tables.h
-under the "ifdef CONFIG_HARDCODED_TABLES" section in the Makefile.
diff --git a/doc/texi2pod.pl b/doc/texi2pod.pl
deleted file mode 100755
index c414ffc..0000000
--- a/doc/texi2pod.pl
+++ /dev/null
@@ -1,427 +0,0 @@
-#! /usr/bin/perl -w
-
-#   Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
-
-# This file is part of GNU CC.
-
-# GNU CC is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# GNU CC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with GNU CC; see the file COPYING.  If not, write to
-# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-# This does trivial (and I mean _trivial_) conversion of Texinfo
-# markup to Perl POD format.  It's intended to be used to extract
-# something suitable for a manpage from a Texinfo document.
-
-$output = 0;
-$skipping = 0;
-%sects = ();
-$section = "";
- at icstack = ();
- at endwstack = ();
- at skstack = ();
- at instack = ();
-$shift = "";
-%defs = ();
-$fnno = 1;
-$inf = "";
-$ibase = "";
-
-while ($_ = shift) {
-    if (/^-D(.*)$/) {
-        if ($1 ne "") {
-            $flag = $1;
-        } else {
-            $flag = shift;
-        }
-        $value = "";
-        ($flag, $value) = ($flag =~ /^([^=]+)(?:=(.+))?/);
-        die "no flag specified for -D\n"
-            unless $flag ne "";
-        die "flags may only contain letters, digits, hyphens, dashes and underscores\n"
-            unless $flag =~ /^[a-zA-Z0-9_-]+$/;
-        $defs{$flag} = $value;
-    } elsif (/^-/) {
-        usage();
-    } else {
-        $in = $_, next unless defined $in;
-        $out = $_, next unless defined $out;
-        usage();
-    }
-}
-
-if (defined $in) {
-    $inf = gensym();
-    open($inf, "<$in") or die "opening \"$in\": $!\n";
-    $ibase = $1 if $in =~ m|^(.+)/[^/]+$|;
-} else {
-    $inf = \*STDIN;
-}
-
-if (defined $out) {
-    open(STDOUT, ">$out") or die "opening \"$out\": $!\n";
-}
-
-while(defined $inf) {
-while(<$inf>) {
-    # Certain commands are discarded without further processing.
-    /^\@(?:
-         [a-z]+index            # @*index: useful only in complete manual
-         |need                  # @need: useful only in printed manual
-         |(?:end\s+)?group      # @group .. @end group: ditto
-         |page                  # @page: ditto
-         |node                  # @node: useful only in .info file
-         |(?:end\s+)?ifnottex   # @ifnottex .. @end ifnottex: use contents
-        )\b/x and next;
-
-    chomp;
-
-    # Look for filename and title markers.
-    /^\@setfilename\s+([^.]+)/ and $fn = $1, next;
-    /^\@settitle\s+([^.]+)/ and $tl = postprocess($1), next;
-
-    # Identify a man title but keep only the one we are interested in.
-    /^\@c\s+man\s+title\s+([A-Za-z0-9-]+)\s+(.+)/ and do {
-        if (exists $defs{$1}) {
-            $fn = $1;
-            $tl = postprocess($2);
-        }
-        next;
-    };
-
-    # Look for blocks surrounded by @c man begin SECTION ... @c man end.
-    # This really oughta be @ifman ... @end ifman and the like, but such
-    # would require rev'ing all other Texinfo translators.
-    /^\@c\s+man\s+begin\s+([A-Z]+)\s+([A-Za-z0-9-]+)/ and do {
-        $output = 1 if exists $defs{$2};
-        $sect = $1;
-        next;
-    };
-    /^\@c\s+man\s+begin\s+([A-Z]+)/ and $sect = $1, $output = 1, next;
-    /^\@c\s+man\s+end/ and do {
-        $sects{$sect} = "" unless exists $sects{$sect};
-        $sects{$sect} .= postprocess($section);
-        $section = "";
-        $output = 0;
-        next;
-    };
-
-    # handle variables
-    /^\@set\s+([a-zA-Z0-9_-]+)\s*(.*)$/ and do {
-        $defs{$1} = $2;
-        next;
-    };
-    /^\@clear\s+([a-zA-Z0-9_-]+)/ and do {
-        delete $defs{$1};
-        next;
-    };
-
-    next unless $output;
-
-    # Discard comments.  (Can't do it above, because then we'd never see
-    # @c man lines.)
-    /^\@c\b/ and next;
-
-    # End-block handler goes up here because it needs to operate even
-    # if we are skipping.
-    /^\@end\s+([a-z]+)/ and do {
-        # Ignore @end foo, where foo is not an operation which may
-        # cause us to skip, if we are presently skipping.
-        my $ended = $1;
-        next if $skipping && $ended !~ /^(?:ifset|ifclear|ignore|menu|iftex)$/;
-
-        die "\@end $ended without \@$ended at line $.\n" unless defined $endw;
-        die "\@$endw ended by \@end $ended at line $.\n" unless $ended eq $endw;
-
-        $endw = pop @endwstack;
-
-        if ($ended =~ /^(?:ifset|ifclear|ignore|menu|iftex)$/) {
-            $skipping = pop @skstack;
-            next;
-        } elsif ($ended =~ /^(?:example|smallexample|display)$/) {
-            $shift = "";
-            $_ = "";        # need a paragraph break
-        } elsif ($ended =~ /^(?:itemize|enumerate|[fv]?table)$/) {
-            $_ = "\n=back\n";
-            $ic = pop @icstack;
-        } else {
-            die "unknown command \@end $ended at line $.\n";
-        }
-    };
-
-    # We must handle commands which can cause skipping even while we
-    # are skipping, otherwise we will not process nested conditionals
-    # correctly.
-    /^\@ifset\s+([a-zA-Z0-9_-]+)/ and do {
-        push @endwstack, $endw;
-        push @skstack, $skipping;
-        $endw = "ifset";
-        $skipping = 1 unless exists $defs{$1};
-        next;
-    };
-
-    /^\@ifclear\s+([a-zA-Z0-9_-]+)/ and do {
-        push @endwstack, $endw;
-        push @skstack, $skipping;
-        $endw = "ifclear";
-        $skipping = 1 if exists $defs{$1};
-        next;
-    };
-
-    /^\@(ignore|menu|iftex)\b/ and do {
-        push @endwstack, $endw;
-        push @skstack, $skipping;
-        $endw = $1;
-        $skipping = 1;
-        next;
-    };
-
-    next if $skipping;
-
-    # Character entities.  First the ones that can be replaced by raw text
-    # or discarded outright:
-    s/\@copyright\{\}/(c)/g;
-    s/\@dots\{\}/.../g;
-    s/\@enddots\{\}/..../g;
-    s/\@([.!? ])/$1/g;
-    s/\@[:-]//g;
-    s/\@bullet(?:\{\})?/*/g;
-    s/\@TeX\{\}/TeX/g;
-    s/\@pounds\{\}/\#/g;
-    s/\@minus(?:\{\})?/-/g;
-    s/\\,/,/g;
-
-    # Now the ones that have to be replaced by special escapes
-    # (which will be turned back into text by unmunge())
-    s/&/&amp;/g;
-    s/\@\{/&lbrace;/g;
-    s/\@\}/&rbrace;/g;
-    s/\@\@/&at;/g;
-
-    # Inside a verbatim block, handle @var specially.
-    if ($shift ne "") {
-        s/\@var\{([^\}]*)\}/<$1>/g;
-    }
-
-    # POD doesn't interpret E<> inside a verbatim block.
-    if ($shift eq "") {
-        s/</&lt;/g;
-        s/>/&gt;/g;
-    } else {
-        s/</&LT;/g;
-        s/>/&GT;/g;
-    }
-
-    # Single line command handlers.
-
-    /^\@include\s+(.+)$/ and do {
-        push @instack, $inf;
-        $inf = gensym();
-
-        # Try cwd and $ibase.
-        open($inf, "<" . $1)
-            or open($inf, "<" . $ibase . "/" . $1)
-                or die "cannot open $1 or $ibase/$1: $!\n";
-        next;
-    };
-
-    /^\@(?:section|unnumbered|unnumberedsec|center)\s+(.+)$/
-        and $_ = "\n=head2 $1\n";
-    /^\@subsection\s+(.+)$/
-        and $_ = "\n=head3 $1\n";
-
-    # Block command handlers:
-    /^\@itemize\s+(\@[a-z]+|\*|-)/ and do {
-        push @endwstack, $endw;
-        push @icstack, $ic;
-        $ic = $1;
-        $_ = "\n=over 4\n";
-        $endw = "itemize";
-    };
-
-    /^\@enumerate(?:\s+([a-zA-Z0-9]+))?/ and do {
-        push @endwstack, $endw;
-        push @icstack, $ic;
-        if (defined $1) {
-            $ic = $1 . ".";
-        } else {
-            $ic = "1.";
-        }
-        $_ = "\n=over 4\n";
-        $endw = "enumerate";
-    };
-
-    /^\@([fv]?table)\s+(\@[a-z]+)/ and do {
-        push @endwstack, $endw;
-        push @icstack, $ic;
-        $endw = $1;
-        $ic = $2;
-        $ic =~ s/\@(?:samp|strong|key|gcctabopt|option|env)/B/;
-        $ic =~ s/\@(?:code|kbd)/C/;
-        $ic =~ s/\@(?:dfn|var|emph|cite|i)/I/;
-        $ic =~ s/\@(?:file)/F/;
-        $_ = "\n=over 4\n";
-    };
-
-    /^\@((?:small)?example|display)/ and do {
-        push @endwstack, $endw;
-        $endw = $1;
-        $shift = "\t";
-        $_ = "";        # need a paragraph break
-    };
-
-    /^\@itemx?\s*(.+)?$/ and do {
-        if (defined $1) {
-            # Entity escapes prevent munging by the <> processing below.
-            $_ = "\n=item $ic\&LT;$1\&GT;\n";
-        } else {
-            $_ = "\n=item $ic\n";
-            $ic =~ y/A-Ya-y/B-Zb-z/;
-            $ic =~ s/(\d+)/$1 + 1/eg;
-        }
-    };
-
-    $section .= $shift.$_."\n";
-}
-# End of current file.
-close($inf);
-$inf = pop @instack;
-}
-
-die "No filename or title\n" unless defined $fn && defined $tl;
-
-$sects{NAME} = "$fn \- $tl\n";
-$sects{FOOTNOTES} .= "=back\n" if exists $sects{FOOTNOTES};
-
-for $sect (qw(NAME SYNOPSIS DESCRIPTION OPTIONS EXAMPLES ENVIRONMENT FILES
-              BUGS NOTES FOOTNOTES SEEALSO AUTHOR COPYRIGHT)) {
-    if(exists $sects{$sect}) {
-        $head = $sect;
-        $head =~ s/SEEALSO/SEE ALSO/;
-        print "=head1 $head\n\n";
-        print scalar unmunge ($sects{$sect});
-        print "\n";
-    }
-}
-
-sub usage
-{
-    die "usage: $0 [-D toggle...] [infile [outfile]]\n";
-}
-
-sub postprocess
-{
-    local $_ = $_[0];
-
-    # @value{foo} is replaced by whatever 'foo' is defined as.
-    while (m/(\@value\{([a-zA-Z0-9_-]+)\})/g) {
-        if (! exists $defs{$2}) {
-            print STDERR "Option $2 not defined\n";
-            s/\Q$1\E//;
-        } else {
-            $value = $defs{$2};
-            s/\Q$1\E/$value/;
-        }
-    }
-
-    # Formatting commands.
-    # Temporary escape for @r.
-    s/\@r\{([^\}]*)\}/R<$1>/g;
-    s/\@(?:dfn|var|emph|cite|i)\{([^\}]*)\}/I<$1>/g;
-    s/\@(?:code|kbd)\{([^\}]*)\}/C<$1>/g;
-    s/\@(?:gccoptlist|samp|strong|key|option|env|command|b)\{([^\}]*)\}/B<$1>/g;
-    s/\@sc\{([^\}]*)\}/\U$1/g;
-    s/\@file\{([^\}]*)\}/F<$1>/g;
-    s/\@w\{([^\}]*)\}/S<$1>/g;
-    s/\@(?:dmn|math)\{([^\}]*)\}/$1/g;
-
-    # Cross references are thrown away, as are @noindent and @refill.
-    # (@noindent is impossible in .pod, and @refill is unnecessary.)
-    # @* is also impossible in .pod; we discard it and any newline that
-    # follows it.  Similarly, our macro @gol must be discarded.
-
-    s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g;
-    s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g;
-    s/;\s+\@pxref\{(?:[^\}]*)\}//g;
-    s/\@noindent\s*//g;
-    s/\@refill//g;
-    s/\@gol//g;
-    s/\@\*\s*\n?//g;
-
-    # @uref can take one, two, or three arguments, with different
-    # semantics each time.  @url and @email are just like @uref with
-    # one argument, for our purposes.
-    s/\@(?:uref|url|email)\{([^\},]*)\}/&lt;B<$1>&gt;/g;
-    s/\@uref\{([^\},]*),([^\},]*)\}/$2 (C<$1>)/g;
-    s/\@uref\{([^\},]*),([^\},]*),([^\},]*)\}/$3/g;
-
-    # Turn B<blah I<blah> blah> into B<blah> I<blah> B<blah> to
-    # match Texinfo semantics of @emph inside @samp.  Also handle @r
-    # inside bold.
-    s/&LT;/</g;
-    s/&GT;/>/g;
-    1 while s/B<((?:[^<>]|I<[^<>]*>)*)R<([^>]*)>/B<$1>${2}B</g;
-    1 while (s/B<([^<>]*)I<([^>]+)>/B<$1>I<$2>B</g);
-    1 while (s/I<([^<>]*)B<([^>]+)>/I<$1>B<$2>I</g);
-    s/[BI]<>//g;
-    s/([BI])<(\s+)([^>]+)>/$2$1<$3>/g;
-    s/([BI])<([^>]+?)(\s+)>/$1<$2>$3/g;
-
-    # Extract footnotes.  This has to be done after all other
-    # processing because otherwise the regexp will choke on formatting
-    # inside @footnote.
-    while (/\@footnote/g) {
-        s/\@footnote\{([^\}]+)\}/[$fnno]/;
-        add_footnote($1, $fnno);
-        $fnno++;
-    }
-
-    return $_;
-}
-
-sub unmunge
-{
-    # Replace escaped symbols with their equivalents.
-    local $_ = $_[0];
-
-    s/&lt;/E<lt>/g;
-    s/&gt;/E<gt>/g;
-    s/&lbrace;/\{/g;
-    s/&rbrace;/\}/g;
-    s/&at;/\@/g;
-    s/&amp;/&/g;
-    return $_;
-}
-
-sub add_footnote
-{
-    unless (exists $sects{FOOTNOTES}) {
-        $sects{FOOTNOTES} = "\n=over 4\n\n";
-    }
-
-    $sects{FOOTNOTES} .= "=item $fnno.\n\n"; $fnno++;
-    $sects{FOOTNOTES} .= $_[0];
-    $sects{FOOTNOTES} .= "\n\n";
-}
-
-# stolen from Symbol.pm
-{
-    my $genseq = 0;
-    sub gensym
-    {
-        my $name = "GEN" . $genseq++;
-        my $ref = \*{$name};
-        delete $::{$name};
-        return $ref;
-    }
-}
diff --git a/doc/viterbi.txt b/doc/viterbi.txt
deleted file mode 100644
index d9d924f..0000000
--- a/doc/viterbi.txt
+++ /dev/null
@@ -1,110 +0,0 @@
-This is a quick description of the viterbi aka dynamic programing
-algorthm.
-
-Its reason for existence is that wikipedia has become very poor on
-describing algorithms in a way that makes it useable for understanding
-them or anything else actually. It tends now to describe the very same
-algorithm under 50 different names and pages with few understandable
-by even people who fully understand the algorithm and the theory behind.
-
-Problem description: (that is what it can solve)
-assume we have a 2d table, or you could call it a graph or matrix if you
-prefer
-
-    O   O   O   O   O   O   O
-
-    O   O   O   O   O   O   O
-
-    O   O   O   O   O   O   O
-
-    O   O   O   O   O   O   O
-
-
-That table has edges connecting points from each column to the next column
-and each edge has a score like: (only some edge and scores shown to keep it
-readable)
-
-
-    O--5--O-----O-----O-----O-----O
-     2   / 7   / \   / \   / \   /
-      \ /   \ /   \ /   \ /   \ /
-    O7-/--O--/--O--/--O--/--O--/--O
-     \/ \/ 1/ \/ \/ \/ \/ \/ \/ \/
-     /\ /\ 2\ /\ /\ /\ /\ /\ /\ /\
-    O3-/--O--/--O--/--O--/--O--/--O
-      / \   / \   / \   / \   / \
-     1   \ 9   \ /   \ /   \ /   \
-    O--2--O--1--O--5--O--3--O--8--O
-
-
-
-Our goal is to find a path from left to right through it which
-minimizes the sum of the score of all edges.
-(and of course left/right is just a convention here it could be top down too)
-Similarly the minimum could be the maximum by just fliping the sign,
-Example of a path with scores:
-
-    O   O   O   O   O   O   O
-
->---O.  O   O  .O-2-O   O   O
-      5.     .7      .
-    O   O-1-O   O   O 8 O   O
-                       .
-    O   O   O   O   O   O-1-O---> (sum here is 24)
-
-
-The viterbi algorthm now solves this simply column by column
-For the previous column each point has a best path and a associated
-score:
-
-    O-----5     O
-     \
-      \
-    O  \  1     O
-        \/
-        /\
-    O  /  2     O
-      /
-     /
-    O-----2     O
-
-
-To move one column forward we just need to find the best path and associated
-scores for the next column
-here are some edges we could choose from:
-
-
-    O-----5--3--O
-     \      \8
-      \       \
-    O  \  1--9--O
-        \/  \3
-        /\     \
-    O  /  2--1--O
-      /     \2
-     /        \
-    O-----2--4--O
-
-Finding the new best pathes and scores for each point of our new column is
-trivial given we know the previous column best pathes and scores:
-
-    O-----0-----8
-     \
-      \
-    O  \  0----10
-        \/
-        /\
-    O  /  0-----3
-      /     \
-     /        \
-    O     0     4
-
-
-the viterbi algorthm continues exactly like this column for column until the
-end and then just picks the path with the best score (above that would be the
-one with score 3)
-
-
-Author: Michael niedermayer
-Copyright LGPL
-
diff --git a/ffmpeg.c b/ffmpeg.c
deleted file mode 100644
index 6b9380f..0000000
--- a/ffmpeg.c
+++ /dev/null
@@ -1,4173 +0,0 @@
-/*
- * FFmpeg main
- * Copyright (c) 2000-2003 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/* needed for usleep() */
-#define _XOPEN_SOURCE 600
-
-#include "config.h"
-#include <ctype.h>
-#include <string.h>
-#include <math.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <signal.h>
-#include <limits.h>
-#include <unistd.h>
-#include "libavformat/avformat.h"
-#include "libavdevice/avdevice.h"
-#include "libswscale/swscale.h"
-#include "libavcodec/opt.h"
-#include "libavcodec/audioconvert.h"
-#include "libavcodec/colorspace.h"
-#include "libavutil/fifo.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/avstring.h"
-#include "libavutil/libm.h"
-#include "libavformat/os_support.h"
-
-#if HAVE_SYS_RESOURCE_H
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#elif HAVE_GETPROCESSTIMES
-#include <windows.h>
-#endif
-#if HAVE_GETPROCESSMEMORYINFO
-#include <windows.h>
-#include <psapi.h>
-#endif
-
-#if HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-
-#if HAVE_TERMIOS_H
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-#include <termios.h>
-#elif HAVE_CONIO_H
-#include <conio.h>
-#endif
-#include <time.h>
-
-#include "cmdutils.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-const char program_name[] = "FFmpeg";
-const int program_birth_year = 2000;
-
-/* select an input stream for an output stream */
-typedef struct AVStreamMap {
-    int file_index;
-    int stream_index;
-    int sync_file_index;
-    int sync_stream_index;
-} AVStreamMap;
-
-/** select an input file for an output file */
-typedef struct AVMetaDataMap {
-    int out_file;
-    int in_file;
-} AVMetaDataMap;
-
-static const OptionDef options[];
-
-#define MAX_FILES 100
-
-static const char *last_asked_format = NULL;
-static AVFormatContext *input_files[MAX_FILES];
-static int64_t input_files_ts_offset[MAX_FILES];
-static double input_files_ts_scale[MAX_FILES][MAX_STREAMS];
-static AVCodec *input_codecs[MAX_FILES*MAX_STREAMS];
-static int nb_input_files = 0;
-static int nb_icodecs;
-
-static AVFormatContext *output_files[MAX_FILES];
-static AVCodec *output_codecs[MAX_FILES*MAX_STREAMS];
-static int nb_output_files = 0;
-static int nb_ocodecs;
-
-static AVStreamMap stream_maps[MAX_FILES*MAX_STREAMS];
-static int nb_stream_maps;
-
-static AVMetaDataMap meta_data_maps[MAX_FILES];
-static int nb_meta_data_maps;
-
-static int frame_width  = 0;
-static int frame_height = 0;
-static float frame_aspect_ratio = 0;
-static enum PixelFormat frame_pix_fmt = PIX_FMT_NONE;
-static enum SampleFormat audio_sample_fmt = SAMPLE_FMT_NONE;
-static int frame_padtop  = 0;
-static int frame_padbottom = 0;
-static int frame_padleft  = 0;
-static int frame_padright = 0;
-static int padcolor[3] = {16,128,128}; /* default to black */
-static int frame_topBand  = 0;
-static int frame_bottomBand = 0;
-static int frame_leftBand  = 0;
-static int frame_rightBand = 0;
-static int max_frames[4] = {INT_MAX, INT_MAX, INT_MAX, INT_MAX};
-static AVRational frame_rate;
-static float video_qscale = 0;
-static uint16_t *intra_matrix = NULL;
-static uint16_t *inter_matrix = NULL;
-static const char *video_rc_override_string=NULL;
-static int video_disable = 0;
-static int video_discard = 0;
-static char *video_codec_name = NULL;
-static int video_codec_tag = 0;
-static char *video_language = NULL;
-static int same_quality = 0;
-static int do_deinterlace = 0;
-static int top_field_first = -1;
-static int me_threshold = 0;
-static int intra_dc_precision = 8;
-static int loop_input = 0;
-static int loop_output = AVFMT_NOOUTPUTLOOP;
-static int qp_hist = 0;
-
-static int intra_only = 0;
-static int audio_sample_rate = 44100;
-static int64_t channel_layout = 0;
-#define QSCALE_NONE -99999
-static float audio_qscale = QSCALE_NONE;
-static int audio_disable = 0;
-static int audio_channels = 1;
-static char  *audio_codec_name = NULL;
-static int audio_codec_tag = 0;
-static char *audio_language = NULL;
-
-static int subtitle_disable = 0;
-static char *subtitle_codec_name = NULL;
-static char *subtitle_language = NULL;
-static int subtitle_codec_tag = 0;
-
-static float mux_preload= 0.5;
-static float mux_max_delay= 0.7;
-
-static int64_t recording_time = INT64_MAX;
-static int64_t start_time = 0;
-static int64_t rec_timestamp = 0;
-static int64_t input_ts_offset = 0;
-static int file_overwrite = 0;
-static int metadata_count;
-static AVMetadataTag *metadata;
-static int do_benchmark = 0;
-static int do_hex_dump = 0;
-static int do_pkt_dump = 0;
-static int do_psnr = 0;
-static int do_pass = 0;
-static char *pass_logfilename_prefix = NULL;
-static int audio_stream_copy = 0;
-static int video_stream_copy = 0;
-static int subtitle_stream_copy = 0;
-static int video_sync_method= -1;
-static int audio_sync_method= 0;
-static float audio_drift_threshold= 0.1;
-static int copy_ts= 0;
-static int opt_shortest = 0;
-static int video_global_header = 0;
-static char *vstats_filename;
-static FILE *vstats_file;
-static int opt_programid = 0;
-static int copy_initial_nonkeyframes = 0;
-
-static int rate_emu = 0;
-
-static int  video_channel = 0;
-static char *video_standard;
-
-static int audio_volume = 256;
-
-static int exit_on_error = 0;
-static int using_stdin = 0;
-static int verbose = 1;
-static int thread_count= 1;
-static int q_pressed = 0;
-static int64_t video_size = 0;
-static int64_t audio_size = 0;
-static int64_t extra_size = 0;
-static int nb_frames_dup = 0;
-static int nb_frames_drop = 0;
-static int input_sync;
-static uint64_t limit_filesize = 0;
-static int force_fps = 0;
-
-static int pgmyuv_compatibility_hack=0;
-static float dts_delta_threshold = 10;
-
-static unsigned int sws_flags = SWS_BICUBIC;
-
-static int64_t timer_start;
-
-static uint8_t *audio_buf;
-static uint8_t *audio_out;
-unsigned int allocated_audio_out_size, allocated_audio_buf_size;
-
-static short *samples;
-
-static AVBitStreamFilterContext *video_bitstream_filters=NULL;
-static AVBitStreamFilterContext *audio_bitstream_filters=NULL;
-static AVBitStreamFilterContext *subtitle_bitstream_filters=NULL;
-static AVBitStreamFilterContext *bitstream_filters[MAX_FILES][MAX_STREAMS];
-
-#define DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass"
-
-struct AVInputStream;
-
-typedef struct AVOutputStream {
-    int file_index;          /* file index */
-    int index;               /* stream index in the output file */
-    int source_index;        /* AVInputStream index */
-    AVStream *st;            /* stream in the output file */
-    int encoding_needed;     /* true if encoding needed for this stream */
-    int frame_number;
-    /* input pts and corresponding output pts
-       for A/V sync */
-    //double sync_ipts;        /* dts from the AVPacket of the demuxer in second units */
-    struct AVInputStream *sync_ist; /* input stream to sync against */
-    int64_t sync_opts;       /* output frame counter, could be changed to some true timestamp */ //FIXME look at frame_number
-    /* video only */
-    int video_resample;
-    AVFrame pict_tmp;      /* temporary image for resampling */
-    struct SwsContext *img_resample_ctx; /* for image resampling */
-    int resample_height;
-    int resample_width;
-    int resample_pix_fmt;
-
-    /* full frame size of first frame */
-    int original_height;
-    int original_width;
-
-    /* cropping area sizes */
-    int video_crop;
-    int topBand;
-    int bottomBand;
-    int leftBand;
-    int rightBand;
-
-    /* cropping area of first frame */
-    int original_topBand;
-    int original_bottomBand;
-    int original_leftBand;
-    int original_rightBand;
-
-    /* padding area sizes */
-    int video_pad;
-    int padtop;
-    int padbottom;
-    int padleft;
-    int padright;
-
-    /* audio only */
-    int audio_resample;
-    ReSampleContext *resample; /* for audio resampling */
-    int reformat_pair;
-    AVAudioConvert *reformat_ctx;
-    AVFifoBuffer *fifo;     /* for compression: one audio fifo per codec */
-    FILE *logfile;
-} AVOutputStream;
-
-typedef struct AVInputStream {
-    int file_index;
-    int index;
-    AVStream *st;
-    int discard;             /* true if stream data should be discarded */
-    int decoding_needed;     /* true if the packets must be decoded in 'raw_fifo' */
-    int64_t sample_index;      /* current sample */
-
-    int64_t       start;     /* time when read started */
-    int64_t       next_pts;  /* synthetic pts for cases where pkt.pts
-                                is not defined */
-    int64_t       pts;       /* current pts */
-    int is_start;            /* is 1 at the start and after a discontinuity */
-    int showed_multi_packet_warning;
-    int is_past_recording_time;
-} AVInputStream;
-
-typedef struct AVInputFile {
-    int eof_reached;      /* true if eof reached */
-    int ist_index;        /* index of first stream in ist_table */
-    int buffer_size;      /* current total buffer size */
-    int nb_streams;       /* nb streams we are aware of */
-} AVInputFile;
-
-#if HAVE_TERMIOS_H
-
-/* init terminal so that we can grab keys */
-static struct termios oldtty;
-#endif
-
-static void term_exit(void)
-{
-#if HAVE_TERMIOS_H
-    tcsetattr (0, TCSANOW, &oldtty);
-#endif
-}
-
-static volatile int received_sigterm = 0;
-
-static void
-sigterm_handler(int sig)
-{
-    received_sigterm = sig;
-    term_exit();
-}
-
-static void term_init(void)
-{
-#if HAVE_TERMIOS_H
-    struct termios tty;
-
-    tcgetattr (0, &tty);
-    oldtty = tty;
-    atexit(term_exit);
-
-    tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP
-                          |INLCR|IGNCR|ICRNL|IXON);
-    tty.c_oflag |= OPOST;
-    tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN);
-    tty.c_cflag &= ~(CSIZE|PARENB);
-    tty.c_cflag |= CS8;
-    tty.c_cc[VMIN] = 1;
-    tty.c_cc[VTIME] = 0;
-
-    tcsetattr (0, TCSANOW, &tty);
-    signal(SIGQUIT, sigterm_handler); /* Quit (POSIX).  */
-#endif
-
-    signal(SIGINT , sigterm_handler); /* Interrupt (ANSI).  */
-    signal(SIGTERM, sigterm_handler); /* Termination (ANSI).  */
-#ifdef SIGXCPU
-    signal(SIGXCPU, sigterm_handler);
-#endif
-
-#if CONFIG_BEOS_NETSERVER
-    fcntl(0, F_SETFL, fcntl(0, F_GETFL) | O_NONBLOCK);
-#endif
-}
-
-/* read a key without blocking */
-static int read_key(void)
-{
-#if HAVE_TERMIOS_H
-    int n = 1;
-    unsigned char ch;
-#if !CONFIG_BEOS_NETSERVER
-    struct timeval tv;
-    fd_set rfds;
-
-    FD_ZERO(&rfds);
-    FD_SET(0, &rfds);
-    tv.tv_sec = 0;
-    tv.tv_usec = 0;
-    n = select(1, &rfds, NULL, NULL, &tv);
-#endif
-    if (n > 0) {
-        n = read(0, &ch, 1);
-        if (n == 1)
-            return ch;
-
-        return n;
-    }
-#elif HAVE_CONIO_H
-    if(kbhit())
-        return(getch());
-#endif
-    return -1;
-}
-
-static int decode_interrupt_cb(void)
-{
-    return q_pressed || (q_pressed = read_key() == 'q');
-}
-
-static int av_exit(int ret)
-{
-    int i;
-
-    /* close files */
-    for(i=0;i<nb_output_files;i++) {
-        /* maybe av_close_output_file ??? */
-        AVFormatContext *s = output_files[i];
-        int j;
-        if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb)
-            url_fclose(s->pb);
-        for(j=0;j<s->nb_streams;j++) {
-            av_metadata_free(&s->streams[j]->metadata);
-            av_free(s->streams[j]->codec);
-            av_free(s->streams[j]);
-        }
-        for(j=0;j<s->nb_programs;j++) {
-            av_metadata_free(&s->programs[j]->metadata);
-        }
-        for(j=0;j<s->nb_chapters;j++) {
-            av_metadata_free(&s->chapters[j]->metadata);
-        }
-        av_metadata_free(&s->metadata);
-        av_free(s);
-    }
-    for(i=0;i<nb_input_files;i++)
-        av_close_input_file(input_files[i]);
-
-    av_free(intra_matrix);
-    av_free(inter_matrix);
-
-    if (vstats_file)
-        fclose(vstats_file);
-    av_free(vstats_filename);
-
-    av_free(opt_names);
-
-    av_free(video_codec_name);
-    av_free(audio_codec_name);
-    av_free(subtitle_codec_name);
-
-    av_free(video_standard);
-
-#if CONFIG_POWERPC_PERF
-    void powerpc_display_perf_report(void);
-    powerpc_display_perf_report();
-#endif /* CONFIG_POWERPC_PERF */
-
-    for (i=0;i<AVMEDIA_TYPE_NB;i++)
-        av_free(avcodec_opts[i]);
-    av_free(avformat_opts);
-    av_free(sws_opts);
-    av_free(audio_buf);
-    av_free(audio_out);
-    allocated_audio_buf_size= allocated_audio_out_size= 0;
-    av_free(samples);
-
-    if (received_sigterm) {
-        fprintf(stderr,
-            "Received signal %d: terminating.\n",
-            (int) received_sigterm);
-        exit (255);
-    }
-
-    exit(ret); /* not all OS-es handle main() return value */
-    return ret;
-}
-
-static void choose_sample_fmt(AVStream *st, AVCodec *codec)
-{
-    if(codec && codec->sample_fmts){
-        const enum SampleFormat *p= codec->sample_fmts;
-        for(; *p!=-1; p++){
-            if(*p == st->codec->sample_fmt)
-                break;
-        }
-        if(*p == -1)
-            st->codec->sample_fmt = codec->sample_fmts[0];
-    }
-}
-
-static void choose_sample_rate(AVStream *st, AVCodec *codec)
-{
-    if(codec && codec->supported_samplerates){
-        const int *p= codec->supported_samplerates;
-        int best;
-        int best_dist=INT_MAX;
-        for(; *p; p++){
-            int dist= abs(st->codec->sample_rate - *p);
-            if(dist < best_dist){
-                best_dist= dist;
-                best= *p;
-            }
-        }
-        if(best_dist){
-            av_log(st->codec, AV_LOG_WARNING, "Requested sampling rate unsupported using closest supported (%d)\n", best);
-        }
-        st->codec->sample_rate= best;
-    }
-}
-
-static void choose_pixel_fmt(AVStream *st, AVCodec *codec)
-{
-    if(codec && codec->pix_fmts){
-        const enum PixelFormat *p= codec->pix_fmts;
-        for(; *p!=-1; p++){
-            if(*p == st->codec->pix_fmt)
-                break;
-        }
-        if(*p == -1
-           && !(   st->codec->codec_id==CODEC_ID_MJPEG
-                && st->codec->strict_std_compliance <= FF_COMPLIANCE_INOFFICIAL
-                && (   st->codec->pix_fmt == PIX_FMT_YUV420P
-                    || st->codec->pix_fmt == PIX_FMT_YUV422P)))
-            st->codec->pix_fmt = codec->pix_fmts[0];
-    }
-}
-
-static int read_ffserver_streams(AVFormatContext *s, const char *filename)
-{
-    int i, err;
-    AVFormatContext *ic;
-    int nopts = 0;
-
-    err = av_open_input_file(&ic, filename, NULL, FFM_PACKET_SIZE, NULL);
-    if (err < 0)
-        return err;
-    /* copy stream format */
-    s->nb_streams = ic->nb_streams;
-    for(i=0;i<ic->nb_streams;i++) {
-        AVStream *st;
-        AVCodec *codec;
-
-        // FIXME: a more elegant solution is needed
-        st = av_mallocz(sizeof(AVStream));
-        memcpy(st, ic->streams[i], sizeof(AVStream));
-        st->codec = avcodec_alloc_context();
-        if (!st->codec) {
-            print_error(filename, AVERROR(ENOMEM));
-            av_exit(1);
-        }
-        avcodec_copy_context(st->codec, ic->streams[i]->codec);
-        s->streams[i] = st;
-
-        codec = avcodec_find_encoder(st->codec->codec_id);
-        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            if (audio_stream_copy) {
-                st->stream_copy = 1;
-            } else
-                choose_sample_fmt(st, codec);
-        } else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-            if (video_stream_copy) {
-                st->stream_copy = 1;
-            } else
-                choose_pixel_fmt(st, codec);
-        }
-
-        if(!st->codec->thread_count)
-            st->codec->thread_count = 1;
-        if(st->codec->thread_count>1)
-            avcodec_thread_init(st->codec, st->codec->thread_count);
-
-        if(st->codec->flags & CODEC_FLAG_BITEXACT)
-            nopts = 1;
-    }
-
-    if (!nopts)
-        s->timestamp = av_gettime();
-
-    av_close_input_file(ic);
-    return 0;
-}
-
-static double
-get_sync_ipts(const AVOutputStream *ost)
-{
-    const AVInputStream *ist = ost->sync_ist;
-    return (double)(ist->pts - start_time)/AV_TIME_BASE;
-}
-
-static void write_frame(AVFormatContext *s, AVPacket *pkt, AVCodecContext *avctx, AVBitStreamFilterContext *bsfc){
-    int ret;
-
-    while(bsfc){
-        AVPacket new_pkt= *pkt;
-        int a= av_bitstream_filter_filter(bsfc, avctx, NULL,
-                                          &new_pkt.data, &new_pkt.size,
-                                          pkt->data, pkt->size,
-                                          pkt->flags & AV_PKT_FLAG_KEY);
-        if(a>0){
-            av_free_packet(pkt);
-            new_pkt.destruct= av_destruct_packet;
-        } else if(a<0){
-            fprintf(stderr, "%s failed for stream %d, codec %s",
-                    bsfc->filter->name, pkt->stream_index,
-                    avctx->codec ? avctx->codec->name : "copy");
-            print_error("", a);
-            if (exit_on_error)
-                av_exit(1);
-        }
-        *pkt= new_pkt;
-
-        bsfc= bsfc->next;
-    }
-
-    ret= av_interleaved_write_frame(s, pkt);
-    if(ret < 0){
-        print_error("av_interleaved_write_frame()", ret);
-        av_exit(1);
-    }
-}
-
-#define MAX_AUDIO_PACKET_SIZE (128 * 1024)
-
-static void do_audio_out(AVFormatContext *s,
-                         AVOutputStream *ost,
-                         AVInputStream *ist,
-                         unsigned char *buf, int size)
-{
-    uint8_t *buftmp;
-    int64_t audio_out_size, audio_buf_size;
-    int64_t allocated_for_size= size;
-
-    int size_out, frame_bytes, ret;
-    AVCodecContext *enc= ost->st->codec;
-    AVCodecContext *dec= ist->st->codec;
-    int osize= av_get_bits_per_sample_format(enc->sample_fmt)/8;
-    int isize= av_get_bits_per_sample_format(dec->sample_fmt)/8;
-    const int coded_bps = av_get_bits_per_sample(enc->codec->id);
-
-need_realloc:
-    audio_buf_size= (allocated_for_size + isize*dec->channels - 1) / (isize*dec->channels);
-    audio_buf_size= (audio_buf_size*enc->sample_rate + dec->sample_rate) / dec->sample_rate;
-    audio_buf_size= audio_buf_size*2 + 10000; //safety factors for the deprecated resampling API
-    audio_buf_size*= osize*enc->channels;
-
-    audio_out_size= FFMAX(audio_buf_size, enc->frame_size * osize * enc->channels);
-    if(coded_bps > 8*osize)
-        audio_out_size= audio_out_size * coded_bps / (8*osize);
-    audio_out_size += FF_MIN_BUFFER_SIZE;
-
-    if(audio_out_size > INT_MAX || audio_buf_size > INT_MAX){
-        fprintf(stderr, "Buffer sizes too large\n");
-        av_exit(1);
-    }
-
-    av_fast_malloc(&audio_buf, &allocated_audio_buf_size, audio_buf_size);
-    av_fast_malloc(&audio_out, &allocated_audio_out_size, audio_out_size);
-    if (!audio_buf || !audio_out){
-        fprintf(stderr, "Out of memory in do_audio_out\n");
-        av_exit(1);
-    }
-
-    if (enc->channels != dec->channels)
-        ost->audio_resample = 1;
-
-    if (ost->audio_resample && !ost->resample) {
-        if (dec->sample_fmt != SAMPLE_FMT_S16)
-            fprintf(stderr, "Warning, using s16 intermediate sample format for resampling\n");
-        ost->resample = av_audio_resample_init(enc->channels,    dec->channels,
-                                               enc->sample_rate, dec->sample_rate,
-                                               enc->sample_fmt,  dec->sample_fmt,
-                                               16, 10, 0, 0.8);
-        if (!ost->resample) {
-            fprintf(stderr, "Can not resample %d channels @ %d Hz to %d channels @ %d Hz\n",
-                    dec->channels, dec->sample_rate,
-                    enc->channels, enc->sample_rate);
-            av_exit(1);
-        }
-    }
-
-#define MAKE_SFMT_PAIR(a,b) ((a)+SAMPLE_FMT_NB*(b))
-    if (!ost->audio_resample && dec->sample_fmt!=enc->sample_fmt &&
-        MAKE_SFMT_PAIR(enc->sample_fmt,dec->sample_fmt)!=ost->reformat_pair) {
-        if (ost->reformat_ctx)
-            av_audio_convert_free(ost->reformat_ctx);
-        ost->reformat_ctx = av_audio_convert_alloc(enc->sample_fmt, 1,
-                                                   dec->sample_fmt, 1, NULL, 0);
-        if (!ost->reformat_ctx) {
-            fprintf(stderr, "Cannot convert %s sample format to %s sample format\n",
-                avcodec_get_sample_fmt_name(dec->sample_fmt),
-                avcodec_get_sample_fmt_name(enc->sample_fmt));
-            av_exit(1);
-        }
-        ost->reformat_pair=MAKE_SFMT_PAIR(enc->sample_fmt,dec->sample_fmt);
-    }
-
-    if(audio_sync_method){
-        double delta = get_sync_ipts(ost) * enc->sample_rate - ost->sync_opts
-                - av_fifo_size(ost->fifo)/(ost->st->codec->channels * 2);
-        double idelta= delta*ist->st->codec->sample_rate / enc->sample_rate;
-        int byte_delta= ((int)idelta)*2*ist->st->codec->channels;
-
-        //FIXME resample delay
-        if(fabs(delta) > 50){
-            if(ist->is_start || fabs(delta) > audio_drift_threshold*enc->sample_rate){
-                if(byte_delta < 0){
-                    byte_delta= FFMAX(byte_delta, -size);
-                    size += byte_delta;
-                    buf  -= byte_delta;
-                    if(verbose > 2)
-                        fprintf(stderr, "discarding %d audio samples\n", (int)-delta);
-                    if(!size)
-                        return;
-                    ist->is_start=0;
-                }else{
-                    static uint8_t *input_tmp= NULL;
-                    input_tmp= av_realloc(input_tmp, byte_delta + size);
-
-                    if(byte_delta > allocated_for_size - size){
-                        allocated_for_size= byte_delta + (int64_t)size;
-                        goto need_realloc;
-                    }
-                    ist->is_start=0;
-
-                    memset(input_tmp, 0, byte_delta);
-                    memcpy(input_tmp + byte_delta, buf, size);
-                    buf= input_tmp;
-                    size += byte_delta;
-                    if(verbose > 2)
-                        fprintf(stderr, "adding %d audio samples of silence\n", (int)delta);
-                }
-            }else if(audio_sync_method>1){
-                int comp= av_clip(delta, -audio_sync_method, audio_sync_method);
-                assert(ost->audio_resample);
-                if(verbose > 2)
-                    fprintf(stderr, "compensating audio timestamp drift:%f compensation:%d in:%d\n", delta, comp, enc->sample_rate);
-//                fprintf(stderr, "drift:%f len:%d opts:%"PRId64" ipts:%"PRId64" fifo:%d\n", delta, -1, ost->sync_opts, (int64_t)(get_sync_ipts(ost) * enc->sample_rate), av_fifo_size(ost->fifo)/(ost->st->codec->channels * 2));
-                av_resample_compensate(*(struct AVResampleContext**)ost->resample, comp, enc->sample_rate);
-            }
-        }
-    }else
-        ost->sync_opts= lrintf(get_sync_ipts(ost) * enc->sample_rate)
-                        - av_fifo_size(ost->fifo)/(ost->st->codec->channels * 2); //FIXME wrong
-
-    if (ost->audio_resample) {
-        buftmp = audio_buf;
-        size_out = audio_resample(ost->resample,
-                                  (short *)buftmp, (short *)buf,
-                                  size / (ist->st->codec->channels * isize));
-        size_out = size_out * enc->channels * osize;
-    } else {
-        buftmp = buf;
-        size_out = size;
-    }
-
-    if (!ost->audio_resample && dec->sample_fmt!=enc->sample_fmt) {
-        const void *ibuf[6]= {buftmp};
-        void *obuf[6]= {audio_buf};
-        int istride[6]= {isize};
-        int ostride[6]= {osize};
-        int len= size_out/istride[0];
-        if (av_audio_convert(ost->reformat_ctx, obuf, ostride, ibuf, istride, len)<0) {
-            printf("av_audio_convert() failed\n");
-            if (exit_on_error)
-                av_exit(1);
-            return;
-        }
-        buftmp = audio_buf;
-        size_out = len*osize;
-    }
-
-    /* now encode as many frames as possible */
-    if (enc->frame_size > 1) {
-        /* output resampled raw samples */
-        if (av_fifo_realloc2(ost->fifo, av_fifo_size(ost->fifo) + size_out) < 0) {
-            fprintf(stderr, "av_fifo_realloc2() failed\n");
-            av_exit(1);
-        }
-        av_fifo_generic_write(ost->fifo, buftmp, size_out, NULL);
-
-        frame_bytes = enc->frame_size * osize * enc->channels;
-
-        while (av_fifo_size(ost->fifo) >= frame_bytes) {
-            AVPacket pkt;
-            av_init_packet(&pkt);
-
-            av_fifo_generic_read(ost->fifo, audio_buf, frame_bytes, NULL);
-
-            //FIXME pass ost->sync_opts as AVFrame.pts in avcodec_encode_audio()
-
-            ret = avcodec_encode_audio(enc, audio_out, audio_out_size,
-                                       (short *)audio_buf);
-            if (ret < 0) {
-                fprintf(stderr, "Audio encoding failed\n");
-                av_exit(1);
-            }
-            audio_size += ret;
-            pkt.stream_index= ost->index;
-            pkt.data= audio_out;
-            pkt.size= ret;
-            if(enc->coded_frame && enc->coded_frame->pts != AV_NOPTS_VALUE)
-                pkt.pts= av_rescale_q(enc->coded_frame->pts, enc->time_base, ost->st->time_base);
-            pkt.flags |= AV_PKT_FLAG_KEY;
-            write_frame(s, &pkt, ost->st->codec, bitstream_filters[ost->file_index][pkt.stream_index]);
-
-            ost->sync_opts += enc->frame_size;
-        }
-    } else {
-        AVPacket pkt;
-        av_init_packet(&pkt);
-
-        ost->sync_opts += size_out / (osize * enc->channels);
-
-        /* output a pcm frame */
-        /* determine the size of the coded buffer */
-        size_out /= osize;
-        if (coded_bps)
-            size_out = size_out*coded_bps/8;
-
-        if(size_out > audio_out_size){
-            fprintf(stderr, "Internal error, buffer size too small\n");
-            av_exit(1);
-        }
-
-        //FIXME pass ost->sync_opts as AVFrame.pts in avcodec_encode_audio()
-        ret = avcodec_encode_audio(enc, audio_out, size_out,
-                                   (short *)buftmp);
-        if (ret < 0) {
-            fprintf(stderr, "Audio encoding failed\n");
-            av_exit(1);
-        }
-        audio_size += ret;
-        pkt.stream_index= ost->index;
-        pkt.data= audio_out;
-        pkt.size= ret;
-        if(enc->coded_frame && enc->coded_frame->pts != AV_NOPTS_VALUE)
-            pkt.pts= av_rescale_q(enc->coded_frame->pts, enc->time_base, ost->st->time_base);
-        pkt.flags |= AV_PKT_FLAG_KEY;
-        write_frame(s, &pkt, ost->st->codec, bitstream_filters[ost->file_index][pkt.stream_index]);
-    }
-}
-
-static void pre_process_video_frame(AVInputStream *ist, AVPicture *picture, void **bufp)
-{
-    AVCodecContext *dec;
-    AVPicture *picture2;
-    AVPicture picture_tmp;
-    uint8_t *buf = 0;
-
-    dec = ist->st->codec;
-
-    /* deinterlace : must be done before any resize */
-    if (do_deinterlace) {
-        int size;
-
-        /* create temporary picture */
-        size = avpicture_get_size(dec->pix_fmt, dec->width, dec->height);
-        buf = av_malloc(size);
-        if (!buf)
-            return;
-
-        picture2 = &picture_tmp;
-        avpicture_fill(picture2, buf, dec->pix_fmt, dec->width, dec->height);
-
-        if(avpicture_deinterlace(picture2, picture,
-                                 dec->pix_fmt, dec->width, dec->height) < 0) {
-            /* if error, do not deinterlace */
-            fprintf(stderr, "Deinterlacing failed\n");
-            av_free(buf);
-            buf = NULL;
-            picture2 = picture;
-        }
-    } else {
-        picture2 = picture;
-    }
-
-    if (picture != picture2)
-        *picture = *picture2;
-    *bufp = buf;
-}
-
-/* we begin to correct av delay at this threshold */
-#define AV_DELAY_MAX 0.100
-
-static void do_subtitle_out(AVFormatContext *s,
-                            AVOutputStream *ost,
-                            AVInputStream *ist,
-                            AVSubtitle *sub,
-                            int64_t pts)
-{
-    static uint8_t *subtitle_out = NULL;
-    int subtitle_out_max_size = 1024 * 1024;
-    int subtitle_out_size, nb, i;
-    AVCodecContext *enc;
-    AVPacket pkt;
-
-    if (pts == AV_NOPTS_VALUE) {
-        fprintf(stderr, "Subtitle packets must have a pts\n");
-        if (exit_on_error)
-            av_exit(1);
-        return;
-    }
-
-    enc = ost->st->codec;
-
-    if (!subtitle_out) {
-        subtitle_out = av_malloc(subtitle_out_max_size);
-    }
-
-    /* Note: DVB subtitle need one packet to draw them and one other
-       packet to clear them */
-    /* XXX: signal it in the codec context ? */
-    if (enc->codec_id == CODEC_ID_DVB_SUBTITLE)
-        nb = 2;
-    else
-        nb = 1;
-
-    for(i = 0; i < nb; i++) {
-        sub->pts = av_rescale_q(pts, ist->st->time_base, AV_TIME_BASE_Q);
-        // start_display_time is required to be 0
-        sub->pts              += av_rescale_q(sub->start_display_time, (AVRational){1, 1000}, AV_TIME_BASE_Q);
-        sub->end_display_time -= sub->start_display_time;
-        sub->start_display_time = 0;
-        subtitle_out_size = avcodec_encode_subtitle(enc, subtitle_out,
-                                                    subtitle_out_max_size, sub);
-        if (subtitle_out_size < 0) {
-            fprintf(stderr, "Subtitle encoding failed\n");
-            av_exit(1);
-        }
-
-        av_init_packet(&pkt);
-        pkt.stream_index = ost->index;
-        pkt.data = subtitle_out;
-        pkt.size = subtitle_out_size;
-        pkt.pts = av_rescale_q(sub->pts, AV_TIME_BASE_Q, ost->st->time_base);
-        if (enc->codec_id == CODEC_ID_DVB_SUBTITLE) {
-            /* XXX: the pts correction is handled here. Maybe handling
-               it in the codec would be better */
-            if (i == 0)
-                pkt.pts += 90 * sub->start_display_time;
-            else
-                pkt.pts += 90 * sub->end_display_time;
-        }
-        write_frame(s, &pkt, ost->st->codec, bitstream_filters[ost->file_index][pkt.stream_index]);
-    }
-}
-
-static int bit_buffer_size= 1024*256;
-static uint8_t *bit_buffer= NULL;
-
-static void do_video_out(AVFormatContext *s,
-                         AVOutputStream *ost,
-                         AVInputStream *ist,
-                         AVFrame *in_picture,
-                         int *frame_size)
-{
-    int nb_frames, i, ret;
-    int64_t topBand, bottomBand, leftBand, rightBand;
-    AVFrame *final_picture, *formatted_picture, *resampling_dst, *padding_src;
-    AVFrame picture_crop_temp, picture_pad_temp;
-    AVCodecContext *enc, *dec;
-    double sync_ipts;
-
-    avcodec_get_frame_defaults(&picture_crop_temp);
-    avcodec_get_frame_defaults(&picture_pad_temp);
-
-    enc = ost->st->codec;
-    dec = ist->st->codec;
-
-    sync_ipts = get_sync_ipts(ost) / av_q2d(enc->time_base);
-
-    /* by default, we output a single frame */
-    nb_frames = 1;
-
-    *frame_size = 0;
-
-    if(video_sync_method){
-        double vdelta = sync_ipts - ost->sync_opts;
-        //FIXME set to 0.5 after we fix some dts/pts bugs like in avidec.c
-        if (vdelta < -1.1)
-            nb_frames = 0;
-        else if (video_sync_method == 2 || (video_sync_method<0 && (s->oformat->flags & AVFMT_VARIABLE_FPS))){
-            if(vdelta<=-0.6){
-                nb_frames=0;
-            }else if(vdelta>0.6)
-            ost->sync_opts= lrintf(sync_ipts);
-        }else if (vdelta > 1.1)
-            nb_frames = lrintf(vdelta);
-//fprintf(stderr, "vdelta:%f, ost->sync_opts:%"PRId64", ost->sync_ipts:%f nb_frames:%d\n", vdelta, ost->sync_opts, get_sync_ipts(ost), nb_frames);
-        if (nb_frames == 0){
-            ++nb_frames_drop;
-            if (verbose>2)
-                fprintf(stderr, "*** drop!\n");
-        }else if (nb_frames > 1) {
-            nb_frames_dup += nb_frames - 1;
-            if (verbose>2)
-                fprintf(stderr, "*** %d dup!\n", nb_frames-1);
-        }
-    }else
-        ost->sync_opts= lrintf(sync_ipts);
-
-    nb_frames= FFMIN(nb_frames, max_frames[AVMEDIA_TYPE_VIDEO] - ost->frame_number);
-    if (nb_frames <= 0)
-        return;
-
-    if (ost->video_crop) {
-        if (av_picture_crop((AVPicture *)&picture_crop_temp, (AVPicture *)in_picture, dec->pix_fmt, ost->topBand, ost->leftBand) < 0) {
-            fprintf(stderr, "error cropping picture\n");
-            if (exit_on_error)
-                av_exit(1);
-            return;
-        }
-        formatted_picture = &picture_crop_temp;
-    } else {
-        formatted_picture = in_picture;
-    }
-
-    final_picture = formatted_picture;
-    padding_src = formatted_picture;
-    resampling_dst = &ost->pict_tmp;
-    if (ost->video_pad) {
-        final_picture = &ost->pict_tmp;
-        if (ost->video_resample) {
-            if (av_picture_crop((AVPicture *)&picture_pad_temp, (AVPicture *)final_picture, enc->pix_fmt, ost->padtop, ost->padleft) < 0) {
-                fprintf(stderr, "error padding picture\n");
-                if (exit_on_error)
-                    av_exit(1);
-                return;
-            }
-            resampling_dst = &picture_pad_temp;
-        }
-    }
-
-    if(    (ost->resample_height != (ist->st->codec->height - (ost->topBand  + ost->bottomBand)))
-        || (ost->resample_width  != (ist->st->codec->width  - (ost->leftBand + ost->rightBand)))
-        || (ost->resample_pix_fmt!= ist->st->codec->pix_fmt) ) {
-
-        fprintf(stderr,"Input Stream #%d.%d frame size changed to %dx%d, %s\n", ist->file_index, ist->index, ist->st->codec->width,     ist->st->codec->height,avcodec_get_pix_fmt_name(ist->st->codec->pix_fmt));
-        if(!ost->video_resample)
-            av_exit(1);
-    }
-
-    if (ost->video_resample) {
-        padding_src = NULL;
-        final_picture = &ost->pict_tmp;
-        if(  (ost->resample_height != (ist->st->codec->height - (ost->topBand  + ost->bottomBand)))
-          || (ost->resample_width  != (ist->st->codec->width  - (ost->leftBand + ost->rightBand)))
-          || (ost->resample_pix_fmt!= ist->st->codec->pix_fmt) ) {
-
-            /* keep bands proportional to the frame size */
-            topBand    = ((int64_t)ist->st->codec->height * ost->original_topBand    / ost->original_height) & ~1;
-            bottomBand = ((int64_t)ist->st->codec->height * ost->original_bottomBand / ost->original_height) & ~1;
-            leftBand   = ((int64_t)ist->st->codec->width  * ost->original_leftBand   / ost->original_width)  & ~1;
-            rightBand  = ((int64_t)ist->st->codec->width  * ost->original_rightBand  / ost->original_width)  & ~1;
-
-            /* sanity check to ensure no bad band sizes sneak in */
-            assert(topBand    <= INT_MAX && topBand    >= 0);
-            assert(bottomBand <= INT_MAX && bottomBand >= 0);
-            assert(leftBand   <= INT_MAX && leftBand   >= 0);
-            assert(rightBand  <= INT_MAX && rightBand  >= 0);
-
-            ost->topBand    = topBand;
-            ost->bottomBand = bottomBand;
-            ost->leftBand   = leftBand;
-            ost->rightBand  = rightBand;
-
-            ost->resample_height = ist->st->codec->height - (ost->topBand  + ost->bottomBand);
-            ost->resample_width  = ist->st->codec->width  - (ost->leftBand + ost->rightBand);
-            ost->resample_pix_fmt= ist->st->codec->pix_fmt;
-
-            /* initialize a new scaler context */
-            sws_freeContext(ost->img_resample_ctx);
-            sws_flags = av_get_int(sws_opts, "sws_flags", NULL);
-            ost->img_resample_ctx = sws_getContext(
-                ist->st->codec->width  - (ost->leftBand + ost->rightBand),
-                ist->st->codec->height - (ost->topBand  + ost->bottomBand),
-                ist->st->codec->pix_fmt,
-                ost->st->codec->width  - (ost->padleft  + ost->padright),
-                ost->st->codec->height - (ost->padtop   + ost->padbottom),
-                ost->st->codec->pix_fmt,
-                sws_flags, NULL, NULL, NULL);
-            if (ost->img_resample_ctx == NULL) {
-                fprintf(stderr, "Cannot get resampling context\n");
-                av_exit(1);
-            }
-        }
-        sws_scale(ost->img_resample_ctx, formatted_picture->data, formatted_picture->linesize,
-              0, ost->resample_height, resampling_dst->data, resampling_dst->linesize);
-    }
-
-    if (ost->video_pad) {
-        av_picture_pad((AVPicture*)final_picture, (AVPicture *)padding_src,
-                enc->height, enc->width, enc->pix_fmt,
-                ost->padtop, ost->padbottom, ost->padleft, ost->padright, padcolor);
-    }
-
-    /* duplicates frame if needed */
-    for(i=0;i<nb_frames;i++) {
-        AVPacket pkt;
-        av_init_packet(&pkt);
-        pkt.stream_index= ost->index;
-
-        if (s->oformat->flags & AVFMT_RAWPICTURE) {
-            /* raw pictures are written as AVPicture structure to
-               avoid any copies. We support temorarily the older
-               method. */
-            AVFrame* old_frame = enc->coded_frame;
-            enc->coded_frame = dec->coded_frame; //FIXME/XXX remove this hack
-            pkt.data= (uint8_t *)final_picture;
-            pkt.size=  sizeof(AVPicture);
-            pkt.pts= av_rescale_q(ost->sync_opts, enc->time_base, ost->st->time_base);
-            pkt.flags |= AV_PKT_FLAG_KEY;
-
-            write_frame(s, &pkt, ost->st->codec, bitstream_filters[ost->file_index][pkt.stream_index]);
-            enc->coded_frame = old_frame;
-        } else {
-            AVFrame big_picture;
-
-            big_picture= *final_picture;
-            /* better than nothing: use input picture interlaced
-               settings */
-            big_picture.interlaced_frame = in_picture->interlaced_frame;
-            if(avcodec_opts[AVMEDIA_TYPE_VIDEO]->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME)){
-                if(top_field_first == -1)
-                    big_picture.top_field_first = in_picture->top_field_first;
-                else
-                    big_picture.top_field_first = top_field_first;
-            }
-
-            /* handles sameq here. This is not correct because it may
-               not be a global option */
-            if (same_quality) {
-                big_picture.quality = ist->st->quality;
-            }else
-                big_picture.quality = ost->st->quality;
-            if(!me_threshold)
-                big_picture.pict_type = 0;
-//            big_picture.pts = AV_NOPTS_VALUE;
-            big_picture.pts= ost->sync_opts;
-//            big_picture.pts= av_rescale(ost->sync_opts, AV_TIME_BASE*(int64_t)enc->time_base.num, enc->time_base.den);
-//av_log(NULL, AV_LOG_DEBUG, "%"PRId64" -> encoder\n", ost->sync_opts);
-            ret = avcodec_encode_video(enc,
-                                       bit_buffer, bit_buffer_size,
-                                       &big_picture);
-            if (ret < 0) {
-                fprintf(stderr, "Video encoding failed\n");
-                av_exit(1);
-            }
-
-            if(ret>0){
-                pkt.data= bit_buffer;
-                pkt.size= ret;
-                if(enc->coded_frame->pts != AV_NOPTS_VALUE)
-                    pkt.pts= av_rescale_q(enc->coded_frame->pts, enc->time_base, ost->st->time_base);
-/*av_log(NULL, AV_LOG_DEBUG, "encoder -> %"PRId64"/%"PRId64"\n",
-   pkt.pts != AV_NOPTS_VALUE ? av_rescale(pkt.pts, enc->time_base.den, AV_TIME_BASE*(int64_t)enc->time_base.num) : -1,
-   pkt.dts != AV_NOPTS_VALUE ? av_rescale(pkt.dts, enc->time_base.den, AV_TIME_BASE*(int64_t)enc->time_base.num) : -1);*/
-
-                if(enc->coded_frame->key_frame)
-                    pkt.flags |= AV_PKT_FLAG_KEY;
-                write_frame(s, &pkt, ost->st->codec, bitstream_filters[ost->file_index][pkt.stream_index]);
-                *frame_size = ret;
-                video_size += ret;
-                //fprintf(stderr,"\nFrame: %3d size: %5d type: %d",
-                //        enc->frame_number-1, ret, enc->pict_type);
-                /* if two pass, output log */
-                if (ost->logfile && enc->stats_out) {
-                    fprintf(ost->logfile, "%s", enc->stats_out);
-                }
-            }
-        }
-        ost->sync_opts++;
-        ost->frame_number++;
-    }
-}
-
-static double psnr(double d){
-    return -10.0*log(d)/log(10.0);
-}
-
-static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
-                           int frame_size)
-{
-    AVCodecContext *enc;
-    int frame_number;
-    double ti1, bitrate, avg_bitrate;
-
-    /* this is executed just the first time do_video_stats is called */
-    if (!vstats_file) {
-        vstats_file = fopen(vstats_filename, "w");
-        if (!vstats_file) {
-            perror("fopen");
-            av_exit(1);
-        }
-    }
-
-    enc = ost->st->codec;
-    if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
-        frame_number = ost->frame_number;
-        fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA);
-        if (enc->flags&CODEC_FLAG_PSNR)
-            fprintf(vstats_file, "PSNR= %6.2f ", psnr(enc->coded_frame->error[0]/(enc->width*enc->height*255.0*255.0)));
-
-        fprintf(vstats_file,"f_size= %6d ", frame_size);
-        /* compute pts value */
-        ti1 = ost->sync_opts * av_q2d(enc->time_base);
-        if (ti1 < 0.01)
-            ti1 = 0.01;
-
-        bitrate = (frame_size * 8) / av_q2d(enc->time_base) / 1000.0;
-        avg_bitrate = (double)(video_size * 8) / ti1 / 1000.0;
-        fprintf(vstats_file, "s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s ",
-            (double)video_size / 1024, ti1, bitrate, avg_bitrate);
-        fprintf(vstats_file,"type= %c\n", av_get_pict_type_char(enc->coded_frame->pict_type));
-    }
-}
-
-static void print_report(AVFormatContext **output_files,
-                         AVOutputStream **ost_table, int nb_ostreams,
-                         int is_last_report)
-{
-    char buf[1024];
-    AVOutputStream *ost;
-    AVFormatContext *oc;
-    int64_t total_size;
-    AVCodecContext *enc;
-    int frame_number, vid, i;
-    double bitrate, ti1, pts;
-    static int64_t last_time = -1;
-    static int qp_histogram[52];
-
-    if (!is_last_report) {
-        int64_t cur_time;
-        /* display the report every 0.5 seconds */
-        cur_time = av_gettime();
-        if (last_time == -1) {
-            last_time = cur_time;
-            return;
-        }
-        if ((cur_time - last_time) < 500000)
-            return;
-        last_time = cur_time;
-    }
-
-
-    oc = output_files[0];
-
-    total_size = url_fsize(oc->pb);
-    if(total_size<0) // FIXME improve url_fsize() so it works with non seekable output too
-        total_size= url_ftell(oc->pb);
-
-    buf[0] = '\0';
-    ti1 = 1e10;
-    vid = 0;
-    for(i=0;i<nb_ostreams;i++) {
-        ost = ost_table[i];
-        enc = ost->st->codec;
-        if (vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) {
-            snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "q=%2.1f ",
-                     !ost->st->stream_copy ?
-                     enc->coded_frame->quality/(float)FF_QP2LAMBDA : -1);
-        }
-        if (!vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) {
-            float t = (av_gettime()-timer_start) / 1000000.0;
-
-            frame_number = ost->frame_number;
-            snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "frame=%5d fps=%3d q=%3.1f ",
-                     frame_number, (t>1)?(int)(frame_number/t+0.5) : 0,
-                     !ost->st->stream_copy ?
-                     enc->coded_frame->quality/(float)FF_QP2LAMBDA : -1);
-            if(is_last_report)
-                snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "L");
-            if(qp_hist){
-                int j;
-                int qp= lrintf(enc->coded_frame->quality/(float)FF_QP2LAMBDA);
-                if(qp>=0 && qp<FF_ARRAY_ELEMS(qp_histogram))
-                    qp_histogram[qp]++;
-                for(j=0; j<32; j++)
-                    snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%X", (int)lrintf(log(qp_histogram[j]+1)/log(2)));
-            }
-            if (enc->flags&CODEC_FLAG_PSNR){
-                int j;
-                double error, error_sum=0;
-                double scale, scale_sum=0;
-                char type[3]= {'Y','U','V'};
-                snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "PSNR=");
-                for(j=0; j<3; j++){
-                    if(is_last_report){
-                        error= enc->error[j];
-                        scale= enc->width*enc->height*255.0*255.0*frame_number;
-                    }else{
-                        error= enc->coded_frame->error[j];
-                        scale= enc->width*enc->height*255.0*255.0;
-                    }
-                    if(j) scale/=4;
-                    error_sum += error;
-                    scale_sum += scale;
-                    snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%c:%2.2f ", type[j], psnr(error/scale));
-                }
-                snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "*:%2.2f ", psnr(error_sum/scale_sum));
-            }
-            vid = 1;
-        }
-        /* compute min output value */
-        pts = (double)ost->st->pts.val * av_q2d(ost->st->time_base);
-        if ((pts < ti1) && (pts > 0))
-            ti1 = pts;
-    }
-    if (ti1 < 0.01)
-        ti1 = 0.01;
-
-    if (verbose || is_last_report) {
-        bitrate = (double)(total_size * 8) / ti1 / 1000.0;
-
-        snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
-            "size=%8.0fkB time=%0.2f bitrate=%6.1fkbits/s",
-            (double)total_size / 1024, ti1, bitrate);
-
-        if (nb_frames_dup || nb_frames_drop)
-          snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " dup=%d drop=%d",
-                  nb_frames_dup, nb_frames_drop);
-
-        if (verbose >= 0)
-            fprintf(stderr, "%s    \r", buf);
-
-        fflush(stderr);
-    }
-
-    if (is_last_report && verbose >= 0){
-        int64_t raw= audio_size + video_size + extra_size;
-        fprintf(stderr, "\n");
-        fprintf(stderr, "video:%1.0fkB audio:%1.0fkB global headers:%1.0fkB muxing overhead %f%%\n",
-                video_size/1024.0,
-                audio_size/1024.0,
-                extra_size/1024.0,
-                100.0*(total_size - raw)/raw
-        );
-    }
-}
-
-/* pkt = NULL means EOF (needed to flush decoder buffers) */
-static int output_packet(AVInputStream *ist, int ist_index,
-                         AVOutputStream **ost_table, int nb_ostreams,
-                         const AVPacket *pkt)
-{
-    AVFormatContext *os;
-    AVOutputStream *ost;
-    int ret, i;
-    int got_picture;
-    AVFrame picture;
-    void *buffer_to_free;
-    static unsigned int samples_size= 0;
-    AVSubtitle subtitle, *subtitle_to_free;
-    int got_subtitle;
-    AVPacket avpkt;
-    int bps = av_get_bits_per_sample_format(ist->st->codec->sample_fmt)>>3;
-
-    if(ist->next_pts == AV_NOPTS_VALUE)
-        ist->next_pts= ist->pts;
-
-    if (pkt == NULL) {
-        /* EOF handling */
-        av_init_packet(&avpkt);
-        avpkt.data = NULL;
-        avpkt.size = 0;
-        goto handle_eof;
-    } else {
-        avpkt = *pkt;
-    }
-
-    if(pkt->dts != AV_NOPTS_VALUE)
-        ist->next_pts = ist->pts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q);
-
-    //while we have more to decode or while the decoder did output something on EOF
-    while (avpkt.size > 0 || (!pkt && ist->next_pts != ist->pts)) {
-        uint8_t *data_buf, *decoded_data_buf;
-        int data_size, decoded_data_size;
-    handle_eof:
-        ist->pts= ist->next_pts;
-
-        if(avpkt.size && avpkt.size != pkt->size &&
-           ((!ist->showed_multi_packet_warning && verbose>0) || verbose>1)){
-            fprintf(stderr, "Multiple frames in a packet from stream %d\n", pkt->stream_index);
-            ist->showed_multi_packet_warning=1;
-        }
-
-        /* decode the packet if needed */
-        decoded_data_buf = NULL; /* fail safe */
-        decoded_data_size= 0;
-        data_buf  = avpkt.data;
-        data_size = avpkt.size;
-        subtitle_to_free = NULL;
-        if (ist->decoding_needed) {
-            switch(ist->st->codec->codec_type) {
-            case AVMEDIA_TYPE_AUDIO:{
-                if(pkt && samples_size < FFMAX(pkt->size*sizeof(*samples), AVCODEC_MAX_AUDIO_FRAME_SIZE)) {
-                    samples_size = FFMAX(pkt->size*sizeof(*samples), AVCODEC_MAX_AUDIO_FRAME_SIZE);
-                    av_free(samples);
-                    samples= av_malloc(samples_size);
-                }
-                decoded_data_size= samples_size;
-                    /* XXX: could avoid copy if PCM 16 bits with same
-                       endianness as CPU */
-                ret = avcodec_decode_audio3(ist->st->codec, samples, &decoded_data_size,
-                                            &avpkt);
-                if (ret < 0)
-                    goto fail_decode;
-                avpkt.data += ret;
-                avpkt.size -= ret;
-                data_size   = ret;
-                /* Some bug in mpeg audio decoder gives */
-                /* decoded_data_size < 0, it seems they are overflows */
-                if (decoded_data_size <= 0) {
-                    /* no audio frame */
-                    continue;
-                }
-                decoded_data_buf = (uint8_t *)samples;
-                ist->next_pts += ((int64_t)AV_TIME_BASE/bps * decoded_data_size) /
-                    (ist->st->codec->sample_rate * ist->st->codec->channels);
-                break;}
-            case AVMEDIA_TYPE_VIDEO:
-                    decoded_data_size = (ist->st->codec->width * ist->st->codec->height * 3) / 2;
-                    /* XXX: allocate picture correctly */
-                    avcodec_get_frame_defaults(&picture);
-
-                    ret = avcodec_decode_video2(ist->st->codec,
-                                                &picture, &got_picture, &avpkt);
-                    ist->st->quality= picture.quality;
-                    if (ret < 0)
-                        goto fail_decode;
-                    if (!got_picture) {
-                        /* no picture yet */
-                        goto discard_packet;
-                    }
-                    if (ist->st->codec->time_base.num != 0) {
-                        int ticks= ist->st->parser ? ist->st->parser->repeat_pict+1 : ist->st->codec->ticks_per_frame;
-                        ist->next_pts += ((int64_t)AV_TIME_BASE *
-                                          ist->st->codec->time_base.num * ticks) /
-                            ist->st->codec->time_base.den;
-                    }
-                    avpkt.size = 0;
-                    break;
-            case AVMEDIA_TYPE_SUBTITLE:
-                ret = avcodec_decode_subtitle2(ist->st->codec,
-                                               &subtitle, &got_subtitle, &avpkt);
-                if (ret < 0)
-                    goto fail_decode;
-                if (!got_subtitle) {
-                    goto discard_packet;
-                }
-                subtitle_to_free = &subtitle;
-                avpkt.size = 0;
-                break;
-            default:
-                goto fail_decode;
-            }
-        } else {
-            switch(ist->st->codec->codec_type) {
-            case AVMEDIA_TYPE_AUDIO:
-                ist->next_pts += ((int64_t)AV_TIME_BASE * ist->st->codec->frame_size) /
-                    ist->st->codec->sample_rate;
-                break;
-            case AVMEDIA_TYPE_VIDEO:
-                if (ist->st->codec->time_base.num != 0) {
-                    int ticks= ist->st->parser ? ist->st->parser->repeat_pict+1 : ist->st->codec->ticks_per_frame;
-                    ist->next_pts += ((int64_t)AV_TIME_BASE *
-                                      ist->st->codec->time_base.num * ticks) /
-                        ist->st->codec->time_base.den;
-                }
-                break;
-            }
-            ret = avpkt.size;
-            avpkt.size = 0;
-        }
-
-        buffer_to_free = NULL;
-        if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-            pre_process_video_frame(ist, (AVPicture *)&picture,
-                                    &buffer_to_free);
-        }
-
-        // preprocess audio (volume)
-        if (ist->st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            if (audio_volume != 256) {
-                short *volp;
-                volp = samples;
-                for(i=0;i<(decoded_data_size / sizeof(short));i++) {
-                    int v = ((*volp) * audio_volume + 128) >> 8;
-                    if (v < -32768) v = -32768;
-                    if (v >  32767) v = 32767;
-                    *volp++ = v;
-                }
-            }
-        }
-
-        /* frame rate emulation */
-        if (rate_emu) {
-            int64_t pts = av_rescale(ist->pts, 1000000, AV_TIME_BASE);
-            int64_t now = av_gettime() - ist->start;
-            if (pts > now)
-                usleep(pts - now);
-        }
-
-        /* if output time reached then transcode raw format,
-           encode packets and output them */
-        if (start_time == 0 || ist->pts >= start_time)
-            for(i=0;i<nb_ostreams;i++) {
-                int frame_size;
-
-                ost = ost_table[i];
-                if (ost->source_index == ist_index) {
-                    os = output_files[ost->file_index];
-
-                    /* set the input output pts pairs */
-                    //ost->sync_ipts = (double)(ist->pts + input_files_ts_offset[ist->file_index] - start_time)/ AV_TIME_BASE;
-
-                    if (ost->encoding_needed) {
-                        assert(ist->decoding_needed);
-                        switch(ost->st->codec->codec_type) {
-                        case AVMEDIA_TYPE_AUDIO:
-                            do_audio_out(os, ost, ist, decoded_data_buf, decoded_data_size);
-                            break;
-                        case AVMEDIA_TYPE_VIDEO:
-                            do_video_out(os, ost, ist, &picture, &frame_size);
-                            if (vstats_filename && frame_size)
-                                do_video_stats(os, ost, frame_size);
-                            break;
-                        case AVMEDIA_TYPE_SUBTITLE:
-                            do_subtitle_out(os, ost, ist, &subtitle,
-                                            pkt->pts);
-                            break;
-                        default:
-                            abort();
-                        }
-                    } else {
-                        AVFrame avframe; //FIXME/XXX remove this
-                        AVPacket opkt;
-                        int64_t ost_tb_start_time= av_rescale_q(start_time, AV_TIME_BASE_Q, ost->st->time_base);
-
-                        av_init_packet(&opkt);
-
-                        if ((!ost->frame_number && !(pkt->flags & AV_PKT_FLAG_KEY)) && !copy_initial_nonkeyframes)
-                            continue;
-
-                        /* no reencoding needed : output the packet directly */
-                        /* force the input stream PTS */
-
-                        avcodec_get_frame_defaults(&avframe);
-                        ost->st->codec->coded_frame= &avframe;
-                        avframe.key_frame = pkt->flags & AV_PKT_FLAG_KEY;
-
-                        if(ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
-                            audio_size += data_size;
-                        else if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-                            video_size += data_size;
-                            ost->sync_opts++;
-                        }
-
-                        opkt.stream_index= ost->index;
-                        if(pkt->pts != AV_NOPTS_VALUE)
-                            opkt.pts= av_rescale_q(pkt->pts, ist->st->time_base, ost->st->time_base) - ost_tb_start_time;
-                        else
-                            opkt.pts= AV_NOPTS_VALUE;
-
-                        if (pkt->dts == AV_NOPTS_VALUE)
-                            opkt.dts = av_rescale_q(ist->pts, AV_TIME_BASE_Q, ost->st->time_base);
-                        else
-                            opkt.dts = av_rescale_q(pkt->dts, ist->st->time_base, ost->st->time_base);
-                        opkt.dts -= ost_tb_start_time;
-
-                        opkt.duration = av_rescale_q(pkt->duration, ist->st->time_base, ost->st->time_base);
-                        opkt.flags= pkt->flags;
-
-                        //FIXME remove the following 2 lines they shall be replaced by the bitstream filters
-                        if(   ost->st->codec->codec_id != CODEC_ID_H264
-                           && ost->st->codec->codec_id != CODEC_ID_MPEG1VIDEO
-                           && ost->st->codec->codec_id != CODEC_ID_MPEG2VIDEO
-                           ) {
-                            if(av_parser_change(ist->st->parser, ost->st->codec, &opkt.data, &opkt.size, data_buf, data_size, pkt->flags & AV_PKT_FLAG_KEY))
-                                opkt.destruct= av_destruct_packet;
-                        } else {
-                            opkt.data = data_buf;
-                            opkt.size = data_size;
-                        }
-
-                        write_frame(os, &opkt, ost->st->codec, bitstream_filters[ost->file_index][opkt.stream_index]);
-                        ost->st->codec->frame_number++;
-                        ost->frame_number++;
-                        av_free_packet(&opkt);
-                    }
-                }
-            }
-        av_free(buffer_to_free);
-        /* XXX: allocate the subtitles in the codec ? */
-        if (subtitle_to_free) {
-            if (subtitle_to_free->rects != NULL) {
-                for (i = 0; i < subtitle_to_free->num_rects; i++) {
-                    av_freep(&subtitle_to_free->rects[i]->pict.data[0]);
-                    av_freep(&subtitle_to_free->rects[i]->pict.data[1]);
-                    av_freep(&subtitle_to_free->rects[i]);
-                }
-                av_freep(&subtitle_to_free->rects);
-            }
-            subtitle_to_free->num_rects = 0;
-            subtitle_to_free = NULL;
-        }
-    }
- discard_packet:
-    if (pkt == NULL) {
-        /* EOF handling */
-
-        for(i=0;i<nb_ostreams;i++) {
-            ost = ost_table[i];
-            if (ost->source_index == ist_index) {
-                AVCodecContext *enc= ost->st->codec;
-                os = output_files[ost->file_index];
-
-                if(ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO && enc->frame_size <=1)
-                    continue;
-                if(ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (os->oformat->flags & AVFMT_RAWPICTURE))
-                    continue;
-
-                if (ost->encoding_needed) {
-                    for(;;) {
-                        AVPacket pkt;
-                        int fifo_bytes;
-                        av_init_packet(&pkt);
-                        pkt.stream_index= ost->index;
-
-                        switch(ost->st->codec->codec_type) {
-                        case AVMEDIA_TYPE_AUDIO:
-                            fifo_bytes = av_fifo_size(ost->fifo);
-                            ret = 0;
-                            /* encode any samples remaining in fifo */
-                            if (fifo_bytes > 0) {
-                                int osize = av_get_bits_per_sample_format(enc->sample_fmt) >> 3;
-                                int fs_tmp = enc->frame_size;
-
-                                av_fifo_generic_read(ost->fifo, samples, fifo_bytes, NULL);
-                                if (enc->codec->capabilities & CODEC_CAP_SMALL_LAST_FRAME) {
-                                    enc->frame_size = fifo_bytes / (osize * enc->channels);
-                                } else { /* pad */
-                                    int frame_bytes = enc->frame_size*osize*enc->channels;
-                                    if (samples_size < frame_bytes)
-                                        av_exit(1);
-                                    memset((uint8_t*)samples+fifo_bytes, 0, frame_bytes - fifo_bytes);
-                                }
-
-                                ret = avcodec_encode_audio(enc, bit_buffer, bit_buffer_size, samples);
-                                pkt.duration = av_rescale((int64_t)enc->frame_size*ost->st->time_base.den,
-                                                          ost->st->time_base.num, enc->sample_rate);
-                                enc->frame_size = fs_tmp;
-                            }
-                            if(ret <= 0) {
-                                ret = avcodec_encode_audio(enc, bit_buffer, bit_buffer_size, NULL);
-                            }
-                            if (ret < 0) {
-                                fprintf(stderr, "Audio encoding failed\n");
-                                av_exit(1);
-                            }
-                            audio_size += ret;
-                            pkt.flags |= AV_PKT_FLAG_KEY;
-                            break;
-                        case AVMEDIA_TYPE_VIDEO:
-                            ret = avcodec_encode_video(enc, bit_buffer, bit_buffer_size, NULL);
-                            if (ret < 0) {
-                                fprintf(stderr, "Video encoding failed\n");
-                                av_exit(1);
-                            }
-                            video_size += ret;
-                            if(enc->coded_frame && enc->coded_frame->key_frame)
-                                pkt.flags |= AV_PKT_FLAG_KEY;
-                            if (ost->logfile && enc->stats_out) {
-                                fprintf(ost->logfile, "%s", enc->stats_out);
-                            }
-                            break;
-                        default:
-                            ret=-1;
-                        }
-
-                        if(ret<=0)
-                            break;
-                        pkt.data= bit_buffer;
-                        pkt.size= ret;
-                        if(enc->coded_frame && enc->coded_frame->pts != AV_NOPTS_VALUE)
-                            pkt.pts= av_rescale_q(enc->coded_frame->pts, enc->time_base, ost->st->time_base);
-                        write_frame(os, &pkt, ost->st->codec, bitstream_filters[ost->file_index][pkt.stream_index]);
-                    }
-                }
-            }
-        }
-    }
-
-    return 0;
- fail_decode:
-    return -1;
-}
-
-static void print_sdp(AVFormatContext **avc, int n)
-{
-    char sdp[2048];
-
-    avf_sdp_create(avc, n, sdp, sizeof(sdp));
-    printf("SDP:\n%s\n", sdp);
-    fflush(stdout);
-}
-
-static int copy_chapters(int infile, int outfile)
-{
-    AVFormatContext *is = input_files[infile];
-    AVFormatContext *os = output_files[outfile];
-    int i;
-
-    for (i = 0; i < is->nb_chapters; i++) {
-        AVChapter *in_ch = is->chapters[i], *out_ch;
-        AVMetadataTag *t = NULL;
-        int64_t ts_off   = av_rescale_q(start_time - input_files_ts_offset[infile],
-                                      AV_TIME_BASE_Q, in_ch->time_base);
-        int64_t rt       = (recording_time == INT64_MAX) ? INT64_MAX :
-                           av_rescale_q(recording_time, AV_TIME_BASE_Q, in_ch->time_base);
-
-
-        if (in_ch->end < ts_off)
-            continue;
-        if (rt != INT64_MAX && in_ch->start > rt + ts_off)
-            break;
-
-        out_ch = av_mallocz(sizeof(AVChapter));
-        if (!out_ch)
-            return AVERROR(ENOMEM);
-
-        out_ch->id        = in_ch->id;
-        out_ch->time_base = in_ch->time_base;
-        out_ch->start     = FFMAX(0,  in_ch->start - ts_off);
-        out_ch->end       = FFMIN(rt, in_ch->end   - ts_off);
-
-        while ((t = av_metadata_get(in_ch->metadata, "", t, AV_METADATA_IGNORE_SUFFIX)))
-            av_metadata_set2(&out_ch->metadata, t->key, t->value, 0);
-
-        os->nb_chapters++;
-        os->chapters = av_realloc(os->chapters, sizeof(AVChapter)*os->nb_chapters);
-        if (!os->chapters)
-            return AVERROR(ENOMEM);
-        os->chapters[os->nb_chapters - 1] = out_ch;
-    }
-    return 0;
-}
-
-/*
- * The following code is the main loop of the file converter
- */
-static int av_transcode(AVFormatContext **output_files,
-                        int nb_output_files,
-                        AVFormatContext **input_files,
-                        int nb_input_files,
-                        AVStreamMap *stream_maps, int nb_stream_maps)
-{
-    int ret = 0, i, j, k, n, nb_istreams = 0, nb_ostreams = 0;
-    AVFormatContext *is, *os;
-    AVCodecContext *codec, *icodec;
-    AVOutputStream *ost, **ost_table = NULL;
-    AVInputStream *ist, **ist_table = NULL;
-    AVInputFile *file_table;
-    char error[1024];
-    int key;
-    int want_sdp = 1;
-    uint8_t no_packet[MAX_FILES]={0};
-    int no_packet_count=0;
-
-    file_table= av_mallocz(nb_input_files * sizeof(AVInputFile));
-    if (!file_table)
-        goto fail;
-
-    /* input stream init */
-    j = 0;
-    for(i=0;i<nb_input_files;i++) {
-        is = input_files[i];
-        file_table[i].ist_index = j;
-        file_table[i].nb_streams = is->nb_streams;
-        j += is->nb_streams;
-    }
-    nb_istreams = j;
-
-    ist_table = av_mallocz(nb_istreams * sizeof(AVInputStream *));
-    if (!ist_table)
-        goto fail;
-
-    for(i=0;i<nb_istreams;i++) {
-        ist = av_mallocz(sizeof(AVInputStream));
-        if (!ist)
-            goto fail;
-        ist_table[i] = ist;
-    }
-    j = 0;
-    for(i=0;i<nb_input_files;i++) {
-        is = input_files[i];
-        for(k=0;k<is->nb_streams;k++) {
-            ist = ist_table[j++];
-            ist->st = is->streams[k];
-            ist->file_index = i;
-            ist->index = k;
-            ist->discard = 1; /* the stream is discarded by default
-                                 (changed later) */
-
-            if (rate_emu) {
-                ist->start = av_gettime();
-            }
-        }
-    }
-
-    /* output stream init */
-    nb_ostreams = 0;
-    for(i=0;i<nb_output_files;i++) {
-        os = output_files[i];
-        if (!os->nb_streams) {
-            dump_format(output_files[i], i, output_files[i]->filename, 1);
-            fprintf(stderr, "Output file #%d does not contain any stream\n", i);
-            av_exit(1);
-        }
-        nb_ostreams += os->nb_streams;
-    }
-    if (nb_stream_maps > 0 && nb_stream_maps != nb_ostreams) {
-        fprintf(stderr, "Number of stream maps must match number of output streams\n");
-        av_exit(1);
-    }
-
-    /* Sanity check the mapping args -- do the input files & streams exist? */
-    for(i=0;i<nb_stream_maps;i++) {
-        int fi = stream_maps[i].file_index;
-        int si = stream_maps[i].stream_index;
-
-        if (fi < 0 || fi > nb_input_files - 1 ||
-            si < 0 || si > file_table[fi].nb_streams - 1) {
-            fprintf(stderr,"Could not find input stream #%d.%d\n", fi, si);
-            av_exit(1);
-        }
-        fi = stream_maps[i].sync_file_index;
-        si = stream_maps[i].sync_stream_index;
-        if (fi < 0 || fi > nb_input_files - 1 ||
-            si < 0 || si > file_table[fi].nb_streams - 1) {
-            fprintf(stderr,"Could not find sync stream #%d.%d\n", fi, si);
-            av_exit(1);
-        }
-    }
-
-    ost_table = av_mallocz(sizeof(AVOutputStream *) * nb_ostreams);
-    if (!ost_table)
-        goto fail;
-    for(i=0;i<nb_ostreams;i++) {
-        ost = av_mallocz(sizeof(AVOutputStream));
-        if (!ost)
-            goto fail;
-        ost_table[i] = ost;
-    }
-
-    n = 0;
-    for(k=0;k<nb_output_files;k++) {
-        os = output_files[k];
-        for(i=0;i<os->nb_streams;i++,n++) {
-            int found;
-            ost = ost_table[n];
-            ost->file_index = k;
-            ost->index = i;
-            ost->st = os->streams[i];
-            if (nb_stream_maps > 0) {
-                ost->source_index = file_table[stream_maps[n].file_index].ist_index +
-                    stream_maps[n].stream_index;
-
-                /* Sanity check that the stream types match */
-                if (ist_table[ost->source_index]->st->codec->codec_type != ost->st->codec->codec_type) {
-                    int i= ost->file_index;
-                    dump_format(output_files[i], i, output_files[i]->filename, 1);
-                    fprintf(stderr, "Codec type mismatch for mapping #%d.%d -> #%d.%d\n",
-                        stream_maps[n].file_index, stream_maps[n].stream_index,
-                        ost->file_index, ost->index);
-                    av_exit(1);
-                }
-
-            } else {
-                int best_nb_frames=-1;
-                    /* get corresponding input stream index : we select the first one with the right type */
-                    found = 0;
-                    for(j=0;j<nb_istreams;j++) {
-                        int skip=0;
-                        ist = ist_table[j];
-                        if(opt_programid){
-                            int pi,si;
-                            AVFormatContext *f= input_files[ ist->file_index ];
-                            skip=1;
-                            for(pi=0; pi<f->nb_programs; pi++){
-                                AVProgram *p= f->programs[pi];
-                                if(p->id == opt_programid)
-                                    for(si=0; si<p->nb_stream_indexes; si++){
-                                        if(f->streams[ p->stream_index[si] ] == ist->st)
-                                            skip=0;
-                                    }
-                            }
-                        }
-                        if (ist->discard && ist->st->discard != AVDISCARD_ALL && !skip &&
-                            ist->st->codec->codec_type == ost->st->codec->codec_type) {
-                            if(best_nb_frames < ist->st->codec_info_nb_frames){
-                                best_nb_frames= ist->st->codec_info_nb_frames;
-                                ost->source_index = j;
-                                found = 1;
-                            }
-                        }
-                    }
-
-                if (!found) {
-                    if(! opt_programid) {
-                        /* try again and reuse existing stream */
-                        for(j=0;j<nb_istreams;j++) {
-                            ist = ist_table[j];
-                            if (   ist->st->codec->codec_type == ost->st->codec->codec_type
-                                && ist->st->discard != AVDISCARD_ALL) {
-                                ost->source_index = j;
-                                found = 1;
-                            }
-                        }
-                    }
-                    if (!found) {
-                        int i= ost->file_index;
-                        dump_format(output_files[i], i, output_files[i]->filename, 1);
-                        fprintf(stderr, "Could not find input stream matching output stream #%d.%d\n",
-                                ost->file_index, ost->index);
-                        av_exit(1);
-                    }
-                }
-            }
-            ist = ist_table[ost->source_index];
-            ist->discard = 0;
-            ost->sync_ist = (nb_stream_maps > 0) ?
-                ist_table[file_table[stream_maps[n].sync_file_index].ist_index +
-                         stream_maps[n].sync_stream_index] : ist;
-        }
-    }
-
-    /* for each output stream, we compute the right encoding parameters */
-    for(i=0;i<nb_ostreams;i++) {
-        AVMetadataTag *t = NULL;
-        ost = ost_table[i];
-        os = output_files[ost->file_index];
-        ist = ist_table[ost->source_index];
-
-        codec = ost->st->codec;
-        icodec = ist->st->codec;
-
-        while ((t = av_metadata_get(ist->st->metadata, "", t, AV_METADATA_IGNORE_SUFFIX))) {
-            av_metadata_set2(&ost->st->metadata, t->key, t->value, AV_METADATA_DONT_OVERWRITE);
-        }
-
-        ost->st->disposition = ist->st->disposition;
-        codec->bits_per_raw_sample= icodec->bits_per_raw_sample;
-        codec->chroma_sample_location = icodec->chroma_sample_location;
-
-        if (ost->st->stream_copy) {
-            /* if stream_copy is selected, no need to decode or encode */
-            codec->codec_id = icodec->codec_id;
-            codec->codec_type = icodec->codec_type;
-
-            if(!codec->codec_tag){
-                if(   !os->oformat->codec_tag
-                   || av_codec_get_id (os->oformat->codec_tag, icodec->codec_tag) == codec->codec_id
-                   || av_codec_get_tag(os->oformat->codec_tag, icodec->codec_id) <= 0)
-                    codec->codec_tag = icodec->codec_tag;
-            }
-
-            codec->bit_rate = icodec->bit_rate;
-            codec->extradata= icodec->extradata;
-            codec->extradata_size= icodec->extradata_size;
-            if(av_q2d(icodec->time_base)*icodec->ticks_per_frame > av_q2d(ist->st->time_base) && av_q2d(ist->st->time_base) < 1.0/1000){
-                codec->time_base = icodec->time_base;
-                codec->time_base.num *= icodec->ticks_per_frame;
-            }else
-                codec->time_base = ist->st->time_base;
-            switch(codec->codec_type) {
-            case AVMEDIA_TYPE_AUDIO:
-                if(audio_volume != 256) {
-                    fprintf(stderr,"-acodec copy and -vol are incompatible (frames are not decoded)\n");
-                    av_exit(1);
-                }
-                codec->channel_layout = icodec->channel_layout;
-                codec->sample_rate = icodec->sample_rate;
-                codec->channels = icodec->channels;
-                codec->frame_size = icodec->frame_size;
-                codec->block_align= icodec->block_align;
-                if(codec->block_align == 1 && codec->codec_id == CODEC_ID_MP3)
-                    codec->block_align= 0;
-                if(codec->codec_id == CODEC_ID_AC3)
-                    codec->block_align= 0;
-                break;
-            case AVMEDIA_TYPE_VIDEO:
-                codec->pix_fmt = icodec->pix_fmt;
-                codec->width = icodec->width;
-                codec->height = icodec->height;
-                codec->has_b_frames = icodec->has_b_frames;
-                break;
-            case AVMEDIA_TYPE_SUBTITLE:
-                codec->width = icodec->width;
-                codec->height = icodec->height;
-                break;
-            default:
-                abort();
-            }
-        } else {
-            switch(codec->codec_type) {
-            case AVMEDIA_TYPE_AUDIO:
-                ost->fifo= av_fifo_alloc(1024);
-                if(!ost->fifo)
-                    goto fail;
-                ost->reformat_pair = MAKE_SFMT_PAIR(SAMPLE_FMT_NONE,SAMPLE_FMT_NONE);
-                ost->audio_resample = codec->sample_rate != icodec->sample_rate || audio_sync_method > 1;
-                icodec->request_channels = codec->channels;
-                ist->decoding_needed = 1;
-                ost->encoding_needed = 1;
-                break;
-            case AVMEDIA_TYPE_VIDEO:
-                if (ost->st->codec->pix_fmt == PIX_FMT_NONE) {
-                    fprintf(stderr, "Video pixel format is unknown, stream cannot be encoded\n");
-                    av_exit(1);
-                }
-                ost->video_crop = ((frame_leftBand + frame_rightBand + frame_topBand + frame_bottomBand) != 0);
-                ost->video_pad = ((frame_padleft + frame_padright + frame_padtop + frame_padbottom) != 0);
-                ost->video_resample = ((codec->width != icodec->width -
-                                (frame_leftBand + frame_rightBand) +
-                                (frame_padleft + frame_padright)) ||
-                        (codec->height != icodec->height -
-                                (frame_topBand  + frame_bottomBand) +
-                                (frame_padtop + frame_padbottom)) ||
-                        (codec->pix_fmt != icodec->pix_fmt));
-                if (ost->video_crop) {
-                    ost->topBand    = ost->original_topBand    = frame_topBand;
-                    ost->bottomBand = ost->original_bottomBand = frame_bottomBand;
-                    ost->leftBand   = ost->original_leftBand   = frame_leftBand;
-                    ost->rightBand  = ost->original_rightBand  = frame_rightBand;
-                }
-                if (ost->video_pad) {
-                    ost->padtop = frame_padtop;
-                    ost->padleft = frame_padleft;
-                    ost->padbottom = frame_padbottom;
-                    ost->padright = frame_padright;
-                    if (!ost->video_resample) {
-                        avcodec_get_frame_defaults(&ost->pict_tmp);
-                        if(avpicture_alloc((AVPicture*)&ost->pict_tmp, codec->pix_fmt,
-                                         codec->width, codec->height))
-                            goto fail;
-                    }
-                }
-                if (ost->video_resample) {
-                    avcodec_get_frame_defaults(&ost->pict_tmp);
-                    if(avpicture_alloc((AVPicture*)&ost->pict_tmp, codec->pix_fmt,
-                                         codec->width, codec->height)) {
-                        fprintf(stderr, "Cannot allocate temp picture, check pix fmt\n");
-                        av_exit(1);
-                    }
-                    sws_flags = av_get_int(sws_opts, "sws_flags", NULL);
-                    ost->img_resample_ctx = sws_getContext(
-                            icodec->width - (frame_leftBand + frame_rightBand),
-                            icodec->height - (frame_topBand + frame_bottomBand),
-                            icodec->pix_fmt,
-                            codec->width - (frame_padleft + frame_padright),
-                            codec->height - (frame_padtop + frame_padbottom),
-                            codec->pix_fmt,
-                            sws_flags, NULL, NULL, NULL);
-                    if (ost->img_resample_ctx == NULL) {
-                        fprintf(stderr, "Cannot get resampling context\n");
-                        av_exit(1);
-                    }
-
-                    ost->original_height = icodec->height;
-                    ost->original_width  = icodec->width;
-
-                    codec->bits_per_raw_sample= 0;
-                }
-                ost->resample_height = icodec->height - (frame_topBand  + frame_bottomBand);
-                ost->resample_width  = icodec->width  - (frame_leftBand + frame_rightBand);
-                ost->resample_pix_fmt= icodec->pix_fmt;
-                ost->encoding_needed = 1;
-                ist->decoding_needed = 1;
-                break;
-            case AVMEDIA_TYPE_SUBTITLE:
-                ost->encoding_needed = 1;
-                ist->decoding_needed = 1;
-                break;
-            default:
-                abort();
-                break;
-            }
-            /* two pass mode */
-            if (ost->encoding_needed &&
-                (codec->flags & (CODEC_FLAG_PASS1 | CODEC_FLAG_PASS2))) {
-                char logfilename[1024];
-                FILE *f;
-
-                snprintf(logfilename, sizeof(logfilename), "%s-%d.log",
-                         pass_logfilename_prefix ? pass_logfilename_prefix : DEFAULT_PASS_LOGFILENAME_PREFIX,
-                         i);
-                if (codec->flags & CODEC_FLAG_PASS1) {
-                    f = fopen(logfilename, "wb");
-                    if (!f) {
-                        fprintf(stderr, "Cannot write log file '%s' for pass-1 encoding: %s\n", logfilename, strerror(errno));
-                        av_exit(1);
-                    }
-                    ost->logfile = f;
-                } else {
-                    char  *logbuffer;
-                    size_t logbuffer_size;
-                    if (read_file(logfilename, &logbuffer, &logbuffer_size) < 0) {
-                        fprintf(stderr, "Error reading log file '%s' for pass-2 encoding\n", logfilename);
-                        av_exit(1);
-                    }
-                    codec->stats_in = logbuffer;
-                }
-            }
-        }
-        if(codec->codec_type == AVMEDIA_TYPE_VIDEO){
-            int size= codec->width * codec->height;
-            bit_buffer_size= FFMAX(bit_buffer_size, 6*size + 200);
-        }
-    }
-
-    if (!bit_buffer)
-        bit_buffer = av_malloc(bit_buffer_size);
-    if (!bit_buffer) {
-        fprintf(stderr, "Cannot allocate %d bytes output buffer\n",
-                bit_buffer_size);
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    /* open each encoder */
-    for(i=0;i<nb_ostreams;i++) {
-        ost = ost_table[i];
-        if (ost->encoding_needed) {
-            AVCodec *codec = output_codecs[i];
-            if (!codec)
-                codec = avcodec_find_encoder(ost->st->codec->codec_id);
-            if (!codec) {
-                snprintf(error, sizeof(error), "Encoder (codec id %d) not found for output stream #%d.%d",
-                         ost->st->codec->codec_id, ost->file_index, ost->index);
-                ret = AVERROR(EINVAL);
-                goto dump_format;
-            }
-            if (avcodec_open(ost->st->codec, codec) < 0) {
-                snprintf(error, sizeof(error), "Error while opening encoder for output stream #%d.%d - maybe incorrect parameters such as bit_rate, rate, width or height",
-                        ost->file_index, ost->index);
-                ret = AVERROR(EINVAL);
-                goto dump_format;
-            }
-            extra_size += ost->st->codec->extradata_size;
-        }
-    }
-
-    /* open each decoder */
-    for(i=0;i<nb_istreams;i++) {
-        ist = ist_table[i];
-        if (ist->decoding_needed) {
-            AVCodec *codec = input_codecs[i];
-            if (!codec)
-                codec = avcodec_find_decoder(ist->st->codec->codec_id);
-            if (!codec) {
-                snprintf(error, sizeof(error), "Decoder (codec id %d) not found for input stream #%d.%d",
-                        ist->st->codec->codec_id, ist->file_index, ist->index);
-                ret = AVERROR(EINVAL);
-                goto dump_format;
-            }
-            if (avcodec_open(ist->st->codec, codec) < 0) {
-                snprintf(error, sizeof(error), "Error while opening decoder for input stream #%d.%d",
-                        ist->file_index, ist->index);
-                ret = AVERROR(EINVAL);
-                goto dump_format;
-            }
-            //if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
-            //    ist->st->codec->flags |= CODEC_FLAG_REPEAT_FIELD;
-        }
-    }
-
-    /* init pts */
-    for(i=0;i<nb_istreams;i++) {
-        AVStream *st;
-        ist = ist_table[i];
-        st= ist->st;
-        ist->pts = st->avg_frame_rate.num ? - st->codec->has_b_frames*AV_TIME_BASE / av_q2d(st->avg_frame_rate) : 0;
-        ist->next_pts = AV_NOPTS_VALUE;
-        ist->is_start = 1;
-    }
-
-    /* set meta data information from input file if required */
-    for (i=0;i<nb_meta_data_maps;i++) {
-        AVFormatContext *out_file;
-        AVFormatContext *in_file;
-        AVMetadataTag *mtag;
-
-        int out_file_index = meta_data_maps[i].out_file;
-        int in_file_index = meta_data_maps[i].in_file;
-        if (out_file_index < 0 || out_file_index >= nb_output_files) {
-            snprintf(error, sizeof(error), "Invalid output file index %d map_meta_data(%d,%d)",
-                     out_file_index, out_file_index, in_file_index);
-            ret = AVERROR(EINVAL);
-            goto dump_format;
-        }
-        if (in_file_index < 0 || in_file_index >= nb_input_files) {
-            snprintf(error, sizeof(error), "Invalid input file index %d map_meta_data(%d,%d)",
-                     in_file_index, out_file_index, in_file_index);
-            ret = AVERROR(EINVAL);
-            goto dump_format;
-        }
-
-        out_file = output_files[out_file_index];
-        in_file = input_files[in_file_index];
-
-
-        mtag=NULL;
-        while((mtag=av_metadata_get(in_file->metadata, "", mtag, AV_METADATA_IGNORE_SUFFIX)))
-            av_metadata_set2(&out_file->metadata, mtag->key, mtag->value, AV_METADATA_DONT_OVERWRITE);
-        av_metadata_conv(out_file, out_file->oformat->metadata_conv,
-                                    in_file->iformat->metadata_conv);
-    }
-
-    /* copy chapters from the first input file that has them*/
-    for (i = 0; i < nb_input_files; i++) {
-        if (!input_files[i]->nb_chapters)
-            continue;
-
-        for (j = 0; j < nb_output_files; j++)
-            if ((ret = copy_chapters(i, j)) < 0)
-                goto dump_format;
-    }
-
-    /* open files and write file headers */
-    for(i=0;i<nb_output_files;i++) {
-        os = output_files[i];
-        if (av_write_header(os) < 0) {
-            snprintf(error, sizeof(error), "Could not write header for output file #%d (incorrect codec parameters ?)", i);
-            ret = AVERROR(EINVAL);
-            goto dump_format;
-        }
-        if (strcmp(output_files[i]->oformat->name, "rtp")) {
-            want_sdp = 0;
-        }
-    }
-
- dump_format:
-    /* dump the file output parameters - cannot be done before in case
-       of stream copy */
-    for(i=0;i<nb_output_files;i++) {
-        dump_format(output_files[i], i, output_files[i]->filename, 1);
-    }
-
-    /* dump the stream mapping */
-    if (verbose >= 0) {
-        fprintf(stderr, "Stream mapping:\n");
-        for(i=0;i<nb_ostreams;i++) {
-            ost = ost_table[i];
-            fprintf(stderr, "  Stream #%d.%d -> #%d.%d",
-                    ist_table[ost->source_index]->file_index,
-                    ist_table[ost->source_index]->index,
-                    ost->file_index,
-                    ost->index);
-            if (ost->sync_ist != ist_table[ost->source_index])
-                fprintf(stderr, " [sync #%d.%d]",
-                        ost->sync_ist->file_index,
-                        ost->sync_ist->index);
-            fprintf(stderr, "\n");
-        }
-    }
-
-    if (ret) {
-        fprintf(stderr, "%s\n", error);
-        goto fail;
-    }
-
-    if (want_sdp) {
-        print_sdp(output_files, nb_output_files);
-    }
-
-    if (!using_stdin && verbose >= 0) {
-        fprintf(stderr, "Press [q] to stop encoding\n");
-        url_set_interrupt_cb(decode_interrupt_cb);
-    }
-    term_init();
-
-    timer_start = av_gettime();
-
-    for(; received_sigterm == 0;) {
-        int file_index, ist_index;
-        AVPacket pkt;
-        double ipts_min;
-        double opts_min;
-
-    redo:
-        ipts_min= 1e100;
-        opts_min= 1e100;
-        /* if 'q' pressed, exits */
-        if (!using_stdin) {
-            if (q_pressed)
-                break;
-            /* read_key() returns 0 on EOF */
-            key = read_key();
-            if (key == 'q')
-                break;
-        }
-
-        /* select the stream that we must read now by looking at the
-           smallest output pts */
-        file_index = -1;
-        for(i=0;i<nb_ostreams;i++) {
-            double ipts, opts;
-            ost = ost_table[i];
-            os = output_files[ost->file_index];
-            ist = ist_table[ost->source_index];
-            if(ist->is_past_recording_time || no_packet[ist->file_index])
-                continue;
-                opts = ost->st->pts.val * av_q2d(ost->st->time_base);
-            ipts = (double)ist->pts;
-            if (!file_table[ist->file_index].eof_reached){
-                if(ipts < ipts_min) {
-                    ipts_min = ipts;
-                    if(input_sync ) file_index = ist->file_index;
-                }
-                if(opts < opts_min) {
-                    opts_min = opts;
-                    if(!input_sync) file_index = ist->file_index;
-                }
-            }
-            if(ost->frame_number >= max_frames[ost->st->codec->codec_type]){
-                file_index= -1;
-                break;
-            }
-        }
-        /* if none, if is finished */
-        if (file_index < 0) {
-            if(no_packet_count){
-                no_packet_count=0;
-                memset(no_packet, 0, sizeof(no_packet));
-                usleep(10000);
-                continue;
-            }
-            break;
-        }
-
-        /* finish if limit size exhausted */
-        if (limit_filesize != 0 && limit_filesize < url_ftell(output_files[0]->pb))
-            break;
-
-        /* read a frame from it and output it in the fifo */
-        is = input_files[file_index];
-        ret= av_read_frame(is, &pkt);
-        if(ret == AVERROR(EAGAIN)){
-            no_packet[file_index]=1;
-            no_packet_count++;
-            continue;
-        }
-        if (ret < 0) {
-            file_table[file_index].eof_reached = 1;
-            if (opt_shortest)
-                break;
-            else
-                continue;
-        }
-
-        no_packet_count=0;
-        memset(no_packet, 0, sizeof(no_packet));
-
-        if (do_pkt_dump) {
-            av_pkt_dump_log(NULL, AV_LOG_DEBUG, &pkt, do_hex_dump);
-        }
-        /* the following test is needed in case new streams appear
-           dynamically in stream : we ignore them */
-        if (pkt.stream_index >= file_table[file_index].nb_streams)
-            goto discard_packet;
-        ist_index = file_table[file_index].ist_index + pkt.stream_index;
-        ist = ist_table[ist_index];
-        if (ist->discard)
-            goto discard_packet;
-
-        if (pkt.dts != AV_NOPTS_VALUE)
-            pkt.dts += av_rescale_q(input_files_ts_offset[ist->file_index], AV_TIME_BASE_Q, ist->st->time_base);
-        if (pkt.pts != AV_NOPTS_VALUE)
-            pkt.pts += av_rescale_q(input_files_ts_offset[ist->file_index], AV_TIME_BASE_Q, ist->st->time_base);
-
-        if(input_files_ts_scale[file_index][pkt.stream_index]){
-            if(pkt.pts != AV_NOPTS_VALUE)
-                pkt.pts *= input_files_ts_scale[file_index][pkt.stream_index];
-            if(pkt.dts != AV_NOPTS_VALUE)
-                pkt.dts *= input_files_ts_scale[file_index][pkt.stream_index];
-        }
-
-//        fprintf(stderr, "next:%"PRId64" dts:%"PRId64" off:%"PRId64" %d\n", ist->next_pts, pkt.dts, input_files_ts_offset[ist->file_index], ist->st->codec->codec_type);
-        if (pkt.dts != AV_NOPTS_VALUE && ist->next_pts != AV_NOPTS_VALUE
-            && (is->iformat->flags & AVFMT_TS_DISCONT)) {
-            int64_t pkt_dts= av_rescale_q(pkt.dts, ist->st->time_base, AV_TIME_BASE_Q);
-            int64_t delta= pkt_dts - ist->next_pts;
-            if((FFABS(delta) > 1LL*dts_delta_threshold*AV_TIME_BASE || pkt_dts+1<ist->pts)&& !copy_ts){
-                input_files_ts_offset[ist->file_index]-= delta;
-                if (verbose > 2)
-                    fprintf(stderr, "timestamp discontinuity %"PRId64", new offset= %"PRId64"\n", delta, input_files_ts_offset[ist->file_index]);
-                pkt.dts-= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base);
-                if(pkt.pts != AV_NOPTS_VALUE)
-                    pkt.pts-= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base);
-            }
-        }
-
-        /* finish if recording time exhausted */
-        if (recording_time != INT64_MAX &&
-            av_compare_ts(pkt.pts, ist->st->time_base, recording_time + start_time, (AVRational){1, 1000000}) >= 0) {
-            ist->is_past_recording_time = 1;
-            goto discard_packet;
-        }
-
-        //fprintf(stderr,"read #%d.%d size=%d\n", ist->file_index, ist->index, pkt.size);
-        if (output_packet(ist, ist_index, ost_table, nb_ostreams, &pkt) < 0) {
-
-            if (verbose >= 0)
-                fprintf(stderr, "Error while decoding stream #%d.%d\n",
-                        ist->file_index, ist->index);
-            if (exit_on_error)
-                av_exit(1);
-            av_free_packet(&pkt);
-            goto redo;
-        }
-
-    discard_packet:
-        av_free_packet(&pkt);
-
-        /* dump report by using the output first video and audio streams */
-        print_report(output_files, ost_table, nb_ostreams, 0);
-    }
-
-    /* at the end of stream, we must flush the decoder buffers */
-    for(i=0;i<nb_istreams;i++) {
-        ist = ist_table[i];
-        if (ist->decoding_needed) {
-            output_packet(ist, i, ost_table, nb_ostreams, NULL);
-        }
-    }
-
-    term_exit();
-
-    /* write the trailer if needed and close file */
-    for(i=0;i<nb_output_files;i++) {
-        os = output_files[i];
-        av_write_trailer(os);
-    }
-
-    /* dump report by using the first video and audio streams */
-    print_report(output_files, ost_table, nb_ostreams, 1);
-
-    /* close each encoder */
-    for(i=0;i<nb_ostreams;i++) {
-        ost = ost_table[i];
-        if (ost->encoding_needed) {
-            av_freep(&ost->st->codec->stats_in);
-            avcodec_close(ost->st->codec);
-        }
-    }
-
-    /* close each decoder */
-    for(i=0;i<nb_istreams;i++) {
-        ist = ist_table[i];
-        if (ist->decoding_needed) {
-            avcodec_close(ist->st->codec);
-        }
-    }
-
-    /* finished ! */
-    ret = 0;
-
- fail:
-    av_freep(&bit_buffer);
-    av_free(file_table);
-
-    if (ist_table) {
-        for(i=0;i<nb_istreams;i++) {
-            ist = ist_table[i];
-            av_free(ist);
-        }
-        av_free(ist_table);
-    }
-    if (ost_table) {
-        for(i=0;i<nb_ostreams;i++) {
-            ost = ost_table[i];
-            if (ost) {
-                if (ost->logfile) {
-                    fclose(ost->logfile);
-                    ost->logfile = NULL;
-                }
-                av_fifo_free(ost->fifo); /* works even if fifo is not
-                                             initialized but set to zero */
-                av_free(ost->pict_tmp.data[0]);
-                if (ost->video_resample)
-                    sws_freeContext(ost->img_resample_ctx);
-                if (ost->resample)
-                    audio_resample_close(ost->resample);
-                if (ost->reformat_ctx)
-                    av_audio_convert_free(ost->reformat_ctx);
-                av_free(ost);
-            }
-        }
-        av_free(ost_table);
-    }
-    return ret;
-}
-
-static void opt_format(const char *arg)
-{
-    /* compatibility stuff for pgmyuv */
-    if (!strcmp(arg, "pgmyuv")) {
-        pgmyuv_compatibility_hack=1;
-//        opt_image_format(arg);
-        arg = "image2";
-        fprintf(stderr, "pgmyuv format is deprecated, use image2\n");
-    }
-
-    last_asked_format = arg;
-}
-
-static void opt_video_rc_override_string(const char *arg)
-{
-    video_rc_override_string = arg;
-}
-
-static int opt_me_threshold(const char *opt, const char *arg)
-{
-    me_threshold = parse_number_or_die(opt, arg, OPT_INT64, INT_MIN, INT_MAX);
-    return 0;
-}
-
-static int opt_verbose(const char *opt, const char *arg)
-{
-    verbose = parse_number_or_die(opt, arg, OPT_INT64, -10, 10);
-    return 0;
-}
-
-static int opt_frame_rate(const char *opt, const char *arg)
-{
-    if (av_parse_video_frame_rate(&frame_rate, arg) < 0) {
-        fprintf(stderr, "Incorrect value for %s: %s\n", opt, arg);
-        av_exit(1);
-    }
-    return 0;
-}
-
-static int opt_bitrate(const char *opt, const char *arg)
-{
-    int codec_type = opt[0]=='a' ? AVMEDIA_TYPE_AUDIO : AVMEDIA_TYPE_VIDEO;
-
-    opt_default(opt, arg);
-
-    if (av_get_int(avcodec_opts[codec_type], "b", NULL) < 1000)
-        fprintf(stderr, "WARNING: The bitrate parameter is set too low. It takes bits/s as argument, not kbits/s\n");
-
-    return 0;
-}
-
-static void opt_frame_crop_top(const char *arg)
-{
-    frame_topBand = atoi(arg);
-    if (frame_topBand < 0) {
-        fprintf(stderr, "Incorrect top crop size\n");
-        av_exit(1);
-    }
-    if ((frame_topBand) >= frame_height){
-        fprintf(stderr, "Vertical crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
-        av_exit(1);
-    }
-    frame_height -= frame_topBand;
-}
-
-static void opt_frame_crop_bottom(const char *arg)
-{
-    frame_bottomBand = atoi(arg);
-    if (frame_bottomBand < 0) {
-        fprintf(stderr, "Incorrect bottom crop size\n");
-        av_exit(1);
-    }
-    if ((frame_bottomBand) >= frame_height){
-        fprintf(stderr, "Vertical crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
-        av_exit(1);
-    }
-    frame_height -= frame_bottomBand;
-}
-
-static void opt_frame_crop_left(const char *arg)
-{
-    frame_leftBand = atoi(arg);
-    if (frame_leftBand < 0) {
-        fprintf(stderr, "Incorrect left crop size\n");
-        av_exit(1);
-    }
-    if ((frame_leftBand) >= frame_width){
-        fprintf(stderr, "Horizontal crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
-        av_exit(1);
-    }
-    frame_width -= frame_leftBand;
-}
-
-static void opt_frame_crop_right(const char *arg)
-{
-    frame_rightBand = atoi(arg);
-    if (frame_rightBand < 0) {
-        fprintf(stderr, "Incorrect right crop size\n");
-        av_exit(1);
-    }
-    if ((frame_rightBand) >= frame_width){
-        fprintf(stderr, "Horizontal crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
-        av_exit(1);
-    }
-    frame_width -= frame_rightBand;
-}
-
-static void opt_frame_size(const char *arg)
-{
-    if (av_parse_video_frame_size(&frame_width, &frame_height, arg) < 0) {
-        fprintf(stderr, "Incorrect frame size\n");
-        av_exit(1);
-    }
-}
-
-static void opt_pad_color(const char *arg) {
-    /* Input is expected to be six hex digits similar to
-       how colors are expressed in html tags (but without the #) */
-    int rgb = strtol(arg, NULL, 16);
-    int r,g,b;
-
-    r = (rgb >> 16);
-    g = ((rgb >> 8) & 255);
-    b = (rgb & 255);
-
-    padcolor[0] = RGB_TO_Y(r,g,b);
-    padcolor[1] = RGB_TO_U(r,g,b,0);
-    padcolor[2] = RGB_TO_V(r,g,b,0);
-}
-
-static void opt_frame_pad_top(const char *arg)
-{
-    frame_padtop = atoi(arg);
-    if (frame_padtop < 0) {
-        fprintf(stderr, "Incorrect top pad size\n");
-        av_exit(1);
-    }
-}
-
-static void opt_frame_pad_bottom(const char *arg)
-{
-    frame_padbottom = atoi(arg);
-    if (frame_padbottom < 0) {
-        fprintf(stderr, "Incorrect bottom pad size\n");
-        av_exit(1);
-    }
-}
-
-
-static void opt_frame_pad_left(const char *arg)
-{
-    frame_padleft = atoi(arg);
-    if (frame_padleft < 0) {
-        fprintf(stderr, "Incorrect left pad size\n");
-        av_exit(1);
-    }
-}
-
-
-static void opt_frame_pad_right(const char *arg)
-{
-    frame_padright = atoi(arg);
-    if (frame_padright < 0) {
-        fprintf(stderr, "Incorrect right pad size\n");
-        av_exit(1);
-    }
-}
-
-static void opt_frame_pix_fmt(const char *arg)
-{
-    if (strcmp(arg, "list")) {
-        frame_pix_fmt = av_get_pix_fmt(arg);
-        if (frame_pix_fmt == PIX_FMT_NONE) {
-            fprintf(stderr, "Unknown pixel format requested: %s\n", arg);
-            av_exit(1);
-        }
-    } else {
-        show_pix_fmts();
-        av_exit(0);
-    }
-}
-
-static void opt_frame_aspect_ratio(const char *arg)
-{
-    int x = 0, y = 0;
-    double ar = 0;
-    const char *p;
-    char *end;
-
-    p = strchr(arg, ':');
-    if (p) {
-        x = strtol(arg, &end, 10);
-        if (end == p)
-            y = strtol(end+1, &end, 10);
-        if (x > 0 && y > 0)
-            ar = (double)x / (double)y;
-    } else
-        ar = strtod(arg, NULL);
-
-    if (!ar) {
-        fprintf(stderr, "Incorrect aspect ratio specification.\n");
-        av_exit(1);
-    }
-    frame_aspect_ratio = ar;
-}
-
-static int opt_metadata(const char *opt, const char *arg)
-{
-    char *mid= strchr(arg, '=');
-
-    if(!mid){
-        fprintf(stderr, "Missing =\n");
-        av_exit(1);
-    }
-    *mid++= 0;
-
-    metadata_count++;
-    metadata= av_realloc(metadata, sizeof(*metadata)*metadata_count);
-    metadata[metadata_count-1].key  = av_strdup(arg);
-    metadata[metadata_count-1].value= av_strdup(mid);
-
-    return 0;
-}
-
-static void opt_qscale(const char *arg)
-{
-    video_qscale = atof(arg);
-    if (video_qscale <= 0 ||
-        video_qscale > 255) {
-        fprintf(stderr, "qscale must be > 0.0 and <= 255\n");
-        av_exit(1);
-    }
-}
-
-static void opt_top_field_first(const char *arg)
-{
-    top_field_first= atoi(arg);
-}
-
-static int opt_thread_count(const char *opt, const char *arg)
-{
-    thread_count= parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX);
-#if !HAVE_THREADS
-    if (verbose >= 0)
-        fprintf(stderr, "Warning: not compiled with thread support, using thread emulation\n");
-#endif
-    return 0;
-}
-
-static void opt_audio_sample_fmt(const char *arg)
-{
-    if (strcmp(arg, "list"))
-        audio_sample_fmt = avcodec_get_sample_fmt(arg);
-    else {
-        list_fmts(avcodec_sample_fmt_string, SAMPLE_FMT_NB);
-        av_exit(0);
-    }
-}
-
-static int opt_audio_rate(const char *opt, const char *arg)
-{
-    audio_sample_rate = parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX);
-    return 0;
-}
-
-static int opt_audio_channels(const char *opt, const char *arg)
-{
-    audio_channels = parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX);
-    return 0;
-}
-
-static void opt_video_channel(const char *arg)
-{
-    video_channel = strtol(arg, NULL, 0);
-}
-
-static void opt_video_standard(const char *arg)
-{
-    video_standard = av_strdup(arg);
-}
-
-static void opt_codec(int *pstream_copy, char **pcodec_name,
-                      int codec_type, const char *arg)
-{
-    av_freep(pcodec_name);
-    if (!strcmp(arg, "copy")) {
-        *pstream_copy = 1;
-    } else {
-        *pcodec_name = av_strdup(arg);
-    }
-}
-
-static void opt_audio_codec(const char *arg)
-{
-    opt_codec(&audio_stream_copy, &audio_codec_name, AVMEDIA_TYPE_AUDIO, arg);
-}
-
-static void opt_audio_tag(const char *arg)
-{
-    char *tail;
-    audio_codec_tag= strtol(arg, &tail, 0);
-
-    if(!tail || *tail)
-        audio_codec_tag= arg[0] + (arg[1]<<8) + (arg[2]<<16) + (arg[3]<<24);
-}
-
-static void opt_video_tag(const char *arg)
-{
-    char *tail;
-    video_codec_tag= strtol(arg, &tail, 0);
-
-    if(!tail || *tail)
-        video_codec_tag= arg[0] + (arg[1]<<8) + (arg[2]<<16) + (arg[3]<<24);
-}
-
-static void opt_video_codec(const char *arg)
-{
-    opt_codec(&video_stream_copy, &video_codec_name, AVMEDIA_TYPE_VIDEO, arg);
-}
-
-static void opt_subtitle_codec(const char *arg)
-{
-    opt_codec(&subtitle_stream_copy, &subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, arg);
-}
-
-static void opt_subtitle_tag(const char *arg)
-{
-    char *tail;
-    subtitle_codec_tag= strtol(arg, &tail, 0);
-
-    if(!tail || *tail)
-        subtitle_codec_tag= arg[0] + (arg[1]<<8) + (arg[2]<<16) + (arg[3]<<24);
-}
-
-static void opt_map(const char *arg)
-{
-    AVStreamMap *m;
-    char *p;
-
-    m = &stream_maps[nb_stream_maps++];
-
-    m->file_index = strtol(arg, &p, 0);
-    if (*p)
-        p++;
-
-    m->stream_index = strtol(p, &p, 0);
-    if (*p) {
-        p++;
-        m->sync_file_index = strtol(p, &p, 0);
-        if (*p)
-            p++;
-        m->sync_stream_index = strtol(p, &p, 0);
-    } else {
-        m->sync_file_index = m->file_index;
-        m->sync_stream_index = m->stream_index;
-    }
-}
-
-static void opt_map_meta_data(const char *arg)
-{
-    AVMetaDataMap *m;
-    char *p;
-
-    m = &meta_data_maps[nb_meta_data_maps++];
-
-    m->out_file = strtol(arg, &p, 0);
-    if (*p)
-        p++;
-
-    m->in_file = strtol(p, &p, 0);
-}
-
-static void opt_input_ts_scale(const char *arg)
-{
-    unsigned int stream;
-    double scale;
-    char *p;
-
-    stream = strtol(arg, &p, 0);
-    if (*p)
-        p++;
-    scale= strtod(p, &p);
-
-    if(stream >= MAX_STREAMS)
-        av_exit(1);
-
-    input_files_ts_scale[nb_input_files][stream]= scale;
-}
-
-static int opt_recording_time(const char *opt, const char *arg)
-{
-    recording_time = parse_time_or_die(opt, arg, 1);
-    return 0;
-}
-
-static int opt_start_time(const char *opt, const char *arg)
-{
-    start_time = parse_time_or_die(opt, arg, 1);
-    return 0;
-}
-
-static int opt_rec_timestamp(const char *opt, const char *arg)
-{
-    rec_timestamp = parse_time_or_die(opt, arg, 0) / 1000000;
-    return 0;
-}
-
-static int opt_input_ts_offset(const char *opt, const char *arg)
-{
-    input_ts_offset = parse_time_or_die(opt, arg, 1);
-    return 0;
-}
-
-static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
-{
-    const char *codec_string = encoder ? "encoder" : "decoder";
-    AVCodec *codec;
-
-    if(!name)
-        return CODEC_ID_NONE;
-    codec = encoder ?
-        avcodec_find_encoder_by_name(name) :
-        avcodec_find_decoder_by_name(name);
-    if(!codec) {
-        fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
-        av_exit(1);
-    }
-    if(codec->type != type) {
-        fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
-        av_exit(1);
-    }
-    if(codec->capabilities & CODEC_CAP_EXPERIMENTAL &&
-       strict > FF_COMPLIANCE_EXPERIMENTAL) {
-        fprintf(stderr, "%s '%s' is experimental and might produce bad "
-                "results.\nAdd '-strict experimental' if you want to use it.\n",
-                codec_string, codec->name);
-        codec = encoder ?
-            avcodec_find_encoder(codec->id) :
-            avcodec_find_decoder(codec->id);
-        if (!(codec->capabilities & CODEC_CAP_EXPERIMENTAL))
-            fprintf(stderr, "Or use the non experimental %s '%s'.\n",
-                    codec_string, codec->name);
-        av_exit(1);
-    }
-    return codec->id;
-}
-
-static void opt_input_file(const char *filename)
-{
-    AVFormatContext *ic;
-    AVFormatParameters params, *ap = &params;
-    AVInputFormat *file_iformat = NULL;
-    int err, i, ret, rfps, rfps_base;
-    int64_t timestamp;
-
-    if (last_asked_format) {
-        if (!(file_iformat = av_find_input_format(last_asked_format))) {
-            fprintf(stderr, "Unknown input format: '%s'\n", last_asked_format);
-            av_exit(1);
-        }
-        last_asked_format = NULL;
-    }
-
-    if (!strcmp(filename, "-"))
-        filename = "pipe:";
-
-    using_stdin |= !strncmp(filename, "pipe:", 5) ||
-                    !strcmp(filename, "/dev/stdin");
-
-    /* get default parameters from command line */
-    ic = avformat_alloc_context();
-    if (!ic) {
-        print_error(filename, AVERROR(ENOMEM));
-        av_exit(1);
-    }
-
-    memset(ap, 0, sizeof(*ap));
-    ap->prealloced_context = 1;
-    ap->sample_rate = audio_sample_rate;
-    ap->channels = audio_channels;
-    ap->time_base.den = frame_rate.num;
-    ap->time_base.num = frame_rate.den;
-    ap->width = frame_width + frame_padleft + frame_padright;
-    ap->height = frame_height + frame_padtop + frame_padbottom;
-    ap->pix_fmt = frame_pix_fmt;
-   // ap->sample_fmt = audio_sample_fmt; //FIXME:not implemented in libavformat
-    ap->channel = video_channel;
-    ap->standard = video_standard;
-
-    set_context_opts(ic, avformat_opts, AV_OPT_FLAG_DECODING_PARAM);
-
-    ic->video_codec_id   =
-        find_codec_or_die(video_codec_name   , AVMEDIA_TYPE_VIDEO   , 0,
-                          avcodec_opts[AVMEDIA_TYPE_VIDEO   ]->strict_std_compliance);
-    ic->audio_codec_id   =
-        find_codec_or_die(audio_codec_name   , AVMEDIA_TYPE_AUDIO   , 0,
-                          avcodec_opts[AVMEDIA_TYPE_AUDIO   ]->strict_std_compliance);
-    ic->subtitle_codec_id=
-        find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 0,
-                          avcodec_opts[AVMEDIA_TYPE_SUBTITLE]->strict_std_compliance);
-    ic->flags |= AVFMT_FLAG_NONBLOCK;
-
-    if(pgmyuv_compatibility_hack)
-        ic->video_codec_id= CODEC_ID_PGMYUV;
-
-    /* open the input file with generic libav function */
-    err = av_open_input_file(&ic, filename, file_iformat, 0, ap);
-    if (err < 0) {
-        print_error(filename, err);
-        av_exit(1);
-    }
-    if(opt_programid) {
-        int i, j;
-        int found=0;
-        for(i=0; i<ic->nb_streams; i++){
-            ic->streams[i]->discard= AVDISCARD_ALL;
-        }
-        for(i=0; i<ic->nb_programs; i++){
-            AVProgram *p= ic->programs[i];
-            if(p->id != opt_programid){
-                p->discard = AVDISCARD_ALL;
-            }else{
-                found=1;
-                for(j=0; j<p->nb_stream_indexes; j++){
-                    ic->streams[p->stream_index[j]]->discard= AVDISCARD_DEFAULT;
-                }
-            }
-        }
-        if(!found){
-            fprintf(stderr, "Specified program id not found\n");
-            av_exit(1);
-        }
-        opt_programid=0;
-    }
-
-    ic->loop_input = loop_input;
-
-    /* If not enough info to get the stream parameters, we decode the
-       first frames to get it. (used in mpeg case for example) */
-    ret = av_find_stream_info(ic);
-    if (ret < 0 && verbose >= 0) {
-        fprintf(stderr, "%s: could not find codec parameters\n", filename);
-        av_exit(1);
-    }
-
-    timestamp = start_time;
-    /* add the stream start time */
-    if (ic->start_time != AV_NOPTS_VALUE)
-        timestamp += ic->start_time;
-
-    /* if seeking requested, we execute it */
-    if (start_time != 0) {
-        ret = av_seek_frame(ic, -1, timestamp, AVSEEK_FLAG_BACKWARD);
-        if (ret < 0) {
-            fprintf(stderr, "%s: could not seek to position %0.3f\n",
-                    filename, (double)timestamp / AV_TIME_BASE);
-        }
-        /* reset seek info */
-        start_time = 0;
-    }
-
-    /* update the current parameters so that they match the one of the input stream */
-    for(i=0;i<ic->nb_streams;i++) {
-        AVStream *st = ic->streams[i];
-        AVCodecContext *enc = st->codec;
-        avcodec_thread_init(enc, thread_count);
-        switch(enc->codec_type) {
-        case AVMEDIA_TYPE_AUDIO:
-            set_context_opts(enc, avcodec_opts[AVMEDIA_TYPE_AUDIO], AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM);
-            //fprintf(stderr, "\nInput Audio channels: %d", enc->channels);
-            channel_layout = enc->channel_layout;
-            audio_channels = enc->channels;
-            audio_sample_rate = enc->sample_rate;
-            audio_sample_fmt = enc->sample_fmt;
-            input_codecs[nb_icodecs++] = avcodec_find_decoder_by_name(audio_codec_name);
-            if(audio_disable)
-                st->discard= AVDISCARD_ALL;
-            break;
-        case AVMEDIA_TYPE_VIDEO:
-            set_context_opts(enc, avcodec_opts[AVMEDIA_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM);
-            frame_height = enc->height;
-            frame_width = enc->width;
-            if(ic->streams[i]->sample_aspect_ratio.num)
-                frame_aspect_ratio=av_q2d(ic->streams[i]->sample_aspect_ratio);
-            else
-                frame_aspect_ratio=av_q2d(enc->sample_aspect_ratio);
-            frame_aspect_ratio *= (float) enc->width / enc->height;
-            frame_pix_fmt = enc->pix_fmt;
-            rfps      = ic->streams[i]->r_frame_rate.num;
-            rfps_base = ic->streams[i]->r_frame_rate.den;
-            if(enc->lowres) {
-                enc->flags |= CODEC_FLAG_EMU_EDGE;
-                frame_height >>= enc->lowres;
-                frame_width  >>= enc->lowres;
-            }
-            if(me_threshold)
-                enc->debug |= FF_DEBUG_MV;
-
-            if (enc->time_base.den != rfps*enc->ticks_per_frame || enc->time_base.num != rfps_base) {
-
-                if (verbose >= 0)
-                    fprintf(stderr,"\nSeems stream %d codec frame rate differs from container frame rate: %2.2f (%d/%d) -> %2.2f (%d/%d)\n",
-                            i, (float)enc->time_base.den / enc->time_base.num, enc->time_base.den, enc->time_base.num,
-
-                    (float)rfps / rfps_base, rfps, rfps_base);
-            }
-            /* update the current frame rate to match the stream frame rate */
-            frame_rate.num = rfps;
-            frame_rate.den = rfps_base;
-
-            input_codecs[nb_icodecs++] = avcodec_find_decoder_by_name(video_codec_name);
-            if(video_disable)
-                st->discard= AVDISCARD_ALL;
-            else if(video_discard)
-                st->discard= video_discard;
-            break;
-        case AVMEDIA_TYPE_DATA:
-            break;
-        case AVMEDIA_TYPE_SUBTITLE:
-            input_codecs[nb_icodecs++] = avcodec_find_decoder_by_name(subtitle_codec_name);
-            if(subtitle_disable)
-                st->discard = AVDISCARD_ALL;
-            break;
-        case AVMEDIA_TYPE_ATTACHMENT:
-        case AVMEDIA_TYPE_UNKNOWN:
-            nb_icodecs++;
-            break;
-        default:
-            abort();
-        }
-    }
-
-    input_files[nb_input_files] = ic;
-    input_files_ts_offset[nb_input_files] = input_ts_offset - (copy_ts ? 0 : timestamp);
-    /* dump the file content */
-    if (verbose >= 0)
-        dump_format(ic, nb_input_files, filename, 0);
-
-    nb_input_files++;
-
-    video_channel = 0;
-
-    av_freep(&video_codec_name);
-    av_freep(&audio_codec_name);
-    av_freep(&subtitle_codec_name);
-}
-
-static void check_audio_video_sub_inputs(int *has_video_ptr, int *has_audio_ptr,
-                                         int *has_subtitle_ptr)
-{
-    int has_video, has_audio, has_subtitle, i, j;
-    AVFormatContext *ic;
-
-    has_video = 0;
-    has_audio = 0;
-    has_subtitle = 0;
-    for(j=0;j<nb_input_files;j++) {
-        ic = input_files[j];
-        for(i=0;i<ic->nb_streams;i++) {
-            AVCodecContext *enc = ic->streams[i]->codec;
-            switch(enc->codec_type) {
-            case AVMEDIA_TYPE_AUDIO:
-                has_audio = 1;
-                break;
-            case AVMEDIA_TYPE_VIDEO:
-                has_video = 1;
-                break;
-            case AVMEDIA_TYPE_SUBTITLE:
-                has_subtitle = 1;
-                break;
-            case AVMEDIA_TYPE_DATA:
-            case AVMEDIA_TYPE_ATTACHMENT:
-            case AVMEDIA_TYPE_UNKNOWN:
-                break;
-            default:
-                abort();
-            }
-        }
-    }
-    *has_video_ptr = has_video;
-    *has_audio_ptr = has_audio;
-    *has_subtitle_ptr = has_subtitle;
-}
-
-static void new_video_stream(AVFormatContext *oc)
-{
-    AVStream *st;
-    AVCodecContext *video_enc;
-    enum CodecID codec_id;
-
-    st = av_new_stream(oc, oc->nb_streams);
-    if (!st) {
-        fprintf(stderr, "Could not alloc stream\n");
-        av_exit(1);
-    }
-    avcodec_get_context_defaults2(st->codec, AVMEDIA_TYPE_VIDEO);
-    bitstream_filters[nb_output_files][oc->nb_streams - 1]= video_bitstream_filters;
-    video_bitstream_filters= NULL;
-
-    avcodec_thread_init(st->codec, thread_count);
-
-    video_enc = st->codec;
-
-    if(video_codec_tag)
-        video_enc->codec_tag= video_codec_tag;
-
-    if(   (video_global_header&1)
-       || (video_global_header==0 && (oc->oformat->flags & AVFMT_GLOBALHEADER))){
-        video_enc->flags |= CODEC_FLAG_GLOBAL_HEADER;
-        avcodec_opts[AVMEDIA_TYPE_VIDEO]->flags|= CODEC_FLAG_GLOBAL_HEADER;
-    }
-    if(video_global_header&2){
-        video_enc->flags2 |= CODEC_FLAG2_LOCAL_HEADER;
-        avcodec_opts[AVMEDIA_TYPE_VIDEO]->flags2|= CODEC_FLAG2_LOCAL_HEADER;
-    }
-
-    if (video_stream_copy) {
-        st->stream_copy = 1;
-        video_enc->codec_type = AVMEDIA_TYPE_VIDEO;
-        video_enc->sample_aspect_ratio =
-        st->sample_aspect_ratio = av_d2q(frame_aspect_ratio*frame_height/frame_width, 255);
-    } else {
-        const char *p;
-        int i;
-        AVCodec *codec;
-        AVRational fps= frame_rate.num ? frame_rate : (AVRational){25,1};
-
-        if (video_codec_name) {
-            codec_id = find_codec_or_die(video_codec_name, AVMEDIA_TYPE_VIDEO, 1,
-                                         video_enc->strict_std_compliance);
-            codec = avcodec_find_encoder_by_name(video_codec_name);
-            output_codecs[nb_ocodecs] = codec;
-        } else {
-            codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_VIDEO);
-            codec = avcodec_find_encoder(codec_id);
-        }
-
-        video_enc->codec_id = codec_id;
-
-        set_context_opts(video_enc, avcodec_opts[AVMEDIA_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM);
-
-        if (codec && codec->supported_framerates && !force_fps)
-            fps = codec->supported_framerates[av_find_nearest_q_idx(fps, codec->supported_framerates)];
-        video_enc->time_base.den = fps.num;
-        video_enc->time_base.num = fps.den;
-
-        video_enc->width = frame_width + frame_padright + frame_padleft;
-        video_enc->height = frame_height + frame_padtop + frame_padbottom;
-        video_enc->sample_aspect_ratio = av_d2q(frame_aspect_ratio*video_enc->height/video_enc->width, 255);
-        video_enc->pix_fmt = frame_pix_fmt;
-        st->sample_aspect_ratio = video_enc->sample_aspect_ratio;
-
-        choose_pixel_fmt(st, codec);
-
-        if (intra_only)
-            video_enc->gop_size = 0;
-        if (video_qscale || same_quality) {
-            video_enc->flags |= CODEC_FLAG_QSCALE;
-            video_enc->global_quality=
-                st->quality = FF_QP2LAMBDA * video_qscale;
-        }
-
-        if(intra_matrix)
-            video_enc->intra_matrix = intra_matrix;
-        if(inter_matrix)
-            video_enc->inter_matrix = inter_matrix;
-
-        p= video_rc_override_string;
-        for(i=0; p; i++){
-            int start, end, q;
-            int e=sscanf(p, "%d,%d,%d", &start, &end, &q);
-            if(e!=3){
-                fprintf(stderr, "error parsing rc_override\n");
-                av_exit(1);
-            }
-            video_enc->rc_override=
-                av_realloc(video_enc->rc_override,
-                           sizeof(RcOverride)*(i+1));
-            video_enc->rc_override[i].start_frame= start;
-            video_enc->rc_override[i].end_frame  = end;
-            if(q>0){
-                video_enc->rc_override[i].qscale= q;
-                video_enc->rc_override[i].quality_factor= 1.0;
-            }
-            else{
-                video_enc->rc_override[i].qscale= 0;
-                video_enc->rc_override[i].quality_factor= -q/100.0;
-            }
-            p= strchr(p, '/');
-            if(p) p++;
-        }
-        video_enc->rc_override_count=i;
-        if (!video_enc->rc_initial_buffer_occupancy)
-            video_enc->rc_initial_buffer_occupancy = video_enc->rc_buffer_size*3/4;
-        video_enc->me_threshold= me_threshold;
-        video_enc->intra_dc_precision= intra_dc_precision - 8;
-
-        if (do_psnr)
-            video_enc->flags|= CODEC_FLAG_PSNR;
-
-        /* two pass mode */
-        if (do_pass) {
-            if (do_pass == 1) {
-                video_enc->flags |= CODEC_FLAG_PASS1;
-            } else {
-                video_enc->flags |= CODEC_FLAG_PASS2;
-            }
-        }
-    }
-    nb_ocodecs++;
-    if (video_language) {
-        av_metadata_set2(&st->metadata, "language", video_language, 0);
-        av_freep(&video_language);
-    }
-
-    /* reset some key parameters */
-    video_disable = 0;
-    av_freep(&video_codec_name);
-    video_stream_copy = 0;
-    frame_pix_fmt = PIX_FMT_NONE;
-}
-
-static void new_audio_stream(AVFormatContext *oc)
-{
-    AVStream *st;
-    AVCodecContext *audio_enc;
-    enum CodecID codec_id;
-
-    st = av_new_stream(oc, oc->nb_streams);
-    if (!st) {
-        fprintf(stderr, "Could not alloc stream\n");
-        av_exit(1);
-    }
-    avcodec_get_context_defaults2(st->codec, AVMEDIA_TYPE_AUDIO);
-
-    bitstream_filters[nb_output_files][oc->nb_streams - 1]= audio_bitstream_filters;
-    audio_bitstream_filters= NULL;
-
-    avcodec_thread_init(st->codec, thread_count);
-
-    audio_enc = st->codec;
-    audio_enc->codec_type = AVMEDIA_TYPE_AUDIO;
-
-    if(audio_codec_tag)
-        audio_enc->codec_tag= audio_codec_tag;
-
-    if (oc->oformat->flags & AVFMT_GLOBALHEADER) {
-        audio_enc->flags |= CODEC_FLAG_GLOBAL_HEADER;
-        avcodec_opts[AVMEDIA_TYPE_AUDIO]->flags|= CODEC_FLAG_GLOBAL_HEADER;
-    }
-    if (audio_stream_copy) {
-        st->stream_copy = 1;
-        audio_enc->channels = audio_channels;
-        audio_enc->sample_rate = audio_sample_rate;
-    } else {
-        AVCodec *codec;
-
-        set_context_opts(audio_enc, avcodec_opts[AVMEDIA_TYPE_AUDIO], AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM);
-
-        if (audio_codec_name) {
-            codec_id = find_codec_or_die(audio_codec_name, AVMEDIA_TYPE_AUDIO, 1,
-                                         audio_enc->strict_std_compliance);
-            codec = avcodec_find_encoder_by_name(audio_codec_name);
-            output_codecs[nb_ocodecs] = codec;
-        } else {
-            codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_AUDIO);
-            codec = avcodec_find_encoder(codec_id);
-        }
-        audio_enc->codec_id = codec_id;
-
-        if (audio_qscale > QSCALE_NONE) {
-            audio_enc->flags |= CODEC_FLAG_QSCALE;
-            audio_enc->global_quality = st->quality = FF_QP2LAMBDA * audio_qscale;
-        }
-        audio_enc->channels = audio_channels;
-        audio_enc->sample_fmt = audio_sample_fmt;
-        audio_enc->sample_rate = audio_sample_rate;
-        audio_enc->channel_layout = channel_layout;
-        if (avcodec_channel_layout_num_channels(channel_layout) != audio_channels)
-            audio_enc->channel_layout = 0;
-        choose_sample_fmt(st, codec);
-        choose_sample_rate(st, codec);
-    }
-    nb_ocodecs++;
-    audio_enc->time_base= (AVRational){1, audio_sample_rate};
-    if (audio_language) {
-        av_metadata_set2(&st->metadata, "language", audio_language, 0);
-        av_freep(&audio_language);
-    }
-
-    /* reset some key parameters */
-    audio_disable = 0;
-    av_freep(&audio_codec_name);
-    audio_stream_copy = 0;
-}
-
-static void new_subtitle_stream(AVFormatContext *oc)
-{
-    AVStream *st;
-    AVCodecContext *subtitle_enc;
-
-    st = av_new_stream(oc, oc->nb_streams);
-    if (!st) {
-        fprintf(stderr, "Could not alloc stream\n");
-        av_exit(1);
-    }
-    avcodec_get_context_defaults2(st->codec, AVMEDIA_TYPE_SUBTITLE);
-
-    bitstream_filters[nb_output_files][oc->nb_streams - 1]= subtitle_bitstream_filters;
-    subtitle_bitstream_filters= NULL;
-
-    subtitle_enc = st->codec;
-    subtitle_enc->codec_type = AVMEDIA_TYPE_SUBTITLE;
-
-    if(subtitle_codec_tag)
-        subtitle_enc->codec_tag= subtitle_codec_tag;
-
-    if (subtitle_stream_copy) {
-        st->stream_copy = 1;
-    } else {
-        set_context_opts(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], subtitle_enc, AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_ENCODING_PARAM);
-        subtitle_enc->codec_id = find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 1,
-                                                   subtitle_enc->strict_std_compliance);
-        output_codecs[nb_ocodecs] = avcodec_find_encoder_by_name(subtitle_codec_name);
-    }
-    nb_ocodecs++;
-
-    if (subtitle_language) {
-        av_metadata_set2(&st->metadata, "language", subtitle_language, 0);
-        av_freep(&subtitle_language);
-    }
-
-    subtitle_disable = 0;
-    av_freep(&subtitle_codec_name);
-    subtitle_stream_copy = 0;
-}
-
-static void opt_new_audio_stream(void)
-{
-    AVFormatContext *oc;
-    if (nb_output_files <= 0) {
-        fprintf(stderr, "At least one output file must be specified\n");
-        av_exit(1);
-    }
-    oc = output_files[nb_output_files - 1];
-    new_audio_stream(oc);
-}
-
-static void opt_new_video_stream(void)
-{
-    AVFormatContext *oc;
-    if (nb_output_files <= 0) {
-        fprintf(stderr, "At least one output file must be specified\n");
-        av_exit(1);
-    }
-    oc = output_files[nb_output_files - 1];
-    new_video_stream(oc);
-}
-
-static void opt_new_subtitle_stream(void)
-{
-    AVFormatContext *oc;
-    if (nb_output_files <= 0) {
-        fprintf(stderr, "At least one output file must be specified\n");
-        av_exit(1);
-    }
-    oc = output_files[nb_output_files - 1];
-    new_subtitle_stream(oc);
-}
-
-static void opt_output_file(const char *filename)
-{
-    AVFormatContext *oc;
-    int err, use_video, use_audio, use_subtitle;
-    int input_has_video, input_has_audio, input_has_subtitle;
-    AVFormatParameters params, *ap = &params;
-    AVOutputFormat *file_oformat;
-
-    if (!strcmp(filename, "-"))
-        filename = "pipe:";
-
-    oc = avformat_alloc_context();
-    if (!oc) {
-        print_error(filename, AVERROR(ENOMEM));
-        av_exit(1);
-    }
-
-    if (last_asked_format) {
-        file_oformat = av_guess_format(last_asked_format, NULL, NULL);
-        if (!file_oformat) {
-            fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);
-            av_exit(1);
-        }
-        last_asked_format = NULL;
-    } else {
-        file_oformat = av_guess_format(NULL, filename, NULL);
-        if (!file_oformat) {
-            fprintf(stderr, "Unable to find a suitable output format for '%s'\n",
-                    filename);
-            av_exit(1);
-        }
-    }
-
-    oc->oformat = file_oformat;
-    av_strlcpy(oc->filename, filename, sizeof(oc->filename));
-
-    if (!strcmp(file_oformat->name, "ffm") &&
-        av_strstart(filename, "http:", NULL)) {
-        /* special case for files sent to ffserver: we get the stream
-           parameters from ffserver */
-        int err = read_ffserver_streams(oc, filename);
-        if (err < 0) {
-            print_error(filename, err);
-            av_exit(1);
-        }
-    } else {
-        use_video = file_oformat->video_codec != CODEC_ID_NONE || video_stream_copy || video_codec_name;
-        use_audio = file_oformat->audio_codec != CODEC_ID_NONE || audio_stream_copy || audio_codec_name;
-        use_subtitle = file_oformat->subtitle_codec != CODEC_ID_NONE || subtitle_stream_copy || subtitle_codec_name;
-
-        /* disable if no corresponding type found and at least one
-           input file */
-        if (nb_input_files > 0) {
-            check_audio_video_sub_inputs(&input_has_video, &input_has_audio,
-                                         &input_has_subtitle);
-            if (!input_has_video)
-                use_video = 0;
-            if (!input_has_audio)
-                use_audio = 0;
-            if (!input_has_subtitle)
-                use_subtitle = 0;
-        }
-
-        /* manual disable */
-        if (audio_disable) {
-            use_audio = 0;
-        }
-        if (video_disable) {
-            use_video = 0;
-        }
-        if (subtitle_disable) {
-            use_subtitle = 0;
-        }
-
-        if (use_video) {
-            new_video_stream(oc);
-        }
-
-        if (use_audio) {
-            new_audio_stream(oc);
-        }
-
-        if (use_subtitle) {
-            new_subtitle_stream(oc);
-        }
-
-        oc->timestamp = rec_timestamp;
-
-        for(; metadata_count>0; metadata_count--){
-            av_metadata_set2(&oc->metadata, metadata[metadata_count-1].key,
-                                            metadata[metadata_count-1].value, 0);
-        }
-        av_metadata_conv(oc, oc->oformat->metadata_conv, NULL);
-    }
-
-    output_files[nb_output_files++] = oc;
-
-    /* check filename in case of an image number is expected */
-    if (oc->oformat->flags & AVFMT_NEEDNUMBER) {
-        if (!av_filename_number_test(oc->filename)) {
-            print_error(oc->filename, AVERROR_NUMEXPECTED);
-            av_exit(1);
-        }
-    }
-
-    if (!(oc->oformat->flags & AVFMT_NOFILE)) {
-        /* test if it already exists to avoid loosing precious files */
-        if (!file_overwrite &&
-            (strchr(filename, ':') == NULL ||
-             filename[1] == ':' ||
-             av_strstart(filename, "file:", NULL))) {
-            if (url_exist(filename)) {
-                if (!using_stdin) {
-                    fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename);
-                    fflush(stderr);
-                    if (!read_yesno()) {
-                        fprintf(stderr, "Not overwriting - exiting\n");
-                        av_exit(1);
-                    }
-                }
-                else {
-                    fprintf(stderr,"File '%s' already exists. Exiting.\n", filename);
-                    av_exit(1);
-                }
-            }
-        }
-
-        /* open the file */
-        if ((err = url_fopen(&oc->pb, filename, URL_WRONLY)) < 0) {
-            print_error(filename, err);
-            av_exit(1);
-        }
-    }
-
-    memset(ap, 0, sizeof(*ap));
-    if (av_set_parameters(oc, ap) < 0) {
-        fprintf(stderr, "%s: Invalid encoding parameters\n",
-                oc->filename);
-        av_exit(1);
-    }
-
-    oc->preload= (int)(mux_preload*AV_TIME_BASE);
-    oc->max_delay= (int)(mux_max_delay*AV_TIME_BASE);
-    oc->loop_output = loop_output;
-    oc->flags |= AVFMT_FLAG_NONBLOCK;
-
-    set_context_opts(oc, avformat_opts, AV_OPT_FLAG_ENCODING_PARAM);
-}
-
-/* same option as mencoder */
-static void opt_pass(const char *pass_str)
-{
-    int pass;
-    pass = atoi(pass_str);
-    if (pass != 1 && pass != 2) {
-        fprintf(stderr, "pass number can be only 1 or 2\n");
-        av_exit(1);
-    }
-    do_pass = pass;
-}
-
-static int64_t getutime(void)
-{
-#if HAVE_GETRUSAGE
-    struct rusage rusage;
-
-    getrusage(RUSAGE_SELF, &rusage);
-    return (rusage.ru_utime.tv_sec * 1000000LL) + rusage.ru_utime.tv_usec;
-#elif HAVE_GETPROCESSTIMES
-    HANDLE proc;
-    FILETIME c, e, k, u;
-    proc = GetCurrentProcess();
-    GetProcessTimes(proc, &c, &e, &k, &u);
-    return ((int64_t) u.dwHighDateTime << 32 | u.dwLowDateTime) / 10;
-#else
-    return av_gettime();
-#endif
-}
-
-static int64_t getmaxrss(void)
-{
-#if HAVE_GETRUSAGE && HAVE_STRUCT_RUSAGE_RU_MAXRSS
-    struct rusage rusage;
-    getrusage(RUSAGE_SELF, &rusage);
-    return (int64_t)rusage.ru_maxrss * 1024;
-#elif HAVE_GETPROCESSMEMORYINFO
-    HANDLE proc;
-    PROCESS_MEMORY_COUNTERS memcounters;
-    proc = GetCurrentProcess();
-    memcounters.cb = sizeof(memcounters);
-    GetProcessMemoryInfo(proc, &memcounters, sizeof(memcounters));
-    return memcounters.PeakPagefileUsage;
-#else
-    return 0;
-#endif
-}
-
-static void parse_matrix_coeffs(uint16_t *dest, const char *str)
-{
-    int i;
-    const char *p = str;
-    for(i = 0;; i++) {
-        dest[i] = atoi(p);
-        if(i == 63)
-            break;
-        p = strchr(p, ',');
-        if(!p) {
-            fprintf(stderr, "Syntax error in matrix \"%s\" at coeff %d\n", str, i);
-            av_exit(1);
-        }
-        p++;
-    }
-}
-
-static void opt_inter_matrix(const char *arg)
-{
-    inter_matrix = av_mallocz(sizeof(uint16_t) * 64);
-    parse_matrix_coeffs(inter_matrix, arg);
-}
-
-static void opt_intra_matrix(const char *arg)
-{
-    intra_matrix = av_mallocz(sizeof(uint16_t) * 64);
-    parse_matrix_coeffs(intra_matrix, arg);
-}
-
-/**
- * Trivial log callback.
- * Only suitable for show_help and similar since it lacks prefix handling.
- */
-static void log_callback_help(void* ptr, int level, const char* fmt, va_list vl)
-{
-    vfprintf(stdout, fmt, vl);
-}
-
-static void show_usage(void)
-{
-    printf("Hyper fast Audio and Video encoder\n");
-    printf("usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...\n");
-    printf("\n");
-}
-
-static void show_help(void)
-{
-    av_log_set_callback(log_callback_help);
-    show_usage();
-    show_help_options(options, "Main options:\n",
-                      OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE | OPT_GRAB, 0);
-    show_help_options(options, "\nAdvanced options:\n",
-                      OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE | OPT_GRAB,
-                      OPT_EXPERT);
-    show_help_options(options, "\nVideo options:\n",
-                      OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB,
-                      OPT_VIDEO);
-    show_help_options(options, "\nAdvanced Video options:\n",
-                      OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB,
-                      OPT_VIDEO | OPT_EXPERT);
-    show_help_options(options, "\nAudio options:\n",
-                      OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB,
-                      OPT_AUDIO);
-    show_help_options(options, "\nAdvanced Audio options:\n",
-                      OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB,
-                      OPT_AUDIO | OPT_EXPERT);
-    show_help_options(options, "\nSubtitle options:\n",
-                      OPT_SUBTITLE | OPT_GRAB,
-                      OPT_SUBTITLE);
-    show_help_options(options, "\nAudio/Video grab options:\n",
-                      OPT_GRAB,
-                      OPT_GRAB);
-    printf("\n");
-    av_opt_show(avcodec_opts[0], NULL);
-    printf("\n");
-    av_opt_show(avformat_opts, NULL);
-    printf("\n");
-    av_opt_show(sws_opts, NULL);
-}
-
-static void opt_target(const char *arg)
-{
-    enum { PAL, NTSC, FILM, UNKNOWN } norm = UNKNOWN;
-    static const char *const frame_rates[] = {"25", "30000/1001", "24000/1001"};
-
-    if(!strncmp(arg, "pal-", 4)) {
-        norm = PAL;
-        arg += 4;
-    } else if(!strncmp(arg, "ntsc-", 5)) {
-        norm = NTSC;
-        arg += 5;
-    } else if(!strncmp(arg, "film-", 5)) {
-        norm = FILM;
-        arg += 5;
-    } else {
-        int fr;
-        /* Calculate FR via float to avoid int overflow */
-        fr = (int)(frame_rate.num * 1000.0 / frame_rate.den);
-        if(fr == 25000) {
-            norm = PAL;
-        } else if((fr == 29970) || (fr == 23976)) {
-            norm = NTSC;
-        } else {
-            /* Try to determine PAL/NTSC by peeking in the input files */
-            if(nb_input_files) {
-                int i, j;
-                for(j = 0; j < nb_input_files; j++) {
-                    for(i = 0; i < input_files[j]->nb_streams; i++) {
-                        AVCodecContext *c = input_files[j]->streams[i]->codec;
-                        if(c->codec_type != AVMEDIA_TYPE_VIDEO)
-                            continue;
-                        fr = c->time_base.den * 1000 / c->time_base.num;
-                        if(fr == 25000) {
-                            norm = PAL;
-                            break;
-                        } else if((fr == 29970) || (fr == 23976)) {
-                            norm = NTSC;
-                            break;
-                        }
-                    }
-                    if(norm != UNKNOWN)
-                        break;
-                }
-            }
-        }
-        if(verbose && norm != UNKNOWN)
-            fprintf(stderr, "Assuming %s for target.\n", norm == PAL ? "PAL" : "NTSC");
-    }
-
-    if(norm == UNKNOWN) {
-        fprintf(stderr, "Could not determine norm (PAL/NTSC/NTSC-Film) for target.\n");
-        fprintf(stderr, "Please prefix target with \"pal-\", \"ntsc-\" or \"film-\",\n");
-        fprintf(stderr, "or set a framerate with \"-r xxx\".\n");
-        av_exit(1);
-    }
-
-    if(!strcmp(arg, "vcd")) {
-
-        opt_video_codec("mpeg1video");
-        opt_audio_codec("mp2");
-        opt_format("vcd");
-
-        opt_frame_size(norm == PAL ? "352x288" : "352x240");
-        opt_frame_rate(NULL, frame_rates[norm]);
-        opt_default("g", norm == PAL ? "15" : "18");
-
-        opt_default("b", "1150000");
-        opt_default("maxrate", "1150000");
-        opt_default("minrate", "1150000");
-        opt_default("bufsize", "327680"); // 40*1024*8;
-
-        opt_default("ab", "224000");
-        audio_sample_rate = 44100;
-        audio_channels = 2;
-
-        opt_default("packetsize", "2324");
-        opt_default("muxrate", "1411200"); // 2352 * 75 * 8;
-
-        /* We have to offset the PTS, so that it is consistent with the SCR.
-           SCR starts at 36000, but the first two packs contain only padding
-           and the first pack from the other stream, respectively, may also have
-           been written before.
-           So the real data starts at SCR 36000+3*1200. */
-        mux_preload= (36000+3*1200) / 90000.0; //0.44
-    } else if(!strcmp(arg, "svcd")) {
-
-        opt_video_codec("mpeg2video");
-        opt_audio_codec("mp2");
-        opt_format("svcd");
-
-        opt_frame_size(norm == PAL ? "480x576" : "480x480");
-        opt_frame_rate(NULL, frame_rates[norm]);
-        opt_default("g", norm == PAL ? "15" : "18");
-
-        opt_default("b", "2040000");
-        opt_default("maxrate", "2516000");
-        opt_default("minrate", "0"); //1145000;
-        opt_default("bufsize", "1835008"); //224*1024*8;
-        opt_default("flags", "+scan_offset");
-
-
-        opt_default("ab", "224000");
-        audio_sample_rate = 44100;
-
-        opt_default("packetsize", "2324");
-
-    } else if(!strcmp(arg, "dvd")) {
-
-        opt_video_codec("mpeg2video");
-        opt_audio_codec("ac3");
-        opt_format("dvd");
-
-        opt_frame_size(norm == PAL ? "720x576" : "720x480");
-        opt_frame_rate(NULL, frame_rates[norm]);
-        opt_default("g", norm == PAL ? "15" : "18");
-
-        opt_default("b", "6000000");
-        opt_default("maxrate", "9000000");
-        opt_default("minrate", "0"); //1500000;
-        opt_default("bufsize", "1835008"); //224*1024*8;
-
-        opt_default("packetsize", "2048");  // from www.mpucoder.com: DVD sectors contain 2048 bytes of data, this is also the size of one pack.
-        opt_default("muxrate", "10080000"); // from mplex project: data_rate = 1260000. mux_rate = data_rate * 8
-
-        opt_default("ab", "448000");
-        audio_sample_rate = 48000;
-
-    } else if(!strncmp(arg, "dv", 2)) {
-
-        opt_format("dv");
-
-        opt_frame_size(norm == PAL ? "720x576" : "720x480");
-        opt_frame_pix_fmt(!strncmp(arg, "dv50", 4) ? "yuv422p" :
-                          (norm == PAL ? "yuv420p" : "yuv411p"));
-        opt_frame_rate(NULL, frame_rates[norm]);
-
-        audio_sample_rate = 48000;
-        audio_channels = 2;
-
-    } else {
-        fprintf(stderr, "Unknown target: %s\n", arg);
-        av_exit(1);
-    }
-}
-
-static void opt_vstats_file (const char *arg)
-{
-    av_free (vstats_filename);
-    vstats_filename=av_strdup (arg);
-}
-
-static void opt_vstats (void)
-{
-    char filename[40];
-    time_t today2 = time(NULL);
-    struct tm *today = localtime(&today2);
-
-    snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
-             today->tm_sec);
-    opt_vstats_file(filename);
-}
-
-static int opt_bsf(const char *opt, const char *arg)
-{
-    AVBitStreamFilterContext *bsfc= av_bitstream_filter_init(arg); //FIXME split name and args for filter at '='
-    AVBitStreamFilterContext **bsfp;
-
-    if(!bsfc){
-        fprintf(stderr, "Unknown bitstream filter %s\n", arg);
-        av_exit(1);
-    }
-
-    bsfp= *opt == 'v' ? &video_bitstream_filters :
-          *opt == 'a' ? &audio_bitstream_filters :
-                        &subtitle_bitstream_filters;
-    while(*bsfp)
-        bsfp= &(*bsfp)->next;
-
-    *bsfp= bsfc;
-
-    return 0;
-}
-
-static int opt_preset(const char *opt, const char *arg)
-{
-    FILE *f=NULL;
-    char filename[1000], tmp[1000], tmp2[1000], line[1000];
-    int i;
-    const char *base[3]= { getenv("FFMPEG_DATADIR"),
-                           getenv("HOME"),
-                           FFMPEG_DATADIR,
-                         };
-
-    if (*opt != 'f') {
-        for(i=0; i<3 && !f; i++){
-            if(!base[i])
-                continue;
-            snprintf(filename, sizeof(filename), "%s%s/%s.ffpreset", base[i], i != 1 ? "" : "/.ffmpeg", arg);
-            f= fopen(filename, "r");
-            if(!f){
-                char *codec_name= *opt == 'v' ? video_codec_name :
-                                  *opt == 'a' ? audio_codec_name :
-                                                subtitle_codec_name;
-                snprintf(filename, sizeof(filename), "%s%s/%s-%s.ffpreset", base[i],  i != 1 ? "" : "/.ffmpeg", codec_name, arg);
-                f= fopen(filename, "r");
-            }
-        }
-    } else {
-        av_strlcpy(filename, arg, sizeof(filename));
-        f= fopen(filename, "r");
-    }
-
-    if(!f){
-        fprintf(stderr, "File for preset '%s' not found\n", arg);
-        av_exit(1);
-    }
-
-    while(!feof(f)){
-        int e= fscanf(f, "%999[^\n]\n", line) - 1;
-        if(line[0] == '#' && !e)
-            continue;
-        e|= sscanf(line, "%999[^=]=%999[^\n]\n", tmp, tmp2) - 2;
-        if(e){
-            fprintf(stderr, "%s: Invalid syntax: '%s'\n", filename, line);
-            av_exit(1);
-        }
-        if(!strcmp(tmp, "acodec")){
-            opt_audio_codec(tmp2);
-        }else if(!strcmp(tmp, "vcodec")){
-            opt_video_codec(tmp2);
-        }else if(!strcmp(tmp, "scodec")){
-            opt_subtitle_codec(tmp2);
-        }else if(opt_default(tmp, tmp2) < 0){
-            fprintf(stderr, "%s: Invalid option or argument: '%s', parsed as '%s' = '%s'\n", filename, line, tmp, tmp2);
-            av_exit(1);
-        }
-    }
-
-    fclose(f);
-
-    return 0;
-}
-
-static const OptionDef options[] = {
-    /* main options */
-#include "cmdutils_common_opts.h"
-    { "f", HAS_ARG, {(void*)opt_format}, "force format", "fmt" },
-    { "i", HAS_ARG, {(void*)opt_input_file}, "input file name", "filename" },
-    { "y", OPT_BOOL, {(void*)&file_overwrite}, "overwrite output files" },
-    { "map", HAS_ARG | OPT_EXPERT, {(void*)opt_map}, "set input stream mapping", "file:stream[:syncfile:syncstream]" },
-    { "map_meta_data", HAS_ARG | OPT_EXPERT, {(void*)opt_map_meta_data}, "set meta data information of outfile from infile", "outfile:infile" },
-    { "t", OPT_FUNC2 | HAS_ARG, {(void*)opt_recording_time}, "record or transcode \"duration\" seconds of audio/video", "duration" },
-    { "fs", HAS_ARG | OPT_INT64, {(void*)&limit_filesize}, "set the limit file size in bytes", "limit_size" }, //
-    { "ss", OPT_FUNC2 | HAS_ARG, {(void*)opt_start_time}, "set the start time offset", "time_off" },
-    { "itsoffset", OPT_FUNC2 | HAS_ARG, {(void*)opt_input_ts_offset}, "set the input ts offset", "time_off" },
-    { "itsscale", HAS_ARG, {(void*)opt_input_ts_scale}, "set the input ts scale", "stream:scale" },
-    { "timestamp", OPT_FUNC2 | HAS_ARG, {(void*)opt_rec_timestamp}, "set the timestamp ('now' to set the current time)", "time" },
-    { "metadata", OPT_FUNC2 | HAS_ARG, {(void*)opt_metadata}, "add metadata", "string=string" },
-    { "dframes", OPT_INT | HAS_ARG, {(void*)&max_frames[AVMEDIA_TYPE_DATA]}, "set the number of data frames to record", "number" },
-    { "benchmark", OPT_BOOL | OPT_EXPERT, {(void*)&do_benchmark},
-      "add timings for benchmarking" },
-    { "timelimit", OPT_FUNC2 | HAS_ARG, {(void*)opt_timelimit}, "set max runtime in seconds", "limit" },
-    { "dump", OPT_BOOL | OPT_EXPERT, {(void*)&do_pkt_dump},
-      "dump each input packet" },
-    { "hex", OPT_BOOL | OPT_EXPERT, {(void*)&do_hex_dump},
-      "when dumping packets, also dump the payload" },
-    { "re", OPT_BOOL | OPT_EXPERT, {(void*)&rate_emu}, "read input at native frame rate", "" },
-    { "loop_input", OPT_BOOL | OPT_EXPERT, {(void*)&loop_input}, "loop (current only works with images)" },
-    { "loop_output", HAS_ARG | OPT_INT | OPT_EXPERT, {(void*)&loop_output}, "number of times to loop output in formats that support looping (0 loops forever)", "" },
-    { "v", HAS_ARG | OPT_FUNC2, {(void*)opt_verbose}, "set ffmpeg verbosity level", "number" },
-    { "target", HAS_ARG, {(void*)opt_target}, "specify target file type (\"vcd\", \"svcd\", \"dvd\", \"dv\", \"dv50\", \"pal-vcd\", \"ntsc-svcd\", ...)", "type" },
-    { "threads", OPT_FUNC2 | HAS_ARG | OPT_EXPERT, {(void*)opt_thread_count}, "thread count", "count" },
-    { "vsync", HAS_ARG | OPT_INT | OPT_EXPERT, {(void*)&video_sync_method}, "video sync method", "" },
-    { "async", HAS_ARG | OPT_INT | OPT_EXPERT, {(void*)&audio_sync_method}, "audio sync method", "" },
-    { "adrift_threshold", HAS_ARG | OPT_FLOAT | OPT_EXPERT, {(void*)&audio_drift_threshold}, "audio drift threshold", "threshold" },
-    { "vglobal", HAS_ARG | OPT_INT | OPT_EXPERT, {(void*)&video_global_header}, "video global header storage type", "" },
-    { "copyts", OPT_BOOL | OPT_EXPERT, {(void*)&copy_ts}, "copy timestamps" },
-    { "shortest", OPT_BOOL | OPT_EXPERT, {(void*)&opt_shortest}, "finish encoding within shortest input" }, //
-    { "dts_delta_threshold", HAS_ARG | OPT_FLOAT | OPT_EXPERT, {(void*)&dts_delta_threshold}, "timestamp discontinuity delta threshold", "threshold" },
-    { "programid", HAS_ARG | OPT_INT | OPT_EXPERT, {(void*)&opt_programid}, "desired program number", "" },
-    { "xerror", OPT_BOOL, {(void*)&exit_on_error}, "exit on error", "error" },
-    { "copyinkf", OPT_BOOL | OPT_EXPERT, {(void*)&copy_initial_nonkeyframes}, "copy initial non-keyframes" },
-
-    /* video options */
-    { "b", OPT_FUNC2 | HAS_ARG | OPT_VIDEO, {(void*)opt_bitrate}, "set bitrate (in bits/s)", "bitrate" },
-    { "vb", OPT_FUNC2 | HAS_ARG | OPT_VIDEO, {(void*)opt_bitrate}, "set bitrate (in bits/s)", "bitrate" },
-    { "vframes", OPT_INT | HAS_ARG | OPT_VIDEO, {(void*)&max_frames[AVMEDIA_TYPE_VIDEO]}, "set the number of video frames to record", "number" },
-    { "r", OPT_FUNC2 | HAS_ARG | OPT_VIDEO, {(void*)opt_frame_rate}, "set frame rate (Hz value, fraction or abbreviation)", "rate" },
-    { "s", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_size}, "set frame size (WxH or abbreviation)", "size" },
-    { "aspect", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_aspect_ratio}, "set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)", "aspect" },
-    { "pix_fmt", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_frame_pix_fmt}, "set pixel format, 'list' as argument shows all the pixel formats supported", "format" },
-    { "croptop", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_crop_top}, "set top crop band size (in pixels)", "size" },
-    { "cropbottom", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_crop_bottom}, "set bottom crop band size (in pixels)", "size" },
-    { "cropleft", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_crop_left}, "set left crop band size (in pixels)", "size" },
-    { "cropright", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_crop_right}, "set right crop band size (in pixels)", "size" },
-    { "padtop", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_pad_top}, "set top pad band size (in pixels)", "size" },
-    { "padbottom", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_pad_bottom}, "set bottom pad band size (in pixels)", "size" },
-    { "padleft", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_pad_left}, "set left pad band size (in pixels)", "size" },
-    { "padright", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_pad_right}, "set right pad band size (in pixels)", "size" },
-    { "padcolor", HAS_ARG | OPT_VIDEO, {(void*)opt_pad_color}, "set color of pad bands (Hex 000000 thru FFFFFF)", "color" },
-    { "intra", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&intra_only}, "use only intra frames"},
-    { "vn", OPT_BOOL | OPT_VIDEO, {(void*)&video_disable}, "disable video" },
-    { "vdt", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)&video_discard}, "discard threshold", "n" },
-    { "qscale", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_qscale}, "use fixed video quantizer scale (VBR)", "q" },
-    { "rc_override", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_video_rc_override_string}, "rate control override for specific intervals", "override" },
-    { "vcodec", HAS_ARG | OPT_VIDEO, {(void*)opt_video_codec}, "force video codec ('copy' to copy stream)", "codec" },
-    { "me_threshold", HAS_ARG | OPT_FUNC2 | OPT_EXPERT | OPT_VIDEO, {(void*)opt_me_threshold}, "motion estimaton threshold",  "threshold" },
-    { "sameq", OPT_BOOL | OPT_VIDEO, {(void*)&same_quality},
-      "use same video quality as source (implies VBR)" },
-    { "pass", HAS_ARG | OPT_VIDEO, {(void*)&opt_pass}, "select the pass number (1 or 2)", "n" },
-    { "passlogfile", HAS_ARG | OPT_STRING | OPT_VIDEO, {(void*)&pass_logfilename_prefix}, "select two pass log file name prefix", "prefix" },
-    { "deinterlace", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&do_deinterlace},
-      "deinterlace pictures" },
-    { "psnr", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&do_psnr}, "calculate PSNR of compressed frames" },
-    { "vstats", OPT_EXPERT | OPT_VIDEO, {(void*)&opt_vstats}, "dump video coding statistics to file" },
-    { "vstats_file", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_vstats_file}, "dump video coding statistics to file", "file" },
-    { "intra_matrix", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_intra_matrix}, "specify intra matrix coeffs", "matrix" },
-    { "inter_matrix", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_inter_matrix}, "specify inter matrix coeffs", "matrix" },
-    { "top", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_top_field_first}, "top=1/bottom=0/auto=-1 field first", "" },
-    { "dc", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)&intra_dc_precision}, "intra_dc_precision", "precision" },
-    { "vtag", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_video_tag}, "force video tag/fourcc", "fourcc/tag" },
-    { "newvideo", OPT_VIDEO, {(void*)opt_new_video_stream}, "add a new video stream to the current output stream" },
-    { "vlang", HAS_ARG | OPT_STRING | OPT_VIDEO, {(void *)&video_language}, "set the ISO 639 language code (3 letters) of the current video stream" , "code" },
-    { "qphist", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, { (void *)&qp_hist }, "show QP histogram" },
-    { "force_fps", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&force_fps}, "force the selected framerate, disable the best supported framerate selection" },
-
-    /* audio options */
-    { "ab", OPT_FUNC2 | HAS_ARG | OPT_AUDIO, {(void*)opt_bitrate}, "set bitrate (in bits/s)", "bitrate" },
-    { "aframes", OPT_INT | HAS_ARG | OPT_AUDIO, {(void*)&max_frames[AVMEDIA_TYPE_AUDIO]}, "set the number of audio frames to record", "number" },
-    { "aq", OPT_FLOAT | HAS_ARG | OPT_AUDIO, {(void*)&audio_qscale}, "set audio quality (codec-specific)", "quality", },
-    { "ar", HAS_ARG | OPT_FUNC2 | OPT_AUDIO, {(void*)opt_audio_rate}, "set audio sampling rate (in Hz)", "rate" },
-    { "ac", HAS_ARG | OPT_FUNC2 | OPT_AUDIO, {(void*)opt_audio_channels}, "set number of audio channels", "channels" },
-    { "an", OPT_BOOL | OPT_AUDIO, {(void*)&audio_disable}, "disable audio" },
-    { "acodec", HAS_ARG | OPT_AUDIO, {(void*)opt_audio_codec}, "force audio codec ('copy' to copy stream)", "codec" },
-    { "atag", HAS_ARG | OPT_EXPERT | OPT_AUDIO, {(void*)opt_audio_tag}, "force audio tag/fourcc", "fourcc/tag" },
-    { "vol", OPT_INT | HAS_ARG | OPT_AUDIO, {(void*)&audio_volume}, "change audio volume (256=normal)" , "volume" }, //
-    { "newaudio", OPT_AUDIO, {(void*)opt_new_audio_stream}, "add a new audio stream to the current output stream" },
-    { "alang", HAS_ARG | OPT_STRING | OPT_AUDIO, {(void *)&audio_language}, "set the ISO 639 language code (3 letters) of the current audio stream" , "code" },
-    { "sample_fmt", HAS_ARG | OPT_EXPERT | OPT_AUDIO, {(void*)opt_audio_sample_fmt}, "set sample format, 'list' as argument shows all the sample formats supported", "format" },
-
-    /* subtitle options */
-    { "sn", OPT_BOOL | OPT_SUBTITLE, {(void*)&subtitle_disable}, "disable subtitle" },
-    { "scodec", HAS_ARG | OPT_SUBTITLE, {(void*)opt_subtitle_codec}, "force subtitle codec ('copy' to copy stream)", "codec" },
-    { "newsubtitle", OPT_SUBTITLE, {(void*)opt_new_subtitle_stream}, "add a new subtitle stream to the current output stream" },
-    { "slang", HAS_ARG | OPT_STRING | OPT_SUBTITLE, {(void *)&subtitle_language}, "set the ISO 639 language code (3 letters) of the current subtitle stream" , "code" },
-    { "stag", HAS_ARG | OPT_EXPERT | OPT_SUBTITLE, {(void*)opt_subtitle_tag}, "force subtitle tag/fourcc", "fourcc/tag" },
-
-    /* grab options */
-    { "vc", HAS_ARG | OPT_EXPERT | OPT_VIDEO | OPT_GRAB, {(void*)opt_video_channel}, "set video grab channel (DV1394 only)", "channel" },
-    { "tvstd", HAS_ARG | OPT_EXPERT | OPT_VIDEO | OPT_GRAB, {(void*)opt_video_standard}, "set television standard (NTSC, PAL (SECAM))", "standard" },
-    { "isync", OPT_BOOL | OPT_EXPERT | OPT_GRAB, {(void*)&input_sync}, "sync read on input", "" },
-
-    /* muxer options */
-    { "muxdelay", OPT_FLOAT | HAS_ARG | OPT_EXPERT, {(void*)&mux_max_delay}, "set the maximum demux-decode delay", "seconds" },
-    { "muxpreload", OPT_FLOAT | HAS_ARG | OPT_EXPERT, {(void*)&mux_preload}, "set the initial demux-decode delay", "seconds" },
-
-    { "absf", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_EXPERT, {(void*)opt_bsf}, "", "bitstream_filter" },
-    { "vbsf", OPT_FUNC2 | HAS_ARG | OPT_VIDEO | OPT_EXPERT, {(void*)opt_bsf}, "", "bitstream_filter" },
-    { "sbsf", OPT_FUNC2 | HAS_ARG | OPT_SUBTITLE | OPT_EXPERT, {(void*)opt_bsf}, "", "bitstream_filter" },
-
-    { "apre", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_EXPERT, {(void*)opt_preset}, "set the audio options to the indicated preset", "preset" },
-    { "vpre", OPT_FUNC2 | HAS_ARG | OPT_VIDEO | OPT_EXPERT, {(void*)opt_preset}, "set the video options to the indicated preset", "preset" },
-    { "spre", OPT_FUNC2 | HAS_ARG | OPT_SUBTITLE | OPT_EXPERT, {(void*)opt_preset}, "set the subtitle options to the indicated preset", "preset" },
-    { "fpre", OPT_FUNC2 | HAS_ARG | OPT_EXPERT, {(void*)opt_preset}, "set options from indicated preset file", "filename" },
-
-    { "default", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
-    { NULL, },
-};
-
-int main(int argc, char **argv)
-{
-    int i;
-    int64_t ti;
-
-    avcodec_register_all();
-#if CONFIG_AVDEVICE
-    avdevice_register_all();
-#endif
-    av_register_all();
-
-#if HAVE_ISATTY
-    if(isatty(STDIN_FILENO))
-        url_set_interrupt_cb(decode_interrupt_cb);
-#endif
-
-    for(i=0; i<AVMEDIA_TYPE_NB; i++){
-        avcodec_opts[i]= avcodec_alloc_context2(i);
-    }
-    avformat_opts = avformat_alloc_context();
-    sws_opts = sws_getContext(16,16,0, 16,16,0, sws_flags, NULL,NULL,NULL);
-
-    show_banner();
-
-    /* parse options */
-    parse_options(argc, argv, options, opt_output_file);
-
-    if(nb_output_files <= 0 && nb_input_files == 0) {
-        show_usage();
-        fprintf(stderr, "Use -h to get full help or, even better, run 'man ffmpeg'\n");
-        av_exit(1);
-    }
-
-    /* file converter / grab */
-    if (nb_output_files <= 0) {
-        fprintf(stderr, "At least one output file must be specified\n");
-        av_exit(1);
-    }
-
-    if (nb_input_files == 0) {
-        fprintf(stderr, "At least one input file must be specified\n");
-        av_exit(1);
-    }
-
-    ti = getutime();
-    if (av_transcode(output_files, nb_output_files, input_files, nb_input_files,
-                     stream_maps, nb_stream_maps) < 0)
-        av_exit(1);
-    ti = getutime() - ti;
-    if (do_benchmark) {
-        int maxrss = getmaxrss() / 1024;
-        printf("bench: utime=%0.3fs maxrss=%ikB\n", ti / 1000000.0, maxrss);
-    }
-
-    return av_exit(0);
-}
diff --git a/ffplay.c b/ffplay.c
deleted file mode 100644
index e79e17b..0000000
--- a/ffplay.c
+++ /dev/null
@@ -1,3166 +0,0 @@
-/*
- * FFplay : Simple Media Player based on the FFmpeg libraries
- * Copyright (c) 2003 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include <inttypes.h>
-#include <math.h>
-#include <limits.h>
-#include "libavutil/avstring.h"
-#include "libavutil/pixdesc.h"
-#include "libavformat/avformat.h"
-#include "libavdevice/avdevice.h"
-#include "libswscale/swscale.h"
-#include "libavcodec/audioconvert.h"
-#include "libavcodec/colorspace.h"
-#include "libavcodec/opt.h"
-#include "libavcodec/avfft.h"
-
-#if CONFIG_AVFILTER
-# include "libavfilter/avfilter.h"
-# include "libavfilter/avfiltergraph.h"
-# include "libavfilter/graphparser.h"
-#endif
-
-#include "cmdutils.h"
-
-#include <SDL.h>
-#include <SDL_thread.h>
-
-#ifdef __MINGW32__
-#undef main /* We don't want SDL to override our main() */
-#endif
-
-#include <unistd.h>
-#include <assert.h>
-
-const char program_name[] = "FFplay";
-const int program_birth_year = 2003;
-
-//#define DEBUG_SYNC
-
-#define MAX_QUEUE_SIZE (15 * 1024 * 1024)
-#define MIN_AUDIOQ_SIZE (20 * 16 * 1024)
-#define MIN_FRAMES 5
-
-/* SDL audio buffer size, in samples. Should be small to have precise
-   A/V sync as SDL does not have hardware buffer fullness info. */
-#define SDL_AUDIO_BUFFER_SIZE 1024
-
-/* no AV sync correction is done if below the AV sync threshold */
-#define AV_SYNC_THRESHOLD 0.01
-/* no AV correction is done if too big error */
-#define AV_NOSYNC_THRESHOLD 10.0
-
-#define FRAME_SKIP_FACTOR 0.05
-
-/* maximum audio speed change to get correct sync */
-#define SAMPLE_CORRECTION_PERCENT_MAX 10
-
-/* we use about AUDIO_DIFF_AVG_NB A-V differences to make the average */
-#define AUDIO_DIFF_AVG_NB   20
-
-/* NOTE: the size must be big enough to compensate the hardware audio buffersize size */
-#define SAMPLE_ARRAY_SIZE (2*65536)
-
-#if !CONFIG_AVFILTER
-static int sws_flags = SWS_BICUBIC;
-#endif
-
-typedef struct PacketQueue {
-    AVPacketList *first_pkt, *last_pkt;
-    int nb_packets;
-    int size;
-    int abort_request;
-    SDL_mutex *mutex;
-    SDL_cond *cond;
-} PacketQueue;
-
-#define VIDEO_PICTURE_QUEUE_SIZE 2
-#define SUBPICTURE_QUEUE_SIZE 4
-
-typedef struct VideoPicture {
-    double pts;                                  ///<presentation time stamp for this picture
-    double target_clock;                         ///<av_gettime() time at which this should be displayed ideally
-    int64_t pos;                                 ///<byte position in file
-    SDL_Overlay *bmp;
-    int width, height; /* source height & width */
-    int allocated;
-    enum PixelFormat pix_fmt;
-
-#if CONFIG_AVFILTER
-    AVFilterPicRef *picref;
-#endif
-} VideoPicture;
-
-typedef struct SubPicture {
-    double pts; /* presentation time stamp for this picture */
-    AVSubtitle sub;
-} SubPicture;
-
-enum {
-    AV_SYNC_AUDIO_MASTER, /* default choice */
-    AV_SYNC_VIDEO_MASTER,
-    AV_SYNC_EXTERNAL_CLOCK, /* synchronize to an external clock */
-};
-
-typedef struct VideoState {
-    SDL_Thread *parse_tid;
-    SDL_Thread *video_tid;
-    SDL_Thread *refresh_tid;
-    AVInputFormat *iformat;
-    int no_background;
-    int abort_request;
-    int paused;
-    int last_paused;
-    int seek_req;
-    int seek_flags;
-    int64_t seek_pos;
-    int64_t seek_rel;
-    int read_pause_return;
-    AVFormatContext *ic;
-    int dtg_active_format;
-
-    int audio_stream;
-
-    int av_sync_type;
-    double external_clock; /* external clock base */
-    int64_t external_clock_time;
-
-    double audio_clock;
-    double audio_diff_cum; /* used for AV difference average computation */
-    double audio_diff_avg_coef;
-    double audio_diff_threshold;
-    int audio_diff_avg_count;
-    AVStream *audio_st;
-    PacketQueue audioq;
-    int audio_hw_buf_size;
-    /* samples output by the codec. we reserve more space for avsync
-       compensation */
-    DECLARE_ALIGNED(16,uint8_t,audio_buf1)[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2];
-    DECLARE_ALIGNED(16,uint8_t,audio_buf2)[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2];
-    uint8_t *audio_buf;
-    unsigned int audio_buf_size; /* in bytes */
-    int audio_buf_index; /* in bytes */
-    AVPacket audio_pkt_temp;
-    AVPacket audio_pkt;
-    enum SampleFormat audio_src_fmt;
-    AVAudioConvert *reformat_ctx;
-
-    int show_audio; /* if true, display audio samples */
-    int16_t sample_array[SAMPLE_ARRAY_SIZE];
-    int sample_array_index;
-    int last_i_start;
-    RDFTContext *rdft;
-    int rdft_bits;
-    int xpos;
-
-    SDL_Thread *subtitle_tid;
-    int subtitle_stream;
-    int subtitle_stream_changed;
-    AVStream *subtitle_st;
-    PacketQueue subtitleq;
-    SubPicture subpq[SUBPICTURE_QUEUE_SIZE];
-    int subpq_size, subpq_rindex, subpq_windex;
-    SDL_mutex *subpq_mutex;
-    SDL_cond *subpq_cond;
-
-    double frame_timer;
-    double frame_last_pts;
-    double frame_last_delay;
-    double video_clock;                          ///<pts of last decoded frame / predicted pts of next decoded frame
-    int video_stream;
-    AVStream *video_st;
-    PacketQueue videoq;
-    double video_current_pts;                    ///<current displayed pts (different from video_clock if frame fifos are used)
-    double video_current_pts_drift;              ///<video_current_pts - time (av_gettime) at which we updated video_current_pts - used to have running video pts
-    int64_t video_current_pos;                   ///<current displayed file pos
-    VideoPicture pictq[VIDEO_PICTURE_QUEUE_SIZE];
-    int pictq_size, pictq_rindex, pictq_windex;
-    SDL_mutex *pictq_mutex;
-    SDL_cond *pictq_cond;
-#if !CONFIG_AVFILTER
-    struct SwsContext *img_convert_ctx;
-#endif
-
-    //    QETimer *video_timer;
-    char filename[1024];
-    int width, height, xleft, ytop;
-
-    int64_t faulty_pts;
-    int64_t faulty_dts;
-    int64_t last_dts_for_fault_detection;
-    int64_t last_pts_for_fault_detection;
-
-#if CONFIG_AVFILTER
-    AVFilterContext *out_video_filter;          ///<the last filter in the video chain
-#endif
-
-    float skip_frames;
-    float skip_frames_index;
-    int refresh;
-} VideoState;
-
-static void show_help(void);
-static int audio_write_get_buf_size(VideoState *is);
-
-/* options specified by the user */
-static AVInputFormat *file_iformat;
-static const char *input_filename;
-static const char *window_title;
-static int fs_screen_width;
-static int fs_screen_height;
-static int screen_width = 0;
-static int screen_height = 0;
-static int frame_width = 0;
-static int frame_height = 0;
-static enum PixelFormat frame_pix_fmt = PIX_FMT_NONE;
-static int audio_disable;
-static int video_disable;
-static int wanted_stream[AVMEDIA_TYPE_NB]={
-    [AVMEDIA_TYPE_AUDIO]=-1,
-    [AVMEDIA_TYPE_VIDEO]=-1,
-    [AVMEDIA_TYPE_SUBTITLE]=-1,
-};
-static int seek_by_bytes=-1;
-static int display_disable;
-static int show_status = 1;
-static int av_sync_type = AV_SYNC_AUDIO_MASTER;
-static int64_t start_time = AV_NOPTS_VALUE;
-static int64_t duration = AV_NOPTS_VALUE;
-static int debug = 0;
-static int debug_mv = 0;
-static int step = 0;
-static int thread_count = 1;
-static int workaround_bugs = 1;
-static int fast = 0;
-static int genpts = 0;
-static int lowres = 0;
-static int idct = FF_IDCT_AUTO;
-static enum AVDiscard skip_frame= AVDISCARD_DEFAULT;
-static enum AVDiscard skip_idct= AVDISCARD_DEFAULT;
-static enum AVDiscard skip_loop_filter= AVDISCARD_DEFAULT;
-static int error_recognition = FF_ER_CAREFUL;
-static int error_concealment = 3;
-static int decoder_reorder_pts= -1;
-static int autoexit;
-static int loop=1;
-static int framedrop=1;
-
-static int rdftspeed=20;
-#if CONFIG_AVFILTER
-static char *vfilters = NULL;
-#endif
-
-/* current context */
-static int is_full_screen;
-static VideoState *cur_stream;
-static int64_t audio_callback_time;
-
-static AVPacket flush_pkt;
-
-#define FF_ALLOC_EVENT   (SDL_USEREVENT)
-#define FF_REFRESH_EVENT (SDL_USEREVENT + 1)
-#define FF_QUIT_EVENT    (SDL_USEREVENT + 2)
-
-static SDL_Surface *screen;
-
-static int packet_queue_put(PacketQueue *q, AVPacket *pkt);
-
-/* packet queue handling */
-static void packet_queue_init(PacketQueue *q)
-{
-    memset(q, 0, sizeof(PacketQueue));
-    q->mutex = SDL_CreateMutex();
-    q->cond = SDL_CreateCond();
-    packet_queue_put(q, &flush_pkt);
-}
-
-static void packet_queue_flush(PacketQueue *q)
-{
-    AVPacketList *pkt, *pkt1;
-
-    SDL_LockMutex(q->mutex);
-    for(pkt = q->first_pkt; pkt != NULL; pkt = pkt1) {
-        pkt1 = pkt->next;
-        av_free_packet(&pkt->pkt);
-        av_freep(&pkt);
-    }
-    q->last_pkt = NULL;
-    q->first_pkt = NULL;
-    q->nb_packets = 0;
-    q->size = 0;
-    SDL_UnlockMutex(q->mutex);
-}
-
-static void packet_queue_end(PacketQueue *q)
-{
-    packet_queue_flush(q);
-    SDL_DestroyMutex(q->mutex);
-    SDL_DestroyCond(q->cond);
-}
-
-static int packet_queue_put(PacketQueue *q, AVPacket *pkt)
-{
-    AVPacketList *pkt1;
-
-    /* duplicate the packet */
-    if (pkt!=&flush_pkt && av_dup_packet(pkt) < 0)
-        return -1;
-
-    pkt1 = av_malloc(sizeof(AVPacketList));
-    if (!pkt1)
-        return -1;
-    pkt1->pkt = *pkt;
-    pkt1->next = NULL;
-
-
-    SDL_LockMutex(q->mutex);
-
-    if (!q->last_pkt)
-
-        q->first_pkt = pkt1;
-    else
-        q->last_pkt->next = pkt1;
-    q->last_pkt = pkt1;
-    q->nb_packets++;
-    q->size += pkt1->pkt.size + sizeof(*pkt1);
-    /* XXX: should duplicate packet data in DV case */
-    SDL_CondSignal(q->cond);
-
-    SDL_UnlockMutex(q->mutex);
-    return 0;
-}
-
-static void packet_queue_abort(PacketQueue *q)
-{
-    SDL_LockMutex(q->mutex);
-
-    q->abort_request = 1;
-
-    SDL_CondSignal(q->cond);
-
-    SDL_UnlockMutex(q->mutex);
-}
-
-/* return < 0 if aborted, 0 if no packet and > 0 if packet.  */
-static int packet_queue_get(PacketQueue *q, AVPacket *pkt, int block)
-{
-    AVPacketList *pkt1;
-    int ret;
-
-    SDL_LockMutex(q->mutex);
-
-    for(;;) {
-        if (q->abort_request) {
-            ret = -1;
-            break;
-        }
-
-        pkt1 = q->first_pkt;
-        if (pkt1) {
-            q->first_pkt = pkt1->next;
-            if (!q->first_pkt)
-                q->last_pkt = NULL;
-            q->nb_packets--;
-            q->size -= pkt1->pkt.size + sizeof(*pkt1);
-            *pkt = pkt1->pkt;
-            av_free(pkt1);
-            ret = 1;
-            break;
-        } else if (!block) {
-            ret = 0;
-            break;
-        } else {
-            SDL_CondWait(q->cond, q->mutex);
-        }
-    }
-    SDL_UnlockMutex(q->mutex);
-    return ret;
-}
-
-static inline void fill_rectangle(SDL_Surface *screen,
-                                  int x, int y, int w, int h, int color)
-{
-    SDL_Rect rect;
-    rect.x = x;
-    rect.y = y;
-    rect.w = w;
-    rect.h = h;
-    SDL_FillRect(screen, &rect, color);
-}
-
-#if 0
-/* draw only the border of a rectangle */
-void fill_border(VideoState *s, int x, int y, int w, int h, int color)
-{
-    int w1, w2, h1, h2;
-
-    /* fill the background */
-    w1 = x;
-    if (w1 < 0)
-        w1 = 0;
-    w2 = s->width - (x + w);
-    if (w2 < 0)
-        w2 = 0;
-    h1 = y;
-    if (h1 < 0)
-        h1 = 0;
-    h2 = s->height - (y + h);
-    if (h2 < 0)
-        h2 = 0;
-    fill_rectangle(screen,
-                   s->xleft, s->ytop,
-                   w1, s->height,
-                   color);
-    fill_rectangle(screen,
-                   s->xleft + s->width - w2, s->ytop,
-                   w2, s->height,
-                   color);
-    fill_rectangle(screen,
-                   s->xleft + w1, s->ytop,
-                   s->width - w1 - w2, h1,
-                   color);
-    fill_rectangle(screen,
-                   s->xleft + w1, s->ytop + s->height - h2,
-                   s->width - w1 - w2, h2,
-                   color);
-}
-#endif
-
-#define ALPHA_BLEND(a, oldp, newp, s)\
-((((oldp << s) * (255 - (a))) + (newp * (a))) / (255 << s))
-
-#define RGBA_IN(r, g, b, a, s)\
-{\
-    unsigned int v = ((const uint32_t *)(s))[0];\
-    a = (v >> 24) & 0xff;\
-    r = (v >> 16) & 0xff;\
-    g = (v >> 8) & 0xff;\
-    b = v & 0xff;\
-}
-
-#define YUVA_IN(y, u, v, a, s, pal)\
-{\
-    unsigned int val = ((const uint32_t *)(pal))[*(const uint8_t*)(s)];\
-    a = (val >> 24) & 0xff;\
-    y = (val >> 16) & 0xff;\
-    u = (val >> 8) & 0xff;\
-    v = val & 0xff;\
-}
-
-#define YUVA_OUT(d, y, u, v, a)\
-{\
-    ((uint32_t *)(d))[0] = (a << 24) | (y << 16) | (u << 8) | v;\
-}
-
-
-#define BPP 1
-
-static void blend_subrect(AVPicture *dst, const AVSubtitleRect *rect, int imgw, int imgh)
-{
-    int wrap, wrap3, width2, skip2;
-    int y, u, v, a, u1, v1, a1, w, h;
-    uint8_t *lum, *cb, *cr;
-    const uint8_t *p;
-    const uint32_t *pal;
-    int dstx, dsty, dstw, dsth;
-
-    dstw = av_clip(rect->w, 0, imgw);
-    dsth = av_clip(rect->h, 0, imgh);
-    dstx = av_clip(rect->x, 0, imgw - dstw);
-    dsty = av_clip(rect->y, 0, imgh - dsth);
-    lum = dst->data[0] + dsty * dst->linesize[0];
-    cb = dst->data[1] + (dsty >> 1) * dst->linesize[1];
-    cr = dst->data[2] + (dsty >> 1) * dst->linesize[2];
-
-    width2 = ((dstw + 1) >> 1) + (dstx & ~dstw & 1);
-    skip2 = dstx >> 1;
-    wrap = dst->linesize[0];
-    wrap3 = rect->pict.linesize[0];
-    p = rect->pict.data[0];
-    pal = (const uint32_t *)rect->pict.data[1];  /* Now in YCrCb! */
-
-    if (dsty & 1) {
-        lum += dstx;
-        cb += skip2;
-        cr += skip2;
-
-        if (dstx & 1) {
-            YUVA_IN(y, u, v, a, p, pal);
-            lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
-            cb[0] = ALPHA_BLEND(a >> 2, cb[0], u, 0);
-            cr[0] = ALPHA_BLEND(a >> 2, cr[0], v, 0);
-            cb++;
-            cr++;
-            lum++;
-            p += BPP;
-        }
-        for(w = dstw - (dstx & 1); w >= 2; w -= 2) {
-            YUVA_IN(y, u, v, a, p, pal);
-            u1 = u;
-            v1 = v;
-            a1 = a;
-            lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
-
-            YUVA_IN(y, u, v, a, p + BPP, pal);
-            u1 += u;
-            v1 += v;
-            a1 += a;
-            lum[1] = ALPHA_BLEND(a, lum[1], y, 0);
-            cb[0] = ALPHA_BLEND(a1 >> 2, cb[0], u1, 1);
-            cr[0] = ALPHA_BLEND(a1 >> 2, cr[0], v1, 1);
-            cb++;
-            cr++;
-            p += 2 * BPP;
-            lum += 2;
-        }
-        if (w) {
-            YUVA_IN(y, u, v, a, p, pal);
-            lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
-            cb[0] = ALPHA_BLEND(a >> 2, cb[0], u, 0);
-            cr[0] = ALPHA_BLEND(a >> 2, cr[0], v, 0);
-            p++;
-            lum++;
-        }
-        p += wrap3 - dstw * BPP;
-        lum += wrap - dstw - dstx;
-        cb += dst->linesize[1] - width2 - skip2;
-        cr += dst->linesize[2] - width2 - skip2;
-    }
-    for(h = dsth - (dsty & 1); h >= 2; h -= 2) {
-        lum += dstx;
-        cb += skip2;
-        cr += skip2;
-
-        if (dstx & 1) {
-            YUVA_IN(y, u, v, a, p, pal);
-            u1 = u;
-            v1 = v;
-            a1 = a;
-            lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
-            p += wrap3;
-            lum += wrap;
-            YUVA_IN(y, u, v, a, p, pal);
-            u1 += u;
-            v1 += v;
-            a1 += a;
-            lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
-            cb[0] = ALPHA_BLEND(a1 >> 2, cb[0], u1, 1);
-            cr[0] = ALPHA_BLEND(a1 >> 2, cr[0], v1, 1);
-            cb++;
-            cr++;
-            p += -wrap3 + BPP;
-            lum += -wrap + 1;
-        }
-        for(w = dstw - (dstx & 1); w >= 2; w -= 2) {
-            YUVA_IN(y, u, v, a, p, pal);
-            u1 = u;
-            v1 = v;
-            a1 = a;
-            lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
-
-            YUVA_IN(y, u, v, a, p + BPP, pal);
-            u1 += u;
-            v1 += v;
-            a1 += a;
-            lum[1] = ALPHA_BLEND(a, lum[1], y, 0);
-            p += wrap3;
-            lum += wrap;
-
-            YUVA_IN(y, u, v, a, p, pal);
-            u1 += u;
-            v1 += v;
-            a1 += a;
-            lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
-
-            YUVA_IN(y, u, v, a, p + BPP, pal);
-            u1 += u;
-            v1 += v;
-            a1 += a;
-            lum[1] = ALPHA_BLEND(a, lum[1], y, 0);
-
-            cb[0] = ALPHA_BLEND(a1 >> 2, cb[0], u1, 2);
-            cr[0] = ALPHA_BLEND(a1 >> 2, cr[0], v1, 2);
-
-            cb++;
-            cr++;
-            p += -wrap3 + 2 * BPP;
-            lum += -wrap + 2;
-        }
-        if (w) {
-            YUVA_IN(y, u, v, a, p, pal);
-            u1 = u;
-            v1 = v;
-            a1 = a;
-            lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
-            p += wrap3;
-            lum += wrap;
-            YUVA_IN(y, u, v, a, p, pal);
-            u1 += u;
-            v1 += v;
-            a1 += a;
-            lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
-            cb[0] = ALPHA_BLEND(a1 >> 2, cb[0], u1, 1);
-            cr[0] = ALPHA_BLEND(a1 >> 2, cr[0], v1, 1);
-            cb++;
-            cr++;
-            p += -wrap3 + BPP;
-            lum += -wrap + 1;
-        }
-        p += wrap3 + (wrap3 - dstw * BPP);
-        lum += wrap + (wrap - dstw - dstx);
-        cb += dst->linesize[1] - width2 - skip2;
-        cr += dst->linesize[2] - width2 - skip2;
-    }
-    /* handle odd height */
-    if (h) {
-        lum += dstx;
-        cb += skip2;
-        cr += skip2;
-
-        if (dstx & 1) {
-            YUVA_IN(y, u, v, a, p, pal);
-            lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
-            cb[0] = ALPHA_BLEND(a >> 2, cb[0], u, 0);
-            cr[0] = ALPHA_BLEND(a >> 2, cr[0], v, 0);
-            cb++;
-            cr++;
-            lum++;
-            p += BPP;
-        }
-        for(w = dstw - (dstx & 1); w >= 2; w -= 2) {
-            YUVA_IN(y, u, v, a, p, pal);
-            u1 = u;
-            v1 = v;
-            a1 = a;
-            lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
-
-            YUVA_IN(y, u, v, a, p + BPP, pal);
-            u1 += u;
-            v1 += v;
-            a1 += a;
-            lum[1] = ALPHA_BLEND(a, lum[1], y, 0);
-            cb[0] = ALPHA_BLEND(a1 >> 2, cb[0], u, 1);
-            cr[0] = ALPHA_BLEND(a1 >> 2, cr[0], v, 1);
-            cb++;
-            cr++;
-            p += 2 * BPP;
-            lum += 2;
-        }
-        if (w) {
-            YUVA_IN(y, u, v, a, p, pal);
-            lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
-            cb[0] = ALPHA_BLEND(a >> 2, cb[0], u, 0);
-            cr[0] = ALPHA_BLEND(a >> 2, cr[0], v, 0);
-        }
-    }
-}
-
-static void free_subpicture(SubPicture *sp)
-{
-    int i;
-
-    for (i = 0; i < sp->sub.num_rects; i++)
-    {
-        av_freep(&sp->sub.rects[i]->pict.data[0]);
-        av_freep(&sp->sub.rects[i]->pict.data[1]);
-        av_freep(&sp->sub.rects[i]);
-    }
-
-    av_free(sp->sub.rects);
-
-    memset(&sp->sub, 0, sizeof(AVSubtitle));
-}
-
-static void video_image_display(VideoState *is)
-{
-    VideoPicture *vp;
-    SubPicture *sp;
-    AVPicture pict;
-    float aspect_ratio;
-    int width, height, x, y;
-    SDL_Rect rect;
-    int i;
-
-    vp = &is->pictq[is->pictq_rindex];
-    if (vp->bmp) {
-#if CONFIG_AVFILTER
-         if (vp->picref->pixel_aspect.num == 0)
-             aspect_ratio = 0;
-         else
-             aspect_ratio = av_q2d(vp->picref->pixel_aspect);
-#else
-
-        /* XXX: use variable in the frame */
-        if (is->video_st->sample_aspect_ratio.num)
-            aspect_ratio = av_q2d(is->video_st->sample_aspect_ratio);
-        else if (is->video_st->codec->sample_aspect_ratio.num)
-            aspect_ratio = av_q2d(is->video_st->codec->sample_aspect_ratio);
-        else
-            aspect_ratio = 0;
-#endif
-        if (aspect_ratio <= 0.0)
-            aspect_ratio = 1.0;
-        aspect_ratio *= (float)vp->width / (float)vp->height;
-        /* if an active format is indicated, then it overrides the
-           mpeg format */
-#if 0
-        if (is->video_st->codec->dtg_active_format != is->dtg_active_format) {
-            is->dtg_active_format = is->video_st->codec->dtg_active_format;
-            printf("dtg_active_format=%d\n", is->dtg_active_format);
-        }
-#endif
-#if 0
-        switch(is->video_st->codec->dtg_active_format) {
-        case FF_DTG_AFD_SAME:
-        default:
-            /* nothing to do */
-            break;
-        case FF_DTG_AFD_4_3:
-            aspect_ratio = 4.0 / 3.0;
-            break;
-        case FF_DTG_AFD_16_9:
-            aspect_ratio = 16.0 / 9.0;
-            break;
-        case FF_DTG_AFD_14_9:
-            aspect_ratio = 14.0 / 9.0;
-            break;
-        case FF_DTG_AFD_4_3_SP_14_9:
-            aspect_ratio = 14.0 / 9.0;
-            break;
-        case FF_DTG_AFD_16_9_SP_14_9:
-            aspect_ratio = 14.0 / 9.0;
-            break;
-        case FF_DTG_AFD_SP_4_3:
-            aspect_ratio = 4.0 / 3.0;
-            break;
-        }
-#endif
-
-        if (is->subtitle_st)
-        {
-            if (is->subpq_size > 0)
-            {
-                sp = &is->subpq[is->subpq_rindex];
-
-                if (vp->pts >= sp->pts + ((float) sp->sub.start_display_time / 1000))
-                {
-                    SDL_LockYUVOverlay (vp->bmp);
-
-                    pict.data[0] = vp->bmp->pixels[0];
-                    pict.data[1] = vp->bmp->pixels[2];
-                    pict.data[2] = vp->bmp->pixels[1];
-
-                    pict.linesize[0] = vp->bmp->pitches[0];
-                    pict.linesize[1] = vp->bmp->pitches[2];
-                    pict.linesize[2] = vp->bmp->pitches[1];
-
-                    for (i = 0; i < sp->sub.num_rects; i++)
-                        blend_subrect(&pict, sp->sub.rects[i],
-                                      vp->bmp->w, vp->bmp->h);
-
-                    SDL_UnlockYUVOverlay (vp->bmp);
-                }
-            }
-        }
-
-
-        /* XXX: we suppose the screen has a 1.0 pixel ratio */
-        height = is->height;
-        width = ((int)rint(height * aspect_ratio)) & ~1;
-        if (width > is->width) {
-            width = is->width;
-            height = ((int)rint(width / aspect_ratio)) & ~1;
-        }
-        x = (is->width - width) / 2;
-        y = (is->height - height) / 2;
-        if (!is->no_background) {
-            /* fill the background */
-            //            fill_border(is, x, y, width, height, QERGB(0x00, 0x00, 0x00));
-        } else {
-            is->no_background = 0;
-        }
-        rect.x = is->xleft + x;
-        rect.y = is->ytop  + y;
-        rect.w = width;
-        rect.h = height;
-        SDL_DisplayYUVOverlay(vp->bmp, &rect);
-    } else {
-#if 0
-        fill_rectangle(screen,
-                       is->xleft, is->ytop, is->width, is->height,
-                       QERGB(0x00, 0x00, 0x00));
-#endif
-    }
-}
-
-static inline int compute_mod(int a, int b)
-{
-    a = a % b;
-    if (a >= 0)
-        return a;
-    else
-        return a + b;
-}
-
-static void video_audio_display(VideoState *s)
-{
-    int i, i_start, x, y1, y, ys, delay, n, nb_display_channels;
-    int ch, channels, h, h2, bgcolor, fgcolor;
-    int16_t time_diff;
-    int rdft_bits, nb_freq;
-
-    for(rdft_bits=1; (1<<rdft_bits)<2*s->height; rdft_bits++)
-        ;
-    nb_freq= 1<<(rdft_bits-1);
-
-    /* compute display index : center on currently output samples */
-    channels = s->audio_st->codec->channels;
-    nb_display_channels = channels;
-    if (!s->paused) {
-        int data_used= s->show_audio==1 ? s->width : (2*nb_freq);
-        n = 2 * channels;
-        delay = audio_write_get_buf_size(s);
-        delay /= n;
-
-        /* to be more precise, we take into account the time spent since
-           the last buffer computation */
-        if (audio_callback_time) {
-            time_diff = av_gettime() - audio_callback_time;
-            delay -= (time_diff * s->audio_st->codec->sample_rate) / 1000000;
-        }
-
-        delay += 2*data_used;
-        if (delay < data_used)
-            delay = data_used;
-
-        i_start= x = compute_mod(s->sample_array_index - delay * channels, SAMPLE_ARRAY_SIZE);
-        if(s->show_audio==1){
-            h= INT_MIN;
-            for(i=0; i<1000; i+=channels){
-                int idx= (SAMPLE_ARRAY_SIZE + x - i) % SAMPLE_ARRAY_SIZE;
-                int a= s->sample_array[idx];
-                int b= s->sample_array[(idx + 4*channels)%SAMPLE_ARRAY_SIZE];
-                int c= s->sample_array[(idx + 5*channels)%SAMPLE_ARRAY_SIZE];
-                int d= s->sample_array[(idx + 9*channels)%SAMPLE_ARRAY_SIZE];
-                int score= a-d;
-                if(h<score && (b^c)<0){
-                    h= score;
-                    i_start= idx;
-                }
-            }
-        }
-
-        s->last_i_start = i_start;
-    } else {
-        i_start = s->last_i_start;
-    }
-
-    bgcolor = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00);
-    if(s->show_audio==1){
-        fill_rectangle(screen,
-                       s->xleft, s->ytop, s->width, s->height,
-                       bgcolor);
-
-        fgcolor = SDL_MapRGB(screen->format, 0xff, 0xff, 0xff);
-
-        /* total height for one channel */
-        h = s->height / nb_display_channels;
-        /* graph height / 2 */
-        h2 = (h * 9) / 20;
-        for(ch = 0;ch < nb_display_channels; ch++) {
-            i = i_start + ch;
-            y1 = s->ytop + ch * h + (h / 2); /* position of center line */
-            for(x = 0; x < s->width; x++) {
-                y = (s->sample_array[i] * h2) >> 15;
-                if (y < 0) {
-                    y = -y;
-                    ys = y1 - y;
-                } else {
-                    ys = y1;
-                }
-                fill_rectangle(screen,
-                               s->xleft + x, ys, 1, y,
-                               fgcolor);
-                i += channels;
-                if (i >= SAMPLE_ARRAY_SIZE)
-                    i -= SAMPLE_ARRAY_SIZE;
-            }
-        }
-
-        fgcolor = SDL_MapRGB(screen->format, 0x00, 0x00, 0xff);
-
-        for(ch = 1;ch < nb_display_channels; ch++) {
-            y = s->ytop + ch * h;
-            fill_rectangle(screen,
-                           s->xleft, y, s->width, 1,
-                           fgcolor);
-        }
-        SDL_UpdateRect(screen, s->xleft, s->ytop, s->width, s->height);
-    }else{
-        nb_display_channels= FFMIN(nb_display_channels, 2);
-        if(rdft_bits != s->rdft_bits){
-            av_rdft_end(s->rdft);
-            s->rdft = av_rdft_init(rdft_bits, DFT_R2C);
-            s->rdft_bits= rdft_bits;
-        }
-        {
-            FFTSample data[2][2*nb_freq];
-            for(ch = 0;ch < nb_display_channels; ch++) {
-                i = i_start + ch;
-                for(x = 0; x < 2*nb_freq; x++) {
-                    double w= (x-nb_freq)*(1.0/nb_freq);
-                    data[ch][x]= s->sample_array[i]*(1.0-w*w);
-                    i += channels;
-                    if (i >= SAMPLE_ARRAY_SIZE)
-                        i -= SAMPLE_ARRAY_SIZE;
-                }
-                av_rdft_calc(s->rdft, data[ch]);
-            }
-            //least efficient way to do this, we should of course directly access it but its more than fast enough
-            for(y=0; y<s->height; y++){
-                double w= 1/sqrt(nb_freq);
-                int a= sqrt(w*sqrt(data[0][2*y+0]*data[0][2*y+0] + data[0][2*y+1]*data[0][2*y+1]));
-                int b= sqrt(w*sqrt(data[1][2*y+0]*data[1][2*y+0] + data[1][2*y+1]*data[1][2*y+1]));
-                a= FFMIN(a,255);
-                b= FFMIN(b,255);
-                fgcolor = SDL_MapRGB(screen->format, a, b, (a+b)/2);
-
-                fill_rectangle(screen,
-                            s->xpos, s->height-y, 1, 1,
-                            fgcolor);
-            }
-        }
-        SDL_UpdateRect(screen, s->xpos, s->ytop, 1, s->height);
-        s->xpos++;
-        if(s->xpos >= s->width)
-            s->xpos= s->xleft;
-    }
-}
-
-static int video_open(VideoState *is){
-    int flags = SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL;
-    int w,h;
-
-    if(is_full_screen) flags |= SDL_FULLSCREEN;
-    else               flags |= SDL_RESIZABLE;
-
-    if (is_full_screen && fs_screen_width) {
-        w = fs_screen_width;
-        h = fs_screen_height;
-    } else if(!is_full_screen && screen_width){
-        w = screen_width;
-        h = screen_height;
-#if CONFIG_AVFILTER
-    }else if (is->out_video_filter && is->out_video_filter->inputs[0]){
-        w = is->out_video_filter->inputs[0]->w;
-        h = is->out_video_filter->inputs[0]->h;
-#else
-    }else if (is->video_st && is->video_st->codec->width){
-        w = is->video_st->codec->width;
-        h = is->video_st->codec->height;
-#endif
-    } else {
-        w = 640;
-        h = 480;
-    }
-    if(screen && is->width == screen->w && screen->w == w
-       && is->height== screen->h && screen->h == h)
-        return 0;
-
-#ifndef __APPLE__
-    screen = SDL_SetVideoMode(w, h, 0, flags);
-#else
-    /* setting bits_per_pixel = 0 or 32 causes blank video on OS X */
-    screen = SDL_SetVideoMode(w, h, 24, flags);
-#endif
-    if (!screen) {
-        fprintf(stderr, "SDL: could not set video mode - exiting\n");
-        return -1;
-    }
-    if (!window_title)
-        window_title = input_filename;
-    SDL_WM_SetCaption(window_title, window_title);
-
-    is->width = screen->w;
-    is->height = screen->h;
-
-    return 0;
-}
-
-/* display the current picture, if any */
-static void video_display(VideoState *is)
-{
-    if(!screen)
-        video_open(cur_stream);
-    if (is->audio_st && is->show_audio)
-        video_audio_display(is);
-    else if (is->video_st)
-        video_image_display(is);
-}
-
-static int refresh_thread(void *opaque)
-{
-    VideoState *is= opaque;
-    while(!is->abort_request){
-    SDL_Event event;
-    event.type = FF_REFRESH_EVENT;
-    event.user.data1 = opaque;
-        if(!is->refresh){
-            is->refresh=1;
-    SDL_PushEvent(&event);
-        }
-        usleep(is->audio_st && is->show_audio ? rdftspeed*1000 : 5000); //FIXME ideally we should wait the correct time but SDLs event passing is so slow it would be silly
-    }
-    return 0;
-}
-
-/* get the current audio clock value */
-static double get_audio_clock(VideoState *is)
-{
-    double pts;
-    int hw_buf_size, bytes_per_sec;
-    pts = is->audio_clock;
-    hw_buf_size = audio_write_get_buf_size(is);
-    bytes_per_sec = 0;
-    if (is->audio_st) {
-        bytes_per_sec = is->audio_st->codec->sample_rate *
-            2 * is->audio_st->codec->channels;
-    }
-    if (bytes_per_sec)
-        pts -= (double)hw_buf_size / bytes_per_sec;
-    return pts;
-}
-
-/* get the current video clock value */
-static double get_video_clock(VideoState *is)
-{
-    if (is->paused) {
-        return is->video_current_pts;
-    } else {
-        return is->video_current_pts_drift + av_gettime() / 1000000.0;
-    }
-}
-
-/* get the current external clock value */
-static double get_external_clock(VideoState *is)
-{
-    int64_t ti;
-    ti = av_gettime();
-    return is->external_clock + ((ti - is->external_clock_time) * 1e-6);
-}
-
-/* get the current master clock value */
-static double get_master_clock(VideoState *is)
-{
-    double val;
-
-    if (is->av_sync_type == AV_SYNC_VIDEO_MASTER) {
-        if (is->video_st)
-            val = get_video_clock(is);
-        else
-            val = get_audio_clock(is);
-    } else if (is->av_sync_type == AV_SYNC_AUDIO_MASTER) {
-        if (is->audio_st)
-            val = get_audio_clock(is);
-        else
-            val = get_video_clock(is);
-    } else {
-        val = get_external_clock(is);
-    }
-    return val;
-}
-
-/* seek in the stream */
-static void stream_seek(VideoState *is, int64_t pos, int64_t rel, int seek_by_bytes)
-{
-    if (!is->seek_req) {
-        is->seek_pos = pos;
-        is->seek_rel = rel;
-        is->seek_flags &= ~AVSEEK_FLAG_BYTE;
-        if (seek_by_bytes)
-            is->seek_flags |= AVSEEK_FLAG_BYTE;
-        is->seek_req = 1;
-    }
-}
-
-/* pause or resume the video */
-static void stream_pause(VideoState *is)
-{
-    if (is->paused) {
-        is->frame_timer += av_gettime() / 1000000.0 + is->video_current_pts_drift - is->video_current_pts;
-        if(is->read_pause_return != AVERROR(ENOSYS)){
-            is->video_current_pts = is->video_current_pts_drift + av_gettime() / 1000000.0;
-        }
-        is->video_current_pts_drift = is->video_current_pts - av_gettime() / 1000000.0;
-    }
-    is->paused = !is->paused;
-}
-
-static double compute_target_time(double frame_current_pts, VideoState *is)
-{
-    double delay, sync_threshold, diff;
-
-    /* compute nominal delay */
-    delay = frame_current_pts - is->frame_last_pts;
-    if (delay <= 0 || delay >= 10.0) {
-        /* if incorrect delay, use previous one */
-        delay = is->frame_last_delay;
-    } else {
-        is->frame_last_delay = delay;
-    }
-    is->frame_last_pts = frame_current_pts;
-
-    /* update delay to follow master synchronisation source */
-    if (((is->av_sync_type == AV_SYNC_AUDIO_MASTER && is->audio_st) ||
-         is->av_sync_type == AV_SYNC_EXTERNAL_CLOCK)) {
-        /* if video is slave, we try to correct big delays by
-           duplicating or deleting a frame */
-        diff = get_video_clock(is) - get_master_clock(is);
-
-        /* skip or repeat frame. We take into account the
-           delay to compute the threshold. I still don't know
-           if it is the best guess */
-        sync_threshold = FFMAX(AV_SYNC_THRESHOLD, delay);
-        if (fabs(diff) < AV_NOSYNC_THRESHOLD) {
-            if (diff <= -sync_threshold)
-                delay = 0;
-            else if (diff >= sync_threshold)
-                delay = 2 * delay;
-        }
-    }
-    is->frame_timer += delay;
-#if defined(DEBUG_SYNC)
-    printf("video: delay=%0.3f actual_delay=%0.3f pts=%0.3f A-V=%f\n",
-            delay, actual_delay, frame_current_pts, -diff);
-#endif
-
-    return is->frame_timer;
-}
-
-/* called to display each frame */
-static void video_refresh_timer(void *opaque)
-{
-    VideoState *is = opaque;
-    VideoPicture *vp;
-
-    SubPicture *sp, *sp2;
-
-    if (is->video_st) {
-retry:
-        if (is->pictq_size == 0) {
-            //nothing to do, no picture to display in the que
-        } else {
-            double time= av_gettime()/1000000.0;
-            double next_target;
-            /* dequeue the picture */
-            vp = &is->pictq[is->pictq_rindex];
-
-            if(time < vp->target_clock)
-                return;
-            /* update current video pts */
-            is->video_current_pts = vp->pts;
-            is->video_current_pts_drift = is->video_current_pts - time;
-            is->video_current_pos = vp->pos;
-            if(is->pictq_size > 1){
-                VideoPicture *nextvp= &is->pictq[(is->pictq_rindex+1)%VIDEO_PICTURE_QUEUE_SIZE];
-                assert(nextvp->target_clock >= vp->target_clock);
-                next_target= nextvp->target_clock;
-            }else{
-                next_target= vp->target_clock + is->video_clock - vp->pts; //FIXME pass durations cleanly
-            }
-            if(framedrop && time > next_target){
-                is->skip_frames *= 1.0 + FRAME_SKIP_FACTOR;
-                if(is->pictq_size > 1 || time > next_target + 0.5){
-                    /* update queue size and signal for next picture */
-                    if (++is->pictq_rindex == VIDEO_PICTURE_QUEUE_SIZE)
-                        is->pictq_rindex = 0;
-
-                    SDL_LockMutex(is->pictq_mutex);
-                    is->pictq_size--;
-                    SDL_CondSignal(is->pictq_cond);
-                    SDL_UnlockMutex(is->pictq_mutex);
-                    goto retry;
-                }
-            }
-
-            if(is->subtitle_st) {
-                if (is->subtitle_stream_changed) {
-                    SDL_LockMutex(is->subpq_mutex);
-
-                    while (is->subpq_size) {
-                        free_subpicture(&is->subpq[is->subpq_rindex]);
-
-                        /* update queue size and signal for next picture */
-                        if (++is->subpq_rindex == SUBPICTURE_QUEUE_SIZE)
-                            is->subpq_rindex = 0;
-
-                        is->subpq_size--;
-                    }
-                    is->subtitle_stream_changed = 0;
-
-                    SDL_CondSignal(is->subpq_cond);
-                    SDL_UnlockMutex(is->subpq_mutex);
-                } else {
-                    if (is->subpq_size > 0) {
-                        sp = &is->subpq[is->subpq_rindex];
-
-                        if (is->subpq_size > 1)
-                            sp2 = &is->subpq[(is->subpq_rindex + 1) % SUBPICTURE_QUEUE_SIZE];
-                        else
-                            sp2 = NULL;
-
-                        if ((is->video_current_pts > (sp->pts + ((float) sp->sub.end_display_time / 1000)))
-                                || (sp2 && is->video_current_pts > (sp2->pts + ((float) sp2->sub.start_display_time / 1000))))
-                        {
-                            free_subpicture(sp);
-
-                            /* update queue size and signal for next picture */
-                            if (++is->subpq_rindex == SUBPICTURE_QUEUE_SIZE)
-                                is->subpq_rindex = 0;
-
-                            SDL_LockMutex(is->subpq_mutex);
-                            is->subpq_size--;
-                            SDL_CondSignal(is->subpq_cond);
-                            SDL_UnlockMutex(is->subpq_mutex);
-                        }
-                    }
-                }
-            }
-
-            /* display picture */
-            video_display(is);
-
-            /* update queue size and signal for next picture */
-            if (++is->pictq_rindex == VIDEO_PICTURE_QUEUE_SIZE)
-                is->pictq_rindex = 0;
-
-            SDL_LockMutex(is->pictq_mutex);
-            is->pictq_size--;
-            SDL_CondSignal(is->pictq_cond);
-            SDL_UnlockMutex(is->pictq_mutex);
-        }
-    } else if (is->audio_st) {
-        /* draw the next audio frame */
-
-        /* if only audio stream, then display the audio bars (better
-           than nothing, just to test the implementation */
-
-        /* display picture */
-        video_display(is);
-    }
-    if (show_status) {
-        static int64_t last_time;
-        int64_t cur_time;
-        int aqsize, vqsize, sqsize;
-        double av_diff;
-
-        cur_time = av_gettime();
-        if (!last_time || (cur_time - last_time) >= 30000) {
-            aqsize = 0;
-            vqsize = 0;
-            sqsize = 0;
-            if (is->audio_st)
-                aqsize = is->audioq.size;
-            if (is->video_st)
-                vqsize = is->videoq.size;
-            if (is->subtitle_st)
-                sqsize = is->subtitleq.size;
-            av_diff = 0;
-            if (is->audio_st && is->video_st)
-                av_diff = get_audio_clock(is) - get_video_clock(is);
-            printf("%7.2f A-V:%7.3f s:%3.1f aq=%5dKB vq=%5dKB sq=%5dB f=%"PRId64"/%"PRId64"   \r",
-                   get_master_clock(is), av_diff, FFMAX(is->skip_frames-1, 0), aqsize / 1024, vqsize / 1024, sqsize, is->faulty_dts, is->faulty_pts);
-            fflush(stdout);
-            last_time = cur_time;
-        }
-    }
-}
-
-/* allocate a picture (needs to do that in main thread to avoid
-   potential locking problems */
-static void alloc_picture(void *opaque)
-{
-    VideoState *is = opaque;
-    VideoPicture *vp;
-
-    vp = &is->pictq[is->pictq_windex];
-
-    if (vp->bmp)
-        SDL_FreeYUVOverlay(vp->bmp);
-
-#if CONFIG_AVFILTER
-    if (vp->picref)
-        avfilter_unref_pic(vp->picref);
-    vp->picref = NULL;
-
-    vp->width   = is->out_video_filter->inputs[0]->w;
-    vp->height  = is->out_video_filter->inputs[0]->h;
-    vp->pix_fmt = is->out_video_filter->inputs[0]->format;
-#else
-    vp->width   = is->video_st->codec->width;
-    vp->height  = is->video_st->codec->height;
-    vp->pix_fmt = is->video_st->codec->pix_fmt;
-#endif
-
-    vp->bmp = SDL_CreateYUVOverlay(vp->width, vp->height,
-                                   SDL_YV12_OVERLAY,
-                                   screen);
-
-    SDL_LockMutex(is->pictq_mutex);
-    vp->allocated = 1;
-    SDL_CondSignal(is->pictq_cond);
-    SDL_UnlockMutex(is->pictq_mutex);
-}
-
-/**
- *
- * @param pts the dts of the pkt / pts of the frame and guessed if not known
- */
-static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t pos)
-{
-    VideoPicture *vp;
-    int dst_pix_fmt;
-#if CONFIG_AVFILTER
-    AVPicture pict_src;
-#endif
-    /* wait until we have space to put a new picture */
-    SDL_LockMutex(is->pictq_mutex);
-
-    if(is->pictq_size>=VIDEO_PICTURE_QUEUE_SIZE && !is->refresh)
-        is->skip_frames= FFMAX(1.0 - FRAME_SKIP_FACTOR, is->skip_frames * (1.0-FRAME_SKIP_FACTOR));
-
-    while (is->pictq_size >= VIDEO_PICTURE_QUEUE_SIZE &&
-           !is->videoq.abort_request) {
-        SDL_CondWait(is->pictq_cond, is->pictq_mutex);
-    }
-    SDL_UnlockMutex(is->pictq_mutex);
-
-    if (is->videoq.abort_request)
-        return -1;
-
-    vp = &is->pictq[is->pictq_windex];
-
-    /* alloc or resize hardware picture buffer */
-    if (!vp->bmp ||
-#if CONFIG_AVFILTER
-        vp->width  != is->out_video_filter->inputs[0]->w ||
-        vp->height != is->out_video_filter->inputs[0]->h) {
-#else
-        vp->width != is->video_st->codec->width ||
-        vp->height != is->video_st->codec->height) {
-#endif
-        SDL_Event event;
-
-        vp->allocated = 0;
-
-        /* the allocation must be done in the main thread to avoid
-           locking problems */
-        event.type = FF_ALLOC_EVENT;
-        event.user.data1 = is;
-        SDL_PushEvent(&event);
-
-        /* wait until the picture is allocated */
-        SDL_LockMutex(is->pictq_mutex);
-        while (!vp->allocated && !is->videoq.abort_request) {
-            SDL_CondWait(is->pictq_cond, is->pictq_mutex);
-        }
-        SDL_UnlockMutex(is->pictq_mutex);
-
-        if (is->videoq.abort_request)
-            return -1;
-    }
-
-    /* if the frame is not skipped, then display it */
-    if (vp->bmp) {
-        AVPicture pict;
-#if CONFIG_AVFILTER
-        if(vp->picref)
-            avfilter_unref_pic(vp->picref);
-        vp->picref = src_frame->opaque;
-#endif
-
-        /* get a pointer on the bitmap */
-        SDL_LockYUVOverlay (vp->bmp);
-
-        dst_pix_fmt = PIX_FMT_YUV420P;
-        memset(&pict,0,sizeof(AVPicture));
-        pict.data[0] = vp->bmp->pixels[0];
-        pict.data[1] = vp->bmp->pixels[2];
-        pict.data[2] = vp->bmp->pixels[1];
-
-        pict.linesize[0] = vp->bmp->pitches[0];
-        pict.linesize[1] = vp->bmp->pitches[2];
-        pict.linesize[2] = vp->bmp->pitches[1];
-
-#if CONFIG_AVFILTER
-        pict_src.data[0] = src_frame->data[0];
-        pict_src.data[1] = src_frame->data[1];
-        pict_src.data[2] = src_frame->data[2];
-
-        pict_src.linesize[0] = src_frame->linesize[0];
-        pict_src.linesize[1] = src_frame->linesize[1];
-        pict_src.linesize[2] = src_frame->linesize[2];
-
-        //FIXME use direct rendering
-        av_picture_copy(&pict, &pict_src,
-                        vp->pix_fmt, vp->width, vp->height);
-#else
-        sws_flags = av_get_int(sws_opts, "sws_flags", NULL);
-        is->img_convert_ctx = sws_getCachedContext(is->img_convert_ctx,
-            vp->width, vp->height, vp->pix_fmt, vp->width, vp->height,
-            dst_pix_fmt, sws_flags, NULL, NULL, NULL);
-        if (is->img_convert_ctx == NULL) {
-            fprintf(stderr, "Cannot initialize the conversion context\n");
-            exit(1);
-        }
-        sws_scale(is->img_convert_ctx, src_frame->data, src_frame->linesize,
-                  0, vp->height, pict.data, pict.linesize);
-#endif
-        /* update the bitmap content */
-        SDL_UnlockYUVOverlay(vp->bmp);
-
-        vp->pts = pts;
-        vp->pos = pos;
-
-        /* now we can update the picture count */
-        if (++is->pictq_windex == VIDEO_PICTURE_QUEUE_SIZE)
-            is->pictq_windex = 0;
-        SDL_LockMutex(is->pictq_mutex);
-        vp->target_clock= compute_target_time(vp->pts, is);
-
-        is->pictq_size++;
-        SDL_UnlockMutex(is->pictq_mutex);
-    }
-    return 0;
-}
-
-/**
- * compute the exact PTS for the picture if it is omitted in the stream
- * @param pts1 the dts of the pkt / pts of the frame
- */
-static int output_picture2(VideoState *is, AVFrame *src_frame, double pts1, int64_t pos)
-{
-    double frame_delay, pts;
-
-    pts = pts1;
-
-    if (pts != 0) {
-        /* update video clock with pts, if present */
-        is->video_clock = pts;
-    } else {
-        pts = is->video_clock;
-    }
-    /* update video clock for next frame */
-    frame_delay = av_q2d(is->video_st->codec->time_base);
-    /* for MPEG2, the frame can be repeated, so we update the
-       clock accordingly */
-    frame_delay += src_frame->repeat_pict * (frame_delay * 0.5);
-    is->video_clock += frame_delay;
-
-#if defined(DEBUG_SYNC) && 0
-    printf("frame_type=%c clock=%0.3f pts=%0.3f\n",
-           av_get_pict_type_char(src_frame->pict_type), pts, pts1);
-#endif
-    return queue_picture(is, src_frame, pts, pos);
-}
-
-static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacket *pkt)
-{
-    int len1, got_picture, i;
-
-        if (packet_queue_get(&is->videoq, pkt, 1) < 0)
-            return -1;
-
-        if(pkt->data == flush_pkt.data){
-            avcodec_flush_buffers(is->video_st->codec);
-
-            SDL_LockMutex(is->pictq_mutex);
-            //Make sure there are no long delay timers (ideally we should just flush the que but thats harder)
-            for(i=0; i<VIDEO_PICTURE_QUEUE_SIZE; i++){
-                is->pictq[i].target_clock= 0;
-            }
-            while (is->pictq_size && !is->videoq.abort_request) {
-                SDL_CondWait(is->pictq_cond, is->pictq_mutex);
-            }
-            is->video_current_pos= -1;
-            SDL_UnlockMutex(is->pictq_mutex);
-
-            is->last_dts_for_fault_detection=
-            is->last_pts_for_fault_detection= INT64_MIN;
-            is->frame_last_pts= AV_NOPTS_VALUE;
-            is->frame_last_delay = 0;
-            is->frame_timer = (double)av_gettime() / 1000000.0;
-            is->skip_frames= 1;
-            is->skip_frames_index= 0;
-            return 0;
-        }
-
-        /* NOTE: ipts is the PTS of the _first_ picture beginning in
-           this packet, if any */
-        is->video_st->codec->reordered_opaque= pkt->pts;
-        len1 = avcodec_decode_video2(is->video_st->codec,
-                                    frame, &got_picture,
-                                    pkt);
-
-        if (got_picture) {
-            if(pkt->dts != AV_NOPTS_VALUE){
-                is->faulty_dts += pkt->dts <= is->last_dts_for_fault_detection;
-                is->last_dts_for_fault_detection= pkt->dts;
-            }
-            if(frame->reordered_opaque != AV_NOPTS_VALUE){
-                is->faulty_pts += frame->reordered_opaque <= is->last_pts_for_fault_detection;
-                is->last_pts_for_fault_detection= frame->reordered_opaque;
-            }
-        }
-
-        if(   (   decoder_reorder_pts==1
-               || (decoder_reorder_pts && is->faulty_pts<is->faulty_dts)
-               || pkt->dts == AV_NOPTS_VALUE)
-           && frame->reordered_opaque != AV_NOPTS_VALUE)
-            *pts= frame->reordered_opaque;
-        else if(pkt->dts != AV_NOPTS_VALUE)
-            *pts= pkt->dts;
-        else
-            *pts= 0;
-
-//            if (len1 < 0)
-//                break;
-    if (got_picture){
-        is->skip_frames_index += 1;
-        if(is->skip_frames_index >= is->skip_frames){
-            is->skip_frames_index -= FFMAX(is->skip_frames, 1.0);
-            return 1;
-        }
-
-    }
-    return 0;
-}
-
-#if CONFIG_AVFILTER
-typedef struct {
-    VideoState *is;
-    AVFrame *frame;
-    int use_dr1;
-} FilterPriv;
-
-static int input_get_buffer(AVCodecContext *codec, AVFrame *pic)
-{
-    AVFilterContext *ctx = codec->opaque;
-    AVFilterPicRef  *ref;
-    int perms = AV_PERM_WRITE;
-    int w, h, stride[4];
-    unsigned edge;
-
-    if(pic->buffer_hints & FF_BUFFER_HINTS_VALID) {
-        if(pic->buffer_hints & FF_BUFFER_HINTS_READABLE) perms |= AV_PERM_READ;
-        if(pic->buffer_hints & FF_BUFFER_HINTS_PRESERVE) perms |= AV_PERM_PRESERVE;
-        if(pic->buffer_hints & FF_BUFFER_HINTS_REUSABLE) perms |= AV_PERM_REUSE2;
-    }
-    if(pic->reference) perms |= AV_PERM_READ | AV_PERM_PRESERVE;
-
-    w = codec->width;
-    h = codec->height;
-    avcodec_align_dimensions2(codec, &w, &h, stride);
-    edge = codec->flags & CODEC_FLAG_EMU_EDGE ? 0 : avcodec_get_edge_width();
-    w += edge << 1;
-    h += edge << 1;
-
-    if(!(ref = avfilter_get_video_buffer(ctx->outputs[0], perms, w, h)))
-        return -1;
-
-    ref->w = codec->width;
-    ref->h = codec->height;
-    for(int i = 0; i < 3; i ++) {
-        unsigned hshift = i == 0 ? 0 : av_pix_fmt_descriptors[ref->pic->format].log2_chroma_w;
-        unsigned vshift = i == 0 ? 0 : av_pix_fmt_descriptors[ref->pic->format].log2_chroma_h;
-
-        if (ref->data[i]) {
-            ref->data[i]    += (edge >> hshift) + ((edge * ref->linesize[i]) >> vshift);
-        }
-        pic->data[i]     = ref->data[i];
-        pic->linesize[i] = ref->linesize[i];
-    }
-    pic->opaque = ref;
-    pic->age    = INT_MAX;
-    pic->type   = FF_BUFFER_TYPE_USER;
-    return 0;
-}
-
-static void input_release_buffer(AVCodecContext *codec, AVFrame *pic)
-{
-    memset(pic->data, 0, sizeof(pic->data));
-    avfilter_unref_pic(pic->opaque);
-}
-
-static int input_init(AVFilterContext *ctx, const char *args, void *opaque)
-{
-    FilterPriv *priv = ctx->priv;
-    AVCodecContext *codec;
-    if(!opaque) return -1;
-
-    priv->is = opaque;
-    codec    = priv->is->video_st->codec;
-    codec->opaque = ctx;
-    if(codec->codec->capabilities & CODEC_CAP_DR1) {
-        priv->use_dr1 = 1;
-        codec->get_buffer     = input_get_buffer;
-        codec->release_buffer = input_release_buffer;
-    }
-
-    priv->frame = avcodec_alloc_frame();
-
-    return 0;
-}
-
-static void input_uninit(AVFilterContext *ctx)
-{
-    FilterPriv *priv = ctx->priv;
-    av_free(priv->frame);
-}
-
-static int input_request_frame(AVFilterLink *link)
-{
-    FilterPriv *priv = link->src->priv;
-    AVFilterPicRef *picref;
-    int64_t pts = 0;
-    AVPacket pkt;
-    int ret;
-
-    while (!(ret = get_video_frame(priv->is, priv->frame, &pts, &pkt)))
-        av_free_packet(&pkt);
-    if (ret < 0)
-        return -1;
-
-    if(priv->use_dr1) {
-        picref = avfilter_ref_pic(priv->frame->opaque, ~0);
-    } else {
-        picref = avfilter_get_video_buffer(link, AV_PERM_WRITE, link->w, link->h);
-        av_picture_copy((AVPicture *)&picref->data, (AVPicture *)priv->frame,
-                        picref->pic->format, link->w, link->h);
-    }
-    av_free_packet(&pkt);
-
-    picref->pts = pts;
-    picref->pos = pkt.pos;
-    picref->pixel_aspect = priv->is->video_st->codec->sample_aspect_ratio;
-    avfilter_start_frame(link, picref);
-    avfilter_draw_slice(link, 0, link->h, 1);
-    avfilter_end_frame(link);
-
-    return 0;
-}
-
-static int input_query_formats(AVFilterContext *ctx)
-{
-    FilterPriv *priv = ctx->priv;
-    enum PixelFormat pix_fmts[] = {
-        priv->is->video_st->codec->pix_fmt, PIX_FMT_NONE
-    };
-
-    avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts));
-    return 0;
-}
-
-static int input_config_props(AVFilterLink *link)
-{
-    FilterPriv *priv  = link->src->priv;
-    AVCodecContext *c = priv->is->video_st->codec;
-
-    link->w = c->width;
-    link->h = c->height;
-
-    return 0;
-}
-
-static AVFilter input_filter =
-{
-    .name      = "ffplay_input",
-
-    .priv_size = sizeof(FilterPriv),
-
-    .init      = input_init,
-    .uninit    = input_uninit,
-
-    .query_formats = input_query_formats,
-
-    .inputs    = (AVFilterPad[]) {{ .name = NULL }},
-    .outputs   = (AVFilterPad[]) {{ .name = "default",
-                                    .type = AVMEDIA_TYPE_VIDEO,
-                                    .request_frame = input_request_frame,
-                                    .config_props  = input_config_props, },
-                                  { .name = NULL }},
-};
-
-static void output_end_frame(AVFilterLink *link)
-{
-}
-
-static int output_query_formats(AVFilterContext *ctx)
-{
-    enum PixelFormat pix_fmts[] = { PIX_FMT_YUV420P, PIX_FMT_NONE };
-
-    avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts));
-    return 0;
-}
-
-static int get_filtered_video_frame(AVFilterContext *ctx, AVFrame *frame,
-                                    int64_t *pts, int64_t *pos)
-{
-    AVFilterPicRef *pic;
-
-    if(avfilter_request_frame(ctx->inputs[0]))
-        return -1;
-    if(!(pic = ctx->inputs[0]->cur_pic))
-        return -1;
-    ctx->inputs[0]->cur_pic = NULL;
-
-    frame->opaque = pic;
-    *pts          = pic->pts;
-    *pos          = pic->pos;
-
-    memcpy(frame->data,     pic->data,     sizeof(frame->data));
-    memcpy(frame->linesize, pic->linesize, sizeof(frame->linesize));
-
-    return 1;
-}
-
-static AVFilter output_filter =
-{
-    .name      = "ffplay_output",
-
-    .query_formats = output_query_formats,
-
-    .inputs    = (AVFilterPad[]) {{ .name          = "default",
-                                    .type          = AVMEDIA_TYPE_VIDEO,
-                                    .end_frame     = output_end_frame,
-                                    .min_perms     = AV_PERM_READ, },
-                                  { .name = NULL }},
-    .outputs   = (AVFilterPad[]) {{ .name = NULL }},
-};
-#endif  /* CONFIG_AVFILTER */
-
-static int video_thread(void *arg)
-{
-    VideoState *is = arg;
-    AVFrame *frame= avcodec_alloc_frame();
-    int64_t pts_int;
-    double pts;
-    int ret;
-
-#if CONFIG_AVFILTER
-    int64_t pos;
-    AVFilterContext *filt_src = NULL, *filt_out = NULL;
-    AVFilterGraph *graph = av_mallocz(sizeof(AVFilterGraph));
-    graph->scale_sws_opts = av_strdup("sws_flags=bilinear");
-
-    if(!(filt_src = avfilter_open(&input_filter,  "src")))   goto the_end;
-    if(!(filt_out = avfilter_open(&output_filter, "out")))   goto the_end;
-
-    if(avfilter_init_filter(filt_src, NULL, is))             goto the_end;
-    if(avfilter_init_filter(filt_out, NULL, frame))          goto the_end;
-
-
-    if(vfilters) {
-        AVFilterInOut *outputs = av_malloc(sizeof(AVFilterInOut));
-        AVFilterInOut *inputs  = av_malloc(sizeof(AVFilterInOut));
-
-        outputs->name    = av_strdup("in");
-        outputs->filter  = filt_src;
-        outputs->pad_idx = 0;
-        outputs->next    = NULL;
-
-        inputs->name    = av_strdup("out");
-        inputs->filter  = filt_out;
-        inputs->pad_idx = 0;
-        inputs->next    = NULL;
-
-        if (avfilter_graph_parse(graph, vfilters, inputs, outputs, NULL) < 0)
-            goto the_end;
-        av_freep(&vfilters);
-    } else {
-        if(avfilter_link(filt_src, 0, filt_out, 0) < 0)          goto the_end;
-    }
-    avfilter_graph_add_filter(graph, filt_src);
-    avfilter_graph_add_filter(graph, filt_out);
-
-    if(avfilter_graph_check_validity(graph, NULL))           goto the_end;
-    if(avfilter_graph_config_formats(graph, NULL))           goto the_end;
-    if(avfilter_graph_config_links(graph, NULL))             goto the_end;
-
-    is->out_video_filter = filt_out;
-#endif
-
-    for(;;) {
-#if !CONFIG_AVFILTER
-        AVPacket pkt;
-#endif
-        while (is->paused && !is->videoq.abort_request)
-            SDL_Delay(10);
-#if CONFIG_AVFILTER
-        ret = get_filtered_video_frame(filt_out, frame, &pts_int, &pos);
-#else
-        ret = get_video_frame(is, frame, &pts_int, &pkt);
-#endif
-
-        if (ret < 0) goto the_end;
-
-        if (!ret)
-            continue;
-
-        pts = pts_int*av_q2d(is->video_st->time_base);
-
-#if CONFIG_AVFILTER
-        ret = output_picture2(is, frame, pts, pos);
-#else
-        ret = output_picture2(is, frame, pts,  pkt.pos);
-        av_free_packet(&pkt);
-#endif
-        if (ret < 0)
-            goto the_end;
-
-        if (step)
-            if (cur_stream)
-                stream_pause(cur_stream);
-    }
- the_end:
-#if CONFIG_AVFILTER
-    avfilter_graph_destroy(graph);
-    av_freep(&graph);
-#endif
-    av_free(frame);
-    return 0;
-}
-
-static int subtitle_thread(void *arg)
-{
-    VideoState *is = arg;
-    SubPicture *sp;
-    AVPacket pkt1, *pkt = &pkt1;
-    int len1, got_subtitle;
-    double pts;
-    int i, j;
-    int r, g, b, y, u, v, a;
-
-    for(;;) {
-        while (is->paused && !is->subtitleq.abort_request) {
-            SDL_Delay(10);
-        }
-        if (packet_queue_get(&is->subtitleq, pkt, 1) < 0)
-            break;
-
-        if(pkt->data == flush_pkt.data){
-            avcodec_flush_buffers(is->subtitle_st->codec);
-            continue;
-        }
-        SDL_LockMutex(is->subpq_mutex);
-        while (is->subpq_size >= SUBPICTURE_QUEUE_SIZE &&
-               !is->subtitleq.abort_request) {
-            SDL_CondWait(is->subpq_cond, is->subpq_mutex);
-        }
-        SDL_UnlockMutex(is->subpq_mutex);
-
-        if (is->subtitleq.abort_request)
-            goto the_end;
-
-        sp = &is->subpq[is->subpq_windex];
-
-       /* NOTE: ipts is the PTS of the _first_ picture beginning in
-           this packet, if any */
-        pts = 0;
-        if (pkt->pts != AV_NOPTS_VALUE)
-            pts = av_q2d(is->subtitle_st->time_base)*pkt->pts;
-
-        len1 = avcodec_decode_subtitle2(is->subtitle_st->codec,
-                                    &sp->sub, &got_subtitle,
-                                    pkt);
-//            if (len1 < 0)
-//                break;
-        if (got_subtitle && sp->sub.format == 0) {
-            sp->pts = pts;
-
-            for (i = 0; i < sp->sub.num_rects; i++)
-            {
-                for (j = 0; j < sp->sub.rects[i]->nb_colors; j++)
-                {
-                    RGBA_IN(r, g, b, a, (uint32_t*)sp->sub.rects[i]->pict.data[1] + j);
-                    y = RGB_TO_Y_CCIR(r, g, b);
-                    u = RGB_TO_U_CCIR(r, g, b, 0);
-                    v = RGB_TO_V_CCIR(r, g, b, 0);
-                    YUVA_OUT((uint32_t*)sp->sub.rects[i]->pict.data[1] + j, y, u, v, a);
-                }
-            }
-
-            /* now we can update the picture count */
-            if (++is->subpq_windex == SUBPICTURE_QUEUE_SIZE)
-                is->subpq_windex = 0;
-            SDL_LockMutex(is->subpq_mutex);
-            is->subpq_size++;
-            SDL_UnlockMutex(is->subpq_mutex);
-        }
-        av_free_packet(pkt);
-//        if (step)
-//            if (cur_stream)
-//                stream_pause(cur_stream);
-    }
- the_end:
-    return 0;
-}
-
-/* copy samples for viewing in editor window */
-static void update_sample_display(VideoState *is, short *samples, int samples_size)
-{
-    int size, len, channels;
-
-    channels = is->audio_st->codec->channels;
-
-    size = samples_size / sizeof(short);
-    while (size > 0) {
-        len = SAMPLE_ARRAY_SIZE - is->sample_array_index;
-        if (len > size)
-            len = size;
-        memcpy(is->sample_array + is->sample_array_index, samples, len * sizeof(short));
-        samples += len;
-        is->sample_array_index += len;
-        if (is->sample_array_index >= SAMPLE_ARRAY_SIZE)
-            is->sample_array_index = 0;
-        size -= len;
-    }
-}
-
-/* return the new audio buffer size (samples can be added or deleted
-   to get better sync if video or external master clock) */
-static int synchronize_audio(VideoState *is, short *samples,
-                             int samples_size1, double pts)
-{
-    int n, samples_size;
-    double ref_clock;
-
-    n = 2 * is->audio_st->codec->channels;
-    samples_size = samples_size1;
-
-    /* if not master, then we try to remove or add samples to correct the clock */
-    if (((is->av_sync_type == AV_SYNC_VIDEO_MASTER && is->video_st) ||
-         is->av_sync_type == AV_SYNC_EXTERNAL_CLOCK)) {
-        double diff, avg_diff;
-        int wanted_size, min_size, max_size, nb_samples;
-
-        ref_clock = get_master_clock(is);
-        diff = get_audio_clock(is) - ref_clock;
-
-        if (diff < AV_NOSYNC_THRESHOLD) {
-            is->audio_diff_cum = diff + is->audio_diff_avg_coef * is->audio_diff_cum;
-            if (is->audio_diff_avg_count < AUDIO_DIFF_AVG_NB) {
-                /* not enough measures to have a correct estimate */
-                is->audio_diff_avg_count++;
-            } else {
-                /* estimate the A-V difference */
-                avg_diff = is->audio_diff_cum * (1.0 - is->audio_diff_avg_coef);
-
-                if (fabs(avg_diff) >= is->audio_diff_threshold) {
-                    wanted_size = samples_size + ((int)(diff * is->audio_st->codec->sample_rate) * n);
-                    nb_samples = samples_size / n;
-
-                    min_size = ((nb_samples * (100 - SAMPLE_CORRECTION_PERCENT_MAX)) / 100) * n;
-                    max_size = ((nb_samples * (100 + SAMPLE_CORRECTION_PERCENT_MAX)) / 100) * n;
-                    if (wanted_size < min_size)
-                        wanted_size = min_size;
-                    else if (wanted_size > max_size)
-                        wanted_size = max_size;
-
-                    /* add or remove samples to correction the synchro */
-                    if (wanted_size < samples_size) {
-                        /* remove samples */
-                        samples_size = wanted_size;
-                    } else if (wanted_size > samples_size) {
-                        uint8_t *samples_end, *q;
-                        int nb;
-
-                        /* add samples */
-                        nb = (samples_size - wanted_size);
-                        samples_end = (uint8_t *)samples + samples_size - n;
-                        q = samples_end + n;
-                        while (nb > 0) {
-                            memcpy(q, samples_end, n);
-                            q += n;
-                            nb -= n;
-                        }
-                        samples_size = wanted_size;
-                    }
-                }
-#if 0
-                printf("diff=%f adiff=%f sample_diff=%d apts=%0.3f vpts=%0.3f %f\n",
-                       diff, avg_diff, samples_size - samples_size1,
-                       is->audio_clock, is->video_clock, is->audio_diff_threshold);
-#endif
-            }
-        } else {
-            /* too big difference : may be initial PTS errors, so
-               reset A-V filter */
-            is->audio_diff_avg_count = 0;
-            is->audio_diff_cum = 0;
-        }
-    }
-
-    return samples_size;
-}
-
-/* decode one audio frame and returns its uncompressed size */
-static int audio_decode_frame(VideoState *is, double *pts_ptr)
-{
-    AVPacket *pkt_temp = &is->audio_pkt_temp;
-    AVPacket *pkt = &is->audio_pkt;
-    AVCodecContext *dec= is->audio_st->codec;
-    int n, len1, data_size;
-    double pts;
-
-    for(;;) {
-        /* NOTE: the audio packet can contain several frames */
-        while (pkt_temp->size > 0) {
-            data_size = sizeof(is->audio_buf1);
-            len1 = avcodec_decode_audio3(dec,
-                                        (int16_t *)is->audio_buf1, &data_size,
-                                        pkt_temp);
-            if (len1 < 0) {
-                /* if error, we skip the frame */
-                pkt_temp->size = 0;
-                break;
-            }
-
-            pkt_temp->data += len1;
-            pkt_temp->size -= len1;
-            if (data_size <= 0)
-                continue;
-
-            if (dec->sample_fmt != is->audio_src_fmt) {
-                if (is->reformat_ctx)
-                    av_audio_convert_free(is->reformat_ctx);
-                is->reformat_ctx= av_audio_convert_alloc(SAMPLE_FMT_S16, 1,
-                                                         dec->sample_fmt, 1, NULL, 0);
-                if (!is->reformat_ctx) {
-                    fprintf(stderr, "Cannot convert %s sample format to %s sample format\n",
-                        avcodec_get_sample_fmt_name(dec->sample_fmt),
-                        avcodec_get_sample_fmt_name(SAMPLE_FMT_S16));
-                        break;
-                }
-                is->audio_src_fmt= dec->sample_fmt;
-            }
-
-            if (is->reformat_ctx) {
-                const void *ibuf[6]= {is->audio_buf1};
-                void *obuf[6]= {is->audio_buf2};
-                int istride[6]= {av_get_bits_per_sample_format(dec->sample_fmt)/8};
-                int ostride[6]= {2};
-                int len= data_size/istride[0];
-                if (av_audio_convert(is->reformat_ctx, obuf, ostride, ibuf, istride, len)<0) {
-                    printf("av_audio_convert() failed\n");
-                    break;
-                }
-                is->audio_buf= is->audio_buf2;
-                /* FIXME: existing code assume that data_size equals framesize*channels*2
-                          remove this legacy cruft */
-                data_size= len*2;
-            }else{
-                is->audio_buf= is->audio_buf1;
-            }
-
-            /* if no pts, then compute it */
-            pts = is->audio_clock;
-            *pts_ptr = pts;
-            n = 2 * dec->channels;
-            is->audio_clock += (double)data_size /
-                (double)(n * dec->sample_rate);
-#if defined(DEBUG_SYNC)
-            {
-                static double last_clock;
-                printf("audio: delay=%0.3f clock=%0.3f pts=%0.3f\n",
-                       is->audio_clock - last_clock,
-                       is->audio_clock, pts);
-                last_clock = is->audio_clock;
-            }
-#endif
-            return data_size;
-        }
-
-        /* free the current packet */
-        if (pkt->data)
-            av_free_packet(pkt);
-
-        if (is->paused || is->audioq.abort_request) {
-            return -1;
-        }
-
-        /* read next packet */
-        if (packet_queue_get(&is->audioq, pkt, 1) < 0)
-            return -1;
-        if(pkt->data == flush_pkt.data){
-            avcodec_flush_buffers(dec);
-            continue;
-        }
-
-        pkt_temp->data = pkt->data;
-        pkt_temp->size = pkt->size;
-
-        /* if update the audio clock with the pts */
-        if (pkt->pts != AV_NOPTS_VALUE) {
-            is->audio_clock = av_q2d(is->audio_st->time_base)*pkt->pts;
-        }
-    }
-}
-
-/* get the current audio output buffer size, in samples. With SDL, we
-   cannot have a precise information */
-static int audio_write_get_buf_size(VideoState *is)
-{
-    return is->audio_buf_size - is->audio_buf_index;
-}
-
-
-/* prepare a new audio buffer */
-static void sdl_audio_callback(void *opaque, Uint8 *stream, int len)
-{
-    VideoState *is = opaque;
-    int audio_size, len1;
-    double pts;
-
-    audio_callback_time = av_gettime();
-
-    while (len > 0) {
-        if (is->audio_buf_index >= is->audio_buf_size) {
-           audio_size = audio_decode_frame(is, &pts);
-           if (audio_size < 0) {
-                /* if error, just output silence */
-               is->audio_buf = is->audio_buf1;
-               is->audio_buf_size = 1024;
-               memset(is->audio_buf, 0, is->audio_buf_size);
-           } else {
-               if (is->show_audio)
-                   update_sample_display(is, (int16_t *)is->audio_buf, audio_size);
-               audio_size = synchronize_audio(is, (int16_t *)is->audio_buf, audio_size,
-                                              pts);
-               is->audio_buf_size = audio_size;
-           }
-           is->audio_buf_index = 0;
-        }
-        len1 = is->audio_buf_size - is->audio_buf_index;
-        if (len1 > len)
-            len1 = len;
-        memcpy(stream, (uint8_t *)is->audio_buf + is->audio_buf_index, len1);
-        len -= len1;
-        stream += len1;
-        is->audio_buf_index += len1;
-    }
-}
-
-/* open a given stream. Return 0 if OK */
-static int stream_component_open(VideoState *is, int stream_index)
-{
-    AVFormatContext *ic = is->ic;
-    AVCodecContext *avctx;
-    AVCodec *codec;
-    SDL_AudioSpec wanted_spec, spec;
-
-    if (stream_index < 0 || stream_index >= ic->nb_streams)
-        return -1;
-    avctx = ic->streams[stream_index]->codec;
-
-    /* prepare audio output */
-    if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
-        if (avctx->channels > 0) {
-            avctx->request_channels = FFMIN(2, avctx->channels);
-        } else {
-            avctx->request_channels = 2;
-        }
-    }
-
-    codec = avcodec_find_decoder(avctx->codec_id);
-    avctx->debug_mv = debug_mv;
-    avctx->debug = debug;
-    avctx->workaround_bugs = workaround_bugs;
-    avctx->lowres = lowres;
-    if(lowres) avctx->flags |= CODEC_FLAG_EMU_EDGE;
-    avctx->idct_algo= idct;
-    if(fast) avctx->flags2 |= CODEC_FLAG2_FAST;
-    avctx->skip_frame= skip_frame;
-    avctx->skip_idct= skip_idct;
-    avctx->skip_loop_filter= skip_loop_filter;
-    avctx->error_recognition= error_recognition;
-    avctx->error_concealment= error_concealment;
-    avcodec_thread_init(avctx, thread_count);
-
-    set_context_opts(avctx, avcodec_opts[avctx->codec_type], 0);
-
-    if (!codec ||
-        avcodec_open(avctx, codec) < 0)
-        return -1;
-
-    /* prepare audio output */
-    if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
-        wanted_spec.freq = avctx->sample_rate;
-        wanted_spec.format = AUDIO_S16SYS;
-        wanted_spec.channels = avctx->channels;
-        wanted_spec.silence = 0;
-        wanted_spec.samples = SDL_AUDIO_BUFFER_SIZE;
-        wanted_spec.callback = sdl_audio_callback;
-        wanted_spec.userdata = is;
-        if (SDL_OpenAudio(&wanted_spec, &spec) < 0) {
-            fprintf(stderr, "SDL_OpenAudio: %s\n", SDL_GetError());
-            return -1;
-        }
-        is->audio_hw_buf_size = spec.size;
-        is->audio_src_fmt= SAMPLE_FMT_S16;
-    }
-
-    ic->streams[stream_index]->discard = AVDISCARD_DEFAULT;
-    switch(avctx->codec_type) {
-    case AVMEDIA_TYPE_AUDIO:
-        is->audio_stream = stream_index;
-        is->audio_st = ic->streams[stream_index];
-        is->audio_buf_size = 0;
-        is->audio_buf_index = 0;
-
-        /* init averaging filter */
-        is->audio_diff_avg_coef = exp(log(0.01) / AUDIO_DIFF_AVG_NB);
-        is->audio_diff_avg_count = 0;
-        /* since we do not have a precise anough audio fifo fullness,
-           we correct audio sync only if larger than this threshold */
-        is->audio_diff_threshold = 2.0 * SDL_AUDIO_BUFFER_SIZE / avctx->sample_rate;
-
-        memset(&is->audio_pkt, 0, sizeof(is->audio_pkt));
-        packet_queue_init(&is->audioq);
-        SDL_PauseAudio(0);
-        break;
-    case AVMEDIA_TYPE_VIDEO:
-        is->video_stream = stream_index;
-        is->video_st = ic->streams[stream_index];
-
-//        is->video_current_pts_time = av_gettime();
-
-        packet_queue_init(&is->videoq);
-        is->video_tid = SDL_CreateThread(video_thread, is);
-        break;
-    case AVMEDIA_TYPE_SUBTITLE:
-        is->subtitle_stream = stream_index;
-        is->subtitle_st = ic->streams[stream_index];
-        packet_queue_init(&is->subtitleq);
-
-        is->subtitle_tid = SDL_CreateThread(subtitle_thread, is);
-        break;
-    default:
-        break;
-    }
-    return 0;
-}
-
-static void stream_component_close(VideoState *is, int stream_index)
-{
-    AVFormatContext *ic = is->ic;
-    AVCodecContext *avctx;
-
-    if (stream_index < 0 || stream_index >= ic->nb_streams)
-        return;
-    avctx = ic->streams[stream_index]->codec;
-
-    switch(avctx->codec_type) {
-    case AVMEDIA_TYPE_AUDIO:
-        packet_queue_abort(&is->audioq);
-
-        SDL_CloseAudio();
-
-        packet_queue_end(&is->audioq);
-        if (is->reformat_ctx)
-            av_audio_convert_free(is->reformat_ctx);
-        is->reformat_ctx = NULL;
-        break;
-    case AVMEDIA_TYPE_VIDEO:
-        packet_queue_abort(&is->videoq);
-
-        /* note: we also signal this mutex to make sure we deblock the
-           video thread in all cases */
-        SDL_LockMutex(is->pictq_mutex);
-        SDL_CondSignal(is->pictq_cond);
-        SDL_UnlockMutex(is->pictq_mutex);
-
-        SDL_WaitThread(is->video_tid, NULL);
-
-        packet_queue_end(&is->videoq);
-        break;
-    case AVMEDIA_TYPE_SUBTITLE:
-        packet_queue_abort(&is->subtitleq);
-
-        /* note: we also signal this mutex to make sure we deblock the
-           video thread in all cases */
-        SDL_LockMutex(is->subpq_mutex);
-        is->subtitle_stream_changed = 1;
-
-        SDL_CondSignal(is->subpq_cond);
-        SDL_UnlockMutex(is->subpq_mutex);
-
-        SDL_WaitThread(is->subtitle_tid, NULL);
-
-        packet_queue_end(&is->subtitleq);
-        break;
-    default:
-        break;
-    }
-
-    ic->streams[stream_index]->discard = AVDISCARD_ALL;
-    avcodec_close(avctx);
-    switch(avctx->codec_type) {
-    case AVMEDIA_TYPE_AUDIO:
-        is->audio_st = NULL;
-        is->audio_stream = -1;
-        break;
-    case AVMEDIA_TYPE_VIDEO:
-        is->video_st = NULL;
-        is->video_stream = -1;
-        break;
-    case AVMEDIA_TYPE_SUBTITLE:
-        is->subtitle_st = NULL;
-        is->subtitle_stream = -1;
-        break;
-    default:
-        break;
-    }
-}
-
-/* since we have only one decoding thread, we can use a global
-   variable instead of a thread local variable */
-static VideoState *global_video_state;
-
-static int decode_interrupt_cb(void)
-{
-    return (global_video_state && global_video_state->abort_request);
-}
-
-/* this thread gets the stream from the disk or the network */
-static int decode_thread(void *arg)
-{
-    VideoState *is = arg;
-    AVFormatContext *ic;
-    int err, i, ret;
-    int st_index[AVMEDIA_TYPE_NB];
-    int st_count[AVMEDIA_TYPE_NB]={0};
-    int st_best_packet_count[AVMEDIA_TYPE_NB];
-    AVPacket pkt1, *pkt = &pkt1;
-    AVFormatParameters params, *ap = &params;
-    int eof=0;
-    int pkt_in_play_range = 0;
-
-    ic = avformat_alloc_context();
-
-    memset(st_index, -1, sizeof(st_index));
-    memset(st_best_packet_count, -1, sizeof(st_best_packet_count));
-    is->video_stream = -1;
-    is->audio_stream = -1;
-    is->subtitle_stream = -1;
-
-    global_video_state = is;
-    url_set_interrupt_cb(decode_interrupt_cb);
-
-    memset(ap, 0, sizeof(*ap));
-
-    ap->prealloced_context = 1;
-    ap->width = frame_width;
-    ap->height= frame_height;
-    ap->time_base= (AVRational){1, 25};
-    ap->pix_fmt = frame_pix_fmt;
-
-    set_context_opts(ic, avformat_opts, AV_OPT_FLAG_DECODING_PARAM);
-
-    err = av_open_input_file(&ic, is->filename, is->iformat, 0, ap);
-    if (err < 0) {
-        print_error(is->filename, err);
-        ret = -1;
-        goto fail;
-    }
-    is->ic = ic;
-
-    if(genpts)
-        ic->flags |= AVFMT_FLAG_GENPTS;
-
-    err = av_find_stream_info(ic);
-    if (err < 0) {
-        fprintf(stderr, "%s: could not find codec parameters\n", is->filename);
-        ret = -1;
-        goto fail;
-    }
-    if(ic->pb)
-        ic->pb->eof_reached= 0; //FIXME hack, ffplay maybe should not use url_feof() to test for the end
-
-    if(seek_by_bytes<0)
-        seek_by_bytes= !!(ic->iformat->flags & AVFMT_TS_DISCONT);
-
-    /* if seeking requested, we execute it */
-    if (start_time != AV_NOPTS_VALUE) {
-        int64_t timestamp;
-
-        timestamp = start_time;
-        /* add the stream start time */
-        if (ic->start_time != AV_NOPTS_VALUE)
-            timestamp += ic->start_time;
-        ret = avformat_seek_file(ic, -1, INT64_MIN, timestamp, INT64_MAX, 0);
-        if (ret < 0) {
-            fprintf(stderr, "%s: could not seek to position %0.3f\n",
-                    is->filename, (double)timestamp / AV_TIME_BASE);
-        }
-    }
-
-    for(i = 0; i < ic->nb_streams; i++) {
-        AVStream *st= ic->streams[i];
-        AVCodecContext *avctx = st->codec;
-        ic->streams[i]->discard = AVDISCARD_ALL;
-        if(avctx->codec_type >= (unsigned)AVMEDIA_TYPE_NB)
-            continue;
-        if(st_count[avctx->codec_type]++ != wanted_stream[avctx->codec_type] && wanted_stream[avctx->codec_type] >= 0)
-            continue;
-
-        if(st_best_packet_count[avctx->codec_type] >= st->codec_info_nb_frames)
-            continue;
-        st_best_packet_count[avctx->codec_type]= st->codec_info_nb_frames;
-
-        switch(avctx->codec_type) {
-        case AVMEDIA_TYPE_AUDIO:
-            if (!audio_disable)
-                st_index[AVMEDIA_TYPE_AUDIO] = i;
-            break;
-        case AVMEDIA_TYPE_VIDEO:
-        case AVMEDIA_TYPE_SUBTITLE:
-            if (!video_disable)
-                st_index[avctx->codec_type] = i;
-            break;
-        default:
-            break;
-        }
-    }
-    if (show_status) {
-        dump_format(ic, 0, is->filename, 0);
-    }
-
-    /* open the streams */
-    if (st_index[AVMEDIA_TYPE_AUDIO] >= 0) {
-        stream_component_open(is, st_index[AVMEDIA_TYPE_AUDIO]);
-    }
-
-    ret=-1;
-    if (st_index[AVMEDIA_TYPE_VIDEO] >= 0) {
-        ret= stream_component_open(is, st_index[AVMEDIA_TYPE_VIDEO]);
-    }
-    is->refresh_tid = SDL_CreateThread(refresh_thread, is);
-    if(ret<0) {
-        if (!display_disable)
-            is->show_audio = 2;
-    }
-
-    if (st_index[AVMEDIA_TYPE_SUBTITLE] >= 0) {
-        stream_component_open(is, st_index[AVMEDIA_TYPE_SUBTITLE]);
-    }
-
-    if (is->video_stream < 0 && is->audio_stream < 0) {
-        fprintf(stderr, "%s: could not open codecs\n", is->filename);
-        ret = -1;
-        goto fail;
-    }
-
-    for(;;) {
-        if (is->abort_request)
-            break;
-        if (is->paused != is->last_paused) {
-            is->last_paused = is->paused;
-            if (is->paused)
-                is->read_pause_return= av_read_pause(ic);
-            else
-                av_read_play(ic);
-        }
-#if CONFIG_RTSP_DEMUXER
-        if (is->paused && !strcmp(ic->iformat->name, "rtsp")) {
-            /* wait 10 ms to avoid trying to get another packet */
-            /* XXX: horrible */
-            SDL_Delay(10);
-            continue;
-        }
-#endif
-        if (is->seek_req) {
-            int64_t seek_target= is->seek_pos;
-            int64_t seek_min= is->seek_rel > 0 ? seek_target - is->seek_rel + 2: INT64_MIN;
-            int64_t seek_max= is->seek_rel < 0 ? seek_target - is->seek_rel - 2: INT64_MAX;
-//FIXME the +-2 is due to rounding being not done in the correct direction in generation
-//      of the seek_pos/seek_rel variables
-
-            ret = avformat_seek_file(is->ic, -1, seek_min, seek_target, seek_max, is->seek_flags);
-            if (ret < 0) {
-                fprintf(stderr, "%s: error while seeking\n", is->ic->filename);
-            }else{
-                if (is->audio_stream >= 0) {
-                    packet_queue_flush(&is->audioq);
-                    packet_queue_put(&is->audioq, &flush_pkt);
-                }
-                if (is->subtitle_stream >= 0) {
-                    packet_queue_flush(&is->subtitleq);
-                    packet_queue_put(&is->subtitleq, &flush_pkt);
-                }
-                if (is->video_stream >= 0) {
-                    packet_queue_flush(&is->videoq);
-                    packet_queue_put(&is->videoq, &flush_pkt);
-                }
-            }
-            is->seek_req = 0;
-            eof= 0;
-        }
-
-        /* if the queue are full, no need to read more */
-        if (   is->audioq.size + is->videoq.size + is->subtitleq.size > MAX_QUEUE_SIZE
-            || (   (is->audioq   .size  > MIN_AUDIOQ_SIZE || is->audio_stream<0)
-                && (is->videoq   .nb_packets > MIN_FRAMES || is->video_stream<0)
-                && (is->subtitleq.nb_packets > MIN_FRAMES || is->subtitle_stream<0))) {
-            /* wait 10 ms */
-            SDL_Delay(10);
-            continue;
-        }
-        if(url_feof(ic->pb) || eof) {
-            if(is->video_stream >= 0){
-                av_init_packet(pkt);
-                pkt->data=NULL;
-                pkt->size=0;
-                pkt->stream_index= is->video_stream;
-                packet_queue_put(&is->videoq, pkt);
-            }
-            SDL_Delay(10);
-            if(is->audioq.size + is->videoq.size + is->subtitleq.size ==0){
-                if(loop!=1 && (!loop || --loop)){
-                    stream_seek(cur_stream, start_time != AV_NOPTS_VALUE ? start_time : 0, 0, 0);
-                }else if(autoexit){
-                    ret=AVERROR_EOF;
-                    goto fail;
-                }
-            }
-            continue;
-        }
-        ret = av_read_frame(ic, pkt);
-        if (ret < 0) {
-            if (ret == AVERROR_EOF)
-                eof=1;
-            if (url_ferror(ic->pb))
-                break;
-            SDL_Delay(100); /* wait for user event */
-            continue;
-        }
-        /* check if packet is in play range specified by user, then queue, otherwise discard */
-        pkt_in_play_range = duration == AV_NOPTS_VALUE ||
-                (pkt->pts - ic->streams[pkt->stream_index]->start_time) *
-                av_q2d(ic->streams[pkt->stream_index]->time_base) -
-                (double)(start_time != AV_NOPTS_VALUE ? start_time : 0)/1000000
-                <= ((double)duration/1000000);
-        if (pkt->stream_index == is->audio_stream && pkt_in_play_range) {
-            packet_queue_put(&is->audioq, pkt);
-        } else if (pkt->stream_index == is->video_stream && pkt_in_play_range) {
-            packet_queue_put(&is->videoq, pkt);
-        } else if (pkt->stream_index == is->subtitle_stream && pkt_in_play_range) {
-            packet_queue_put(&is->subtitleq, pkt);
-        } else {
-            av_free_packet(pkt);
-        }
-    }
-    /* wait until the end */
-    while (!is->abort_request) {
-        SDL_Delay(100);
-    }
-
-    ret = 0;
- fail:
-    /* disable interrupting */
-    global_video_state = NULL;
-
-    /* close each stream */
-    if (is->audio_stream >= 0)
-        stream_component_close(is, is->audio_stream);
-    if (is->video_stream >= 0)
-        stream_component_close(is, is->video_stream);
-    if (is->subtitle_stream >= 0)
-        stream_component_close(is, is->subtitle_stream);
-    if (is->ic) {
-        av_close_input_file(is->ic);
-        is->ic = NULL; /* safety */
-    }
-    url_set_interrupt_cb(NULL);
-
-    if (ret != 0) {
-        SDL_Event event;
-
-        event.type = FF_QUIT_EVENT;
-        event.user.data1 = is;
-        SDL_PushEvent(&event);
-    }
-    return 0;
-}
-
-static VideoState *stream_open(const char *filename, AVInputFormat *iformat)
-{
-    VideoState *is;
-
-    is = av_mallocz(sizeof(VideoState));
-    if (!is)
-        return NULL;
-    av_strlcpy(is->filename, filename, sizeof(is->filename));
-    is->iformat = iformat;
-    is->ytop = 0;
-    is->xleft = 0;
-
-    /* start video display */
-    is->pictq_mutex = SDL_CreateMutex();
-    is->pictq_cond = SDL_CreateCond();
-
-    is->subpq_mutex = SDL_CreateMutex();
-    is->subpq_cond = SDL_CreateCond();
-
-    is->av_sync_type = av_sync_type;
-    is->parse_tid = SDL_CreateThread(decode_thread, is);
-    if (!is->parse_tid) {
-        av_free(is);
-        return NULL;
-    }
-    return is;
-}
-
-static void stream_close(VideoState *is)
-{
-    VideoPicture *vp;
-    int i;
-    /* XXX: use a special url_shutdown call to abort parse cleanly */
-    is->abort_request = 1;
-    SDL_WaitThread(is->parse_tid, NULL);
-    SDL_WaitThread(is->refresh_tid, NULL);
-
-    /* free all pictures */
-    for(i=0;i<VIDEO_PICTURE_QUEUE_SIZE; i++) {
-        vp = &is->pictq[i];
-#if CONFIG_AVFILTER
-        if (vp->picref) {
-            avfilter_unref_pic(vp->picref);
-            vp->picref = NULL;
-        }
-#endif
-        if (vp->bmp) {
-            SDL_FreeYUVOverlay(vp->bmp);
-            vp->bmp = NULL;
-        }
-    }
-    SDL_DestroyMutex(is->pictq_mutex);
-    SDL_DestroyCond(is->pictq_cond);
-    SDL_DestroyMutex(is->subpq_mutex);
-    SDL_DestroyCond(is->subpq_cond);
-#if !CONFIG_AVFILTER
-    if (is->img_convert_ctx)
-        sws_freeContext(is->img_convert_ctx);
-#endif
-    av_free(is);
-}
-
-static void stream_cycle_channel(VideoState *is, int codec_type)
-{
-    AVFormatContext *ic = is->ic;
-    int start_index, stream_index;
-    AVStream *st;
-
-    if (codec_type == AVMEDIA_TYPE_VIDEO)
-        start_index = is->video_stream;
-    else if (codec_type == AVMEDIA_TYPE_AUDIO)
-        start_index = is->audio_stream;
-    else
-        start_index = is->subtitle_stream;
-    if (start_index < (codec_type == AVMEDIA_TYPE_SUBTITLE ? -1 : 0))
-        return;
-    stream_index = start_index;
-    for(;;) {
-        if (++stream_index >= is->ic->nb_streams)
-        {
-            if (codec_type == AVMEDIA_TYPE_SUBTITLE)
-            {
-                stream_index = -1;
-                goto the_end;
-            } else
-                stream_index = 0;
-        }
-        if (stream_index == start_index)
-            return;
-        st = ic->streams[stream_index];
-        if (st->codec->codec_type == codec_type) {
-            /* check that parameters are OK */
-            switch(codec_type) {
-            case AVMEDIA_TYPE_AUDIO:
-                if (st->codec->sample_rate != 0 &&
-                    st->codec->channels != 0)
-                    goto the_end;
-                break;
-            case AVMEDIA_TYPE_VIDEO:
-            case AVMEDIA_TYPE_SUBTITLE:
-                goto the_end;
-            default:
-                break;
-            }
-        }
-    }
- the_end:
-    stream_component_close(is, start_index);
-    stream_component_open(is, stream_index);
-}
-
-
-static void toggle_full_screen(void)
-{
-    is_full_screen = !is_full_screen;
-    if (!fs_screen_width) {
-        /* use default SDL method */
-//        SDL_WM_ToggleFullScreen(screen);
-    }
-    video_open(cur_stream);
-}
-
-static void toggle_pause(void)
-{
-    if (cur_stream)
-        stream_pause(cur_stream);
-    step = 0;
-}
-
-static void step_to_next_frame(void)
-{
-    if (cur_stream) {
-        /* if the stream is paused unpause it, then step */
-        if (cur_stream->paused)
-            stream_pause(cur_stream);
-    }
-    step = 1;
-}
-
-static void do_exit(void)
-{
-    int i;
-    if (cur_stream) {
-        stream_close(cur_stream);
-        cur_stream = NULL;
-    }
-    for (i = 0; i < AVMEDIA_TYPE_NB; i++)
-        av_free(avcodec_opts[i]);
-    av_free(avformat_opts);
-    av_free(sws_opts);
-#if CONFIG_AVFILTER
-    avfilter_uninit();
-#endif
-    if (show_status)
-        printf("\n");
-    SDL_Quit();
-    exit(0);
-}
-
-static void toggle_audio_display(void)
-{
-    if (cur_stream) {
-        int bgcolor = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00);
-        cur_stream->show_audio = (cur_stream->show_audio + 1) % 3;
-        fill_rectangle(screen,
-                    cur_stream->xleft, cur_stream->ytop, cur_stream->width, cur_stream->height,
-                    bgcolor);
-        SDL_UpdateRect(screen, cur_stream->xleft, cur_stream->ytop, cur_stream->width, cur_stream->height);
-    }
-}
-
-/* handle an event sent by the GUI */
-static void event_loop(void)
-{
-    SDL_Event event;
-    double incr, pos, frac;
-
-    for(;;) {
-        double x;
-        SDL_WaitEvent(&event);
-        switch(event.type) {
-        case SDL_KEYDOWN:
-            switch(event.key.keysym.sym) {
-            case SDLK_ESCAPE:
-            case SDLK_q:
-                do_exit();
-                break;
-            case SDLK_f:
-                toggle_full_screen();
-                break;
-            case SDLK_p:
-            case SDLK_SPACE:
-                toggle_pause();
-                break;
-            case SDLK_s: //S: Step to next frame
-                step_to_next_frame();
-                break;
-            case SDLK_a:
-                if (cur_stream)
-                    stream_cycle_channel(cur_stream, AVMEDIA_TYPE_AUDIO);
-                break;
-            case SDLK_v:
-                if (cur_stream)
-                    stream_cycle_channel(cur_stream, AVMEDIA_TYPE_VIDEO);
-                break;
-            case SDLK_t:
-                if (cur_stream)
-                    stream_cycle_channel(cur_stream, AVMEDIA_TYPE_SUBTITLE);
-                break;
-            case SDLK_w:
-                toggle_audio_display();
-                break;
-            case SDLK_LEFT:
-                incr = -10.0;
-                goto do_seek;
-            case SDLK_RIGHT:
-                incr = 10.0;
-                goto do_seek;
-            case SDLK_UP:
-                incr = 60.0;
-                goto do_seek;
-            case SDLK_DOWN:
-                incr = -60.0;
-            do_seek:
-                if (cur_stream) {
-                    if (seek_by_bytes) {
-                        if (cur_stream->video_stream >= 0 && cur_stream->video_current_pos>=0){
-                            pos= cur_stream->video_current_pos;
-                        }else if(cur_stream->audio_stream >= 0 && cur_stream->audio_pkt.pos>=0){
-                            pos= cur_stream->audio_pkt.pos;
-                        }else
-                            pos = url_ftell(cur_stream->ic->pb);
-                        if (cur_stream->ic->bit_rate)
-                            incr *= cur_stream->ic->bit_rate / 8.0;
-                        else
-                            incr *= 180000.0;
-                        pos += incr;
-                        stream_seek(cur_stream, pos, incr, 1);
-                    } else {
-                        pos = get_master_clock(cur_stream);
-                        pos += incr;
-                        stream_seek(cur_stream, (int64_t)(pos * AV_TIME_BASE), (int64_t)(incr * AV_TIME_BASE), 0);
-                    }
-                }
-                break;
-            default:
-                break;
-            }
-            break;
-        case SDL_MOUSEBUTTONDOWN:
-        case SDL_MOUSEMOTION:
-            if(event.type ==SDL_MOUSEBUTTONDOWN){
-                x= event.button.x;
-            }else{
-                if(event.motion.state != SDL_PRESSED)
-                    break;
-                x= event.motion.x;
-            }
-            if (cur_stream) {
-                if(seek_by_bytes || cur_stream->ic->duration<=0){
-                    uint64_t size=  url_fsize(cur_stream->ic->pb);
-                    stream_seek(cur_stream, size*x/cur_stream->width, 0, 1);
-                }else{
-                    int64_t ts;
-                    int ns, hh, mm, ss;
-                    int tns, thh, tmm, tss;
-                    tns = cur_stream->ic->duration/1000000LL;
-                    thh = tns/3600;
-                    tmm = (tns%3600)/60;
-                    tss = (tns%60);
-                    frac = x/cur_stream->width;
-                    ns = frac*tns;
-                    hh = ns/3600;
-                    mm = (ns%3600)/60;
-                    ss = (ns%60);
-                    fprintf(stderr, "Seek to %2.0f%% (%2d:%02d:%02d) of total duration (%2d:%02d:%02d)       \n", frac*100,
-                            hh, mm, ss, thh, tmm, tss);
-                    ts = frac*cur_stream->ic->duration;
-                    if (cur_stream->ic->start_time != AV_NOPTS_VALUE)
-                        ts += cur_stream->ic->start_time;
-                    stream_seek(cur_stream, ts, 0, 0);
-                }
-            }
-            break;
-        case SDL_VIDEORESIZE:
-            if (cur_stream) {
-                screen = SDL_SetVideoMode(event.resize.w, event.resize.h, 0,
-                                          SDL_HWSURFACE|SDL_RESIZABLE|SDL_ASYNCBLIT|SDL_HWACCEL);
-                screen_width = cur_stream->width = event.resize.w;
-                screen_height= cur_stream->height= event.resize.h;
-            }
-            break;
-        case SDL_QUIT:
-        case FF_QUIT_EVENT:
-            do_exit();
-            break;
-        case FF_ALLOC_EVENT:
-            video_open(event.user.data1);
-            alloc_picture(event.user.data1);
-            break;
-        case FF_REFRESH_EVENT:
-            video_refresh_timer(event.user.data1);
-            cur_stream->refresh=0;
-            break;
-        default:
-            break;
-        }
-    }
-}
-
-static void opt_frame_size(const char *arg)
-{
-    if (av_parse_video_frame_size(&frame_width, &frame_height, arg) < 0) {
-        fprintf(stderr, "Incorrect frame size\n");
-        exit(1);
-    }
-    if ((frame_width % 2) != 0 || (frame_height % 2) != 0) {
-        fprintf(stderr, "Frame size must be a multiple of 2\n");
-        exit(1);
-    }
-}
-
-static int opt_width(const char *opt, const char *arg)
-{
-    screen_width = parse_number_or_die(opt, arg, OPT_INT64, 1, INT_MAX);
-    return 0;
-}
-
-static int opt_height(const char *opt, const char *arg)
-{
-    screen_height = parse_number_or_die(opt, arg, OPT_INT64, 1, INT_MAX);
-    return 0;
-}
-
-static void opt_format(const char *arg)
-{
-    file_iformat = av_find_input_format(arg);
-    if (!file_iformat) {
-        fprintf(stderr, "Unknown input format: %s\n", arg);
-        exit(1);
-    }
-}
-
-static void opt_frame_pix_fmt(const char *arg)
-{
-    frame_pix_fmt = av_get_pix_fmt(arg);
-}
-
-static int opt_sync(const char *opt, const char *arg)
-{
-    if (!strcmp(arg, "audio"))
-        av_sync_type = AV_SYNC_AUDIO_MASTER;
-    else if (!strcmp(arg, "video"))
-        av_sync_type = AV_SYNC_VIDEO_MASTER;
-    else if (!strcmp(arg, "ext"))
-        av_sync_type = AV_SYNC_EXTERNAL_CLOCK;
-    else {
-        fprintf(stderr, "Unknown value for %s: %s\n", opt, arg);
-        exit(1);
-    }
-    return 0;
-}
-
-static int opt_seek(const char *opt, const char *arg)
-{
-    start_time = parse_time_or_die(opt, arg, 1);
-    return 0;
-}
-
-static int opt_duration(const char *opt, const char *arg)
-{
-    duration = parse_time_or_die(opt, arg, 1);
-    return 0;
-}
-
-static int opt_debug(const char *opt, const char *arg)
-{
-    av_log_set_level(99);
-    debug = parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX);
-    return 0;
-}
-
-static int opt_vismv(const char *opt, const char *arg)
-{
-    debug_mv = parse_number_or_die(opt, arg, OPT_INT64, INT_MIN, INT_MAX);
-    return 0;
-}
-
-static int opt_thread_count(const char *opt, const char *arg)
-{
-    thread_count= parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX);
-#if !HAVE_THREADS
-    fprintf(stderr, "Warning: not compiled with thread support, using thread emulation\n");
-#endif
-    return 0;
-}
-
-static const OptionDef options[] = {
-#include "cmdutils_common_opts.h"
-    { "x", HAS_ARG | OPT_FUNC2, {(void*)opt_width}, "force displayed width", "width" },
-    { "y", HAS_ARG | OPT_FUNC2, {(void*)opt_height}, "force displayed height", "height" },
-    { "s", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_size}, "set frame size (WxH or abbreviation)", "size" },
-    { "fs", OPT_BOOL, {(void*)&is_full_screen}, "force full screen" },
-    { "an", OPT_BOOL, {(void*)&audio_disable}, "disable audio" },
-    { "vn", OPT_BOOL, {(void*)&video_disable}, "disable video" },
-    { "ast", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&wanted_stream[AVMEDIA_TYPE_AUDIO]}, "select desired audio stream", "stream_number" },
-    { "vst", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&wanted_stream[AVMEDIA_TYPE_VIDEO]}, "select desired video stream", "stream_number" },
-    { "sst", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&wanted_stream[AVMEDIA_TYPE_SUBTITLE]}, "select desired subtitle stream", "stream_number" },
-    { "ss", HAS_ARG | OPT_FUNC2, {(void*)&opt_seek}, "seek to a given position in seconds", "pos" },
-    { "t", HAS_ARG | OPT_FUNC2, {(void*)&opt_duration}, "play  \"duration\" seconds of audio/video", "duration" },
-    { "bytes", OPT_INT | HAS_ARG, {(void*)&seek_by_bytes}, "seek by bytes 0=off 1=on -1=auto", "val" },
-    { "nodisp", OPT_BOOL, {(void*)&display_disable}, "disable graphical display" },
-    { "f", HAS_ARG, {(void*)opt_format}, "force format", "fmt" },
-    { "pix_fmt", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_frame_pix_fmt}, "set pixel format", "format" },
-    { "stats", OPT_BOOL | OPT_EXPERT, {(void*)&show_status}, "show status", "" },
-    { "debug", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_debug}, "print specific debug info", "" },
-    { "bug", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&workaround_bugs}, "workaround bugs", "" },
-    { "vismv", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_vismv}, "visualize motion vectors", "" },
-    { "fast", OPT_BOOL | OPT_EXPERT, {(void*)&fast}, "non spec compliant optimizations", "" },
-    { "genpts", OPT_BOOL | OPT_EXPERT, {(void*)&genpts}, "generate pts", "" },
-    { "drp", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&decoder_reorder_pts}, "let decoder reorder pts 0=off 1=on -1=auto", ""},
-    { "lowres", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&lowres}, "", "" },
-    { "skiploop", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&skip_loop_filter}, "", "" },
-    { "skipframe", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&skip_frame}, "", "" },
-    { "skipidct", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&skip_idct}, "", "" },
-    { "idct", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&idct}, "set idct algo",  "algo" },
-    { "er", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&error_recognition}, "set error detection threshold (0-4)",  "threshold" },
-    { "ec", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&error_concealment}, "set error concealment options",  "bit_mask" },
-    { "sync", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_sync}, "set audio-video sync. type (type=audio/video/ext)", "type" },
-    { "threads", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_thread_count}, "thread count", "count" },
-    { "autoexit", OPT_BOOL | OPT_EXPERT, {(void*)&autoexit}, "exit at the end", "" },
-    { "loop", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&loop}, "set number of times the playback shall be looped", "loop count" },
-    { "framedrop", OPT_BOOL | OPT_EXPERT, {(void*)&framedrop}, "drop frames when cpu is too slow", "" },
-    { "window_title", OPT_STRING | HAS_ARG, {(void*)&window_title}, "set window title", "window title" },
-#if CONFIG_AVFILTER
-    { "vfilters", OPT_STRING | HAS_ARG, {(void*)&vfilters}, "video filters", "filter list" },
-#endif
-    { "rdftspeed", OPT_INT | HAS_ARG| OPT_AUDIO | OPT_EXPERT, {(void*)&rdftspeed}, "rdft speed", "msecs" },
-    { "default", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
-    { NULL, },
-};
-
-static void show_usage(void)
-{
-    printf("Simple media player\n");
-    printf("usage: ffplay [options] input_file\n");
-    printf("\n");
-}
-
-static void show_help(void)
-{
-    show_usage();
-    show_help_options(options, "Main options:\n",
-                      OPT_EXPERT, 0);
-    show_help_options(options, "\nAdvanced options:\n",
-                      OPT_EXPERT, OPT_EXPERT);
-    printf("\nWhile playing:\n"
-           "q, ESC              quit\n"
-           "f                   toggle full screen\n"
-           "p, SPC              pause\n"
-           "a                   cycle audio channel\n"
-           "v                   cycle video channel\n"
-           "t                   cycle subtitle channel\n"
-           "w                   show audio waves\n"
-           "s                   activate frame-step mode\n"
-           "left/right          seek backward/forward 10 seconds\n"
-           "down/up             seek backward/forward 1 minute\n"
-           "mouse click         seek to percentage in file corresponding to fraction of width\n"
-           );
-}
-
-static void opt_input_file(const char *filename)
-{
-    if (input_filename) {
-        fprintf(stderr, "Argument '%s' provided as input filename, but '%s' was already specified.\n",
-                filename, input_filename);
-        exit(1);
-    }
-    if (!strcmp(filename, "-"))
-        filename = "pipe:";
-    input_filename = filename;
-}
-
-/* Called from the main */
-int main(int argc, char **argv)
-{
-    int flags, i;
-
-    /* register all codecs, demux and protocols */
-    avcodec_register_all();
-#if CONFIG_AVDEVICE
-    avdevice_register_all();
-#endif
-#if CONFIG_AVFILTER
-    avfilter_register_all();
-#endif
-    av_register_all();
-
-    for(i=0; i<AVMEDIA_TYPE_NB; i++){
-        avcodec_opts[i]= avcodec_alloc_context2(i);
-    }
-    avformat_opts = avformat_alloc_context();
-#if !CONFIG_AVFILTER
-    sws_opts = sws_getContext(16,16,0, 16,16,0, sws_flags, NULL,NULL,NULL);
-#endif
-
-    show_banner();
-
-    parse_options(argc, argv, options, opt_input_file);
-
-    if (!input_filename) {
-        show_usage();
-        fprintf(stderr, "An input file must be specified\n");
-        fprintf(stderr, "Use -h to get full help or, even better, run 'man ffplay'\n");
-        exit(1);
-    }
-
-    if (display_disable) {
-        video_disable = 1;
-    }
-    flags = SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER;
-#if !defined(__MINGW32__) && !defined(__APPLE__)
-    flags |= SDL_INIT_EVENTTHREAD; /* Not supported on Windows or Mac OS X */
-#endif
-    if (SDL_Init (flags)) {
-        fprintf(stderr, "Could not initialize SDL - %s\n", SDL_GetError());
-        exit(1);
-    }
-
-    if (!display_disable) {
-#if HAVE_SDL_VIDEO_SIZE
-        const SDL_VideoInfo *vi = SDL_GetVideoInfo();
-        fs_screen_width = vi->current_w;
-        fs_screen_height = vi->current_h;
-#endif
-    }
-
-    SDL_EventState(SDL_ACTIVEEVENT, SDL_IGNORE);
-    SDL_EventState(SDL_SYSWMEVENT, SDL_IGNORE);
-    SDL_EventState(SDL_USEREVENT, SDL_IGNORE);
-
-    av_init_packet(&flush_pkt);
-    flush_pkt.data= "FLUSH";
-
-    cur_stream = stream_open(input_filename, file_iformat);
-
-    event_loop();
-
-    /* never returns */
-
-    return 0;
-}
diff --git a/ffpresets/libx264-baseline.ffpreset b/ffpresets/libx264-baseline.ffpreset
deleted file mode 100644
index ee7654b..0000000
--- a/ffpresets/libx264-baseline.ffpreset
+++ /dev/null
@@ -1,4 +0,0 @@
-coder=0
-bf=0
-flags2=-wpred-dct8x8
-wpredp=0
diff --git a/ffpresets/libx264-default.ffpreset b/ffpresets/libx264-default.ffpreset
deleted file mode 100644
index 75191e2..0000000
--- a/ffpresets/libx264-default.ffpreset
+++ /dev/null
@@ -1,22 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=+parti8x8+parti4x4+partp8x8+partb8x8
-me_method=hex
-subq=7
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=1
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=3
-directpred=1
-trellis=1
-flags2=+mixed_refs+wpred+dct8x8+fastpskip
-wpredp=2
diff --git a/ffpresets/libx264-fast.ffpreset b/ffpresets/libx264-fast.ffpreset
deleted file mode 100644
index cac6534..0000000
--- a/ffpresets/libx264-fast.ffpreset
+++ /dev/null
@@ -1,23 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=+parti8x8+parti4x4+partp8x8+partb8x8
-me_method=hex
-subq=6
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=1
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=2
-directpred=1
-trellis=1
-flags2=+bpyramid+mixed_refs+wpred+dct8x8+fastpskip
-wpredp=2
-rc_lookahead=30
diff --git a/ffpresets/libx264-fast_firstpass.ffpreset b/ffpresets/libx264-fast_firstpass.ffpreset
deleted file mode 100644
index 65ec011..0000000
--- a/ffpresets/libx264-fast_firstpass.ffpreset
+++ /dev/null
@@ -1,23 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=-parti8x8-parti4x4-partp8x8-partb8x8
-me_method=dia
-subq=2
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=1
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=1
-directpred=1
-trellis=0
-flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip
-wpredp=2
-rc_lookahead=30
diff --git a/ffpresets/libx264-faster.ffpreset b/ffpresets/libx264-faster.ffpreset
deleted file mode 100644
index a32eed3..0000000
--- a/ffpresets/libx264-faster.ffpreset
+++ /dev/null
@@ -1,23 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=+parti8x8+parti4x4+partp8x8+partb8x8
-me_method=hex
-subq=4
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=1
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=2
-directpred=1
-trellis=1
-flags2=+bpyramid-mixed_refs+wpred+dct8x8+fastpskip
-wpredp=1
-rc_lookahead=20
diff --git a/ffpresets/libx264-faster_firstpass.ffpreset b/ffpresets/libx264-faster_firstpass.ffpreset
deleted file mode 100644
index c777eb4..0000000
--- a/ffpresets/libx264-faster_firstpass.ffpreset
+++ /dev/null
@@ -1,23 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=-parti8x8-parti4x4-partp8x8-partb8x8
-me_method=dia
-subq=2
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=1
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=1
-directpred=1
-trellis=0
-flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip
-wpredp=1
-rc_lookahead=20
diff --git a/ffpresets/libx264-fastfirstpass.ffpreset b/ffpresets/libx264-fastfirstpass.ffpreset
deleted file mode 100644
index 7278f77..0000000
--- a/ffpresets/libx264-fastfirstpass.ffpreset
+++ /dev/null
@@ -1,22 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=-parti8x8-parti4x4-partp8x8-partp4x4-partb8x8
-me_method=dia
-subq=2
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=1
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=1
-directpred=3
-trellis=0
-flags2=-bpyramid-wpred-mixed_refs-dct8x8+fastpskip
-wpredp=2
diff --git a/ffpresets/libx264-hq.ffpreset b/ffpresets/libx264-hq.ffpreset
deleted file mode 100644
index 9c14d8f..0000000
--- a/ffpresets/libx264-hq.ffpreset
+++ /dev/null
@@ -1,22 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=+parti8x8+parti4x4+partp8x8+partb8x8
-me_method=umh
-subq=8
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=2
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=4
-directpred=3
-trellis=1
-flags2=+wpred+mixed_refs+dct8x8+fastpskip
-wpredp=2
diff --git a/ffpresets/libx264-ipod320.ffpreset b/ffpresets/libx264-ipod320.ffpreset
deleted file mode 100644
index 943b521..0000000
--- a/ffpresets/libx264-ipod320.ffpreset
+++ /dev/null
@@ -1,7 +0,0 @@
-coder=0
-bf=0
-flags2=-wpred-dct8x8
-level=13
-maxrate=768000
-bufsize=3000000
-wpredp=0
diff --git a/ffpresets/libx264-ipod640.ffpreset b/ffpresets/libx264-ipod640.ffpreset
deleted file mode 100644
index 1ed3d9f..0000000
--- a/ffpresets/libx264-ipod640.ffpreset
+++ /dev/null
@@ -1,8 +0,0 @@
-coder=0
-bf=0
-refs=1
-flags2=-wpred-dct8x8
-level=30
-maxrate=10000000
-bufsize=10000000
-wpredp=0
diff --git a/ffpresets/libx264-lossless_fast.ffpreset b/ffpresets/libx264-lossless_fast.ffpreset
deleted file mode 100644
index ea08d3c..0000000
--- a/ffpresets/libx264-lossless_fast.ffpreset
+++ /dev/null
@@ -1,20 +0,0 @@
-coder=0
-flags=+loop
-cmp=+chroma
-partitions=-parti8x8+parti4x4+partp8x8-partp4x4-partb8x8
-me_method=hex
-subq=3
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=1
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-directpred=1
-flags2=+fastpskip
-cqp=0
-wpredp=0
diff --git a/ffpresets/libx264-lossless_max.ffpreset b/ffpresets/libx264-lossless_max.ffpreset
deleted file mode 100644
index 8c049c9..0000000
--- a/ffpresets/libx264-lossless_max.ffpreset
+++ /dev/null
@@ -1,21 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=+parti8x8+parti4x4+partp8x8+partp4x4-partb8x8
-me_method=esa
-subq=8
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=1
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-refs=16
-directpred=1
-flags2=+mixed_refs+dct8x8+fastpskip
-cqp=0
-wpredp=2
diff --git a/ffpresets/libx264-lossless_medium.ffpreset b/ffpresets/libx264-lossless_medium.ffpreset
deleted file mode 100644
index 558be6c..0000000
--- a/ffpresets/libx264-lossless_medium.ffpreset
+++ /dev/null
@@ -1,20 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=-parti8x8+parti4x4+partp8x8+partp4x4-partb8x8
-me_method=hex
-subq=5
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=1
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-directpred=1
-flags2=+fastpskip
-cqp=0
-wpredp=2
diff --git a/ffpresets/libx264-lossless_slow.ffpreset b/ffpresets/libx264-lossless_slow.ffpreset
deleted file mode 100644
index ff641cf..0000000
--- a/ffpresets/libx264-lossless_slow.ffpreset
+++ /dev/null
@@ -1,21 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=+parti8x8+parti4x4+partp8x8+partp4x4-partb8x8
-me_method=umh
-subq=6
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=1
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-refs=2
-directpred=1
-flags2=+dct8x8+fastpskip
-cqp=0
-wpredp=2
diff --git a/ffpresets/libx264-lossless_slower.ffpreset b/ffpresets/libx264-lossless_slower.ffpreset
deleted file mode 100644
index 854f74b..0000000
--- a/ffpresets/libx264-lossless_slower.ffpreset
+++ /dev/null
@@ -1,21 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=+parti8x8+parti4x4+partp8x8+partp4x4-partb8x8
-me_method=umh
-subq=8
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=1
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-refs=4
-directpred=1
-flags2=+mixed_refs+dct8x8+fastpskip
-cqp=0
-wpredp=2
diff --git a/ffpresets/libx264-lossless_ultrafast.ffpreset b/ffpresets/libx264-lossless_ultrafast.ffpreset
deleted file mode 100644
index 1c429f2..0000000
--- a/ffpresets/libx264-lossless_ultrafast.ffpreset
+++ /dev/null
@@ -1,19 +0,0 @@
-coder=0
-flags=+loop
-cmp=+chroma
-partitions=-parti8x8-parti4x4-partp8x8-partp4x4-partb8x8
-me_method=dia
-subq=0
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=1
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-directpred=1
-flags2=+fastpskip
-cqp=0
diff --git a/ffpresets/libx264-main.ffpreset b/ffpresets/libx264-main.ffpreset
deleted file mode 100644
index d1dc7dd..0000000
--- a/ffpresets/libx264-main.ffpreset
+++ /dev/null
@@ -1 +0,0 @@
-flags2=-dct8x8
diff --git a/ffpresets/libx264-max.ffpreset b/ffpresets/libx264-max.ffpreset
deleted file mode 100644
index 667ba85..0000000
--- a/ffpresets/libx264-max.ffpreset
+++ /dev/null
@@ -1,22 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=+parti8x8+parti4x4+partp8x8+partp4x4+partb8x8
-me_method=tesa
-subq=10
-me_range=24
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=2
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=16
-directpred=3
-trellis=2
-flags2=+wpred+mixed_refs+dct8x8-fastpskip
-wpredp=2
diff --git a/ffpresets/libx264-medium.ffpreset b/ffpresets/libx264-medium.ffpreset
deleted file mode 100644
index 039f1d6..0000000
--- a/ffpresets/libx264-medium.ffpreset
+++ /dev/null
@@ -1,22 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=+parti8x8+parti4x4+partp8x8+partb8x8
-me_method=hex
-subq=7
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=1
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=3
-directpred=1
-trellis=1
-flags2=+bpyramid+mixed_refs+wpred+dct8x8+fastpskip
-wpredp=2
diff --git a/ffpresets/libx264-medium_firstpass.ffpreset b/ffpresets/libx264-medium_firstpass.ffpreset
deleted file mode 100644
index e415989..0000000
--- a/ffpresets/libx264-medium_firstpass.ffpreset
+++ /dev/null
@@ -1,22 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=-parti8x8-parti4x4-partp8x8-partb8x8
-me_method=dia
-subq=2
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=1
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=1
-directpred=1
-trellis=0
-flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip
-wpredp=2
diff --git a/ffpresets/libx264-normal.ffpreset b/ffpresets/libx264-normal.ffpreset
deleted file mode 100644
index ee790b6..0000000
--- a/ffpresets/libx264-normal.ffpreset
+++ /dev/null
@@ -1,22 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=+parti8x8+parti4x4+partp8x8+partb8x8
-me_method=hex
-subq=6
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=1
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=2
-directpred=3
-trellis=0
-flags2=+wpred+dct8x8+fastpskip
-wpredp=2
diff --git a/ffpresets/libx264-placebo.ffpreset b/ffpresets/libx264-placebo.ffpreset
deleted file mode 100644
index fae2222..0000000
--- a/ffpresets/libx264-placebo.ffpreset
+++ /dev/null
@@ -1,23 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=+parti8x8+parti4x4+partp8x8+partp4x4+partb8x8
-me_method=tesa
-subq=10
-me_range=24
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=2
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=16
-refs=16
-directpred=3
-trellis=2
-flags2=+bpyramid+mixed_refs+wpred+dct8x8-fastpskip
-wpredp=2
-rc_lookahead=60
diff --git a/ffpresets/libx264-placebo_firstpass.ffpreset b/ffpresets/libx264-placebo_firstpass.ffpreset
deleted file mode 100644
index fae2222..0000000
--- a/ffpresets/libx264-placebo_firstpass.ffpreset
+++ /dev/null
@@ -1,23 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=+parti8x8+parti4x4+partp8x8+partp4x4+partb8x8
-me_method=tesa
-subq=10
-me_range=24
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=2
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=16
-refs=16
-directpred=3
-trellis=2
-flags2=+bpyramid+mixed_refs+wpred+dct8x8-fastpskip
-wpredp=2
-rc_lookahead=60
diff --git a/ffpresets/libx264-slow.ffpreset b/ffpresets/libx264-slow.ffpreset
deleted file mode 100644
index 0f3f4d4..0000000
--- a/ffpresets/libx264-slow.ffpreset
+++ /dev/null
@@ -1,23 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=+parti8x8+parti4x4+partp8x8+partb8x8
-me_method=umh
-subq=8
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=2
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=5
-directpred=3
-trellis=1
-flags2=+bpyramid+mixed_refs+wpred+dct8x8+fastpskip
-wpredp=2
-rc_lookahead=50
diff --git a/ffpresets/libx264-slow_firstpass.ffpreset b/ffpresets/libx264-slow_firstpass.ffpreset
deleted file mode 100644
index 89e74e4..0000000
--- a/ffpresets/libx264-slow_firstpass.ffpreset
+++ /dev/null
@@ -1,23 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=-parti8x8-parti4x4-partp8x8-partb8x8
-me_method=dia
-subq=2
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=2
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=1
-directpred=3
-trellis=0
-flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip
-wpredp=2
-rc_lookahead=50
diff --git a/ffpresets/libx264-slower.ffpreset b/ffpresets/libx264-slower.ffpreset
deleted file mode 100644
index f3a412c..0000000
--- a/ffpresets/libx264-slower.ffpreset
+++ /dev/null
@@ -1,23 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=+parti8x8+parti4x4+partp8x8+partp4x4+partb8x8
-me_method=umh
-subq=9
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=2
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=8
-directpred=3
-trellis=2
-flags2=+bpyramid+mixed_refs+wpred+dct8x8+fastpskip
-wpredp=2
-rc_lookahead=60
diff --git a/ffpresets/libx264-slower_firstpass.ffpreset b/ffpresets/libx264-slower_firstpass.ffpreset
deleted file mode 100644
index aa1eb1e..0000000
--- a/ffpresets/libx264-slower_firstpass.ffpreset
+++ /dev/null
@@ -1,23 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=-parti8x8-parti4x4-partp8x8-partb8x8
-me_method=dia
-subq=2
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=2
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=1
-directpred=3
-trellis=0
-flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip
-wpredp=2
-rc_lookahead=60
diff --git a/ffpresets/libx264-slowfirstpass.ffpreset b/ffpresets/libx264-slowfirstpass.ffpreset
deleted file mode 100644
index fe07331..0000000
--- a/ffpresets/libx264-slowfirstpass.ffpreset
+++ /dev/null
@@ -1,22 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=+parti8x8+parti4x4+partp8x8+partb8x8
-me_method=hex
-subq=6
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=2
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=1
-directpred=3
-trellis=0
-flags2=+wpred+dct8x8+fastpskip
-wpredp=2
diff --git a/ffpresets/libx264-superfast.ffpreset b/ffpresets/libx264-superfast.ffpreset
deleted file mode 100644
index e2cb959..0000000
--- a/ffpresets/libx264-superfast.ffpreset
+++ /dev/null
@@ -1,22 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=+parti8x8+parti4x4-partp8x8-partb8x8
-me_method=dia
-subq=1
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=1
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=1
-directpred=1
-trellis=0
-flags2=+bpyramid-mixed_refs+wpred+dct8x8+fastpskip-mbtree
-wpredp=0
diff --git a/ffpresets/libx264-superfast_firstpass.ffpreset b/ffpresets/libx264-superfast_firstpass.ffpreset
deleted file mode 100644
index 5f44bea..0000000
--- a/ffpresets/libx264-superfast_firstpass.ffpreset
+++ /dev/null
@@ -1,22 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=-parti8x8-parti4x4-partp8x8-partb8x8
-me_method=dia
-subq=1
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=1
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=1
-directpred=1
-trellis=0
-flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip-mbtree
-wpredp=0
diff --git a/ffpresets/libx264-ultrafast.ffpreset b/ffpresets/libx264-ultrafast.ffpreset
deleted file mode 100644
index 70acb00..0000000
--- a/ffpresets/libx264-ultrafast.ffpreset
+++ /dev/null
@@ -1,23 +0,0 @@
-coder=0
-flags=-loop
-cmp=+chroma
-partitions=-parti8x8-parti4x4-partp8x8-partb8x8
-me_method=dia
-subq=0
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=0
-i_qfactor=0.71
-b_strategy=0
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=0
-refs=1
-directpred=1
-trellis=0
-flags2=-bpyramid-mixed_refs-wpred-dct8x8+fastpskip-mbtree
-wpredp=0
-aq_mode=0
diff --git a/ffpresets/libx264-ultrafast_firstpass.ffpreset b/ffpresets/libx264-ultrafast_firstpass.ffpreset
deleted file mode 100644
index 70acb00..0000000
--- a/ffpresets/libx264-ultrafast_firstpass.ffpreset
+++ /dev/null
@@ -1,23 +0,0 @@
-coder=0
-flags=-loop
-cmp=+chroma
-partitions=-parti8x8-parti4x4-partp8x8-partb8x8
-me_method=dia
-subq=0
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=0
-i_qfactor=0.71
-b_strategy=0
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=0
-refs=1
-directpred=1
-trellis=0
-flags2=-bpyramid-mixed_refs-wpred-dct8x8+fastpskip-mbtree
-wpredp=0
-aq_mode=0
diff --git a/ffpresets/libx264-veryfast.ffpreset b/ffpresets/libx264-veryfast.ffpreset
deleted file mode 100644
index a29b115..0000000
--- a/ffpresets/libx264-veryfast.ffpreset
+++ /dev/null
@@ -1,22 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=+parti8x8+parti4x4+partp8x8+partb8x8
-me_method=hex
-subq=2
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=1
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=1
-directpred=1
-trellis=0
-flags2=+bpyramid-mixed_refs+wpred+dct8x8+fastpskip-mbtree
-wpredp=0
diff --git a/ffpresets/libx264-veryfast_firstpass.ffpreset b/ffpresets/libx264-veryfast_firstpass.ffpreset
deleted file mode 100644
index bab5d9b..0000000
--- a/ffpresets/libx264-veryfast_firstpass.ffpreset
+++ /dev/null
@@ -1,22 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=-parti8x8-parti4x4-partp8x8-partb8x8
-me_method=dia
-subq=2
-me_range=16
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=1
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=3
-refs=1
-directpred=1
-trellis=0
-flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip-mbtree
-wpredp=0
diff --git a/ffpresets/libx264-veryslow.ffpreset b/ffpresets/libx264-veryslow.ffpreset
deleted file mode 100644
index a060625..0000000
--- a/ffpresets/libx264-veryslow.ffpreset
+++ /dev/null
@@ -1,23 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=+parti8x8+parti4x4+partp8x8+partp4x4+partb8x8
-me_method=umh
-subq=10
-me_range=24
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=2
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=8
-refs=16
-directpred=3
-trellis=2
-flags2=+bpyramid+mixed_refs+wpred+dct8x8+fastpskip
-wpredp=2
-rc_lookahead=60
diff --git a/ffpresets/libx264-veryslow_firstpass.ffpreset b/ffpresets/libx264-veryslow_firstpass.ffpreset
deleted file mode 100644
index 6e7079b..0000000
--- a/ffpresets/libx264-veryslow_firstpass.ffpreset
+++ /dev/null
@@ -1,23 +0,0 @@
-coder=1
-flags=+loop
-cmp=+chroma
-partitions=-parti8x8-parti4x4-partp8x8-partb8x8
-me_method=dia
-subq=2
-me_range=24
-g=250
-keyint_min=25
-sc_threshold=40
-i_qfactor=0.71
-b_strategy=2
-qcomp=0.6
-qmin=10
-qmax=51
-qdiff=4
-bf=8
-refs=1
-directpred=3
-trellis=0
-flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip
-wpredp=2
-rc_lookahead=60
diff --git a/ffprobe.c b/ffprobe.c
deleted file mode 100644
index 7cb6167..0000000
--- a/ffprobe.c
+++ /dev/null
@@ -1,367 +0,0 @@
-/*
- * FFprobe : Simple Media Prober based on the FFmpeg libraries
- * Copyright (c) 2007-2010 Stefano Sabatini
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-
-#include "libavformat/avformat.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/opt.h"
-#include "libavutil/pixdesc.h"
-#include "libavdevice/avdevice.h"
-#include "cmdutils.h"
-
-const char program_name[] = "FFprobe";
-const int program_birth_year = 2007;
-
-static int do_show_format  = 0;
-static int do_show_streams = 0;
-
-static int convert_tags                 = 0;
-static int show_value_unit              = 0;
-static int use_value_prefix             = 0;
-static int use_byte_value_binary_prefix = 0;
-static int use_value_sexagesimal_format = 0;
-
-/* globals */
-static const OptionDef options[];
-
-/* FFprobe context */
-static const char *input_filename;
-static AVInputFormat *iformat = NULL;
-
-static const char *binary_unit_prefixes [] = { "", "Ki", "Mi", "Gi", "Ti", "Pi" };
-static const char *decimal_unit_prefixes[] = { "", "K" , "M" , "G" , "T" , "P"  };
-
-static const char *unit_second_str          = "s"    ;
-static const char *unit_hertz_str           = "Hz"   ;
-static const char *unit_byte_str            = "byte" ;
-static const char *unit_bit_per_second_str  = "bit/s";
-
-static char *value_string(char *buf, int buf_size, double val, const char *unit)
-{
-    if (unit == unit_second_str && use_value_sexagesimal_format) {
-        double secs;
-        int hours, mins;
-        secs  = val;
-        mins  = (int)secs / 60;
-        secs  = secs - mins * 60;
-        hours = mins / 60;
-        mins %= 60;
-        snprintf(buf, buf_size, "%d:%02d:%09.6f", hours, mins, secs);
-    } else if (use_value_prefix) {
-        const char *prefix_string;
-        int index;
-
-        if (unit == unit_byte_str && use_byte_value_binary_prefix) {
-            index = (int) (log(val)/log(2)) / 10;
-            index = av_clip(index, 0, FF_ARRAY_ELEMS(binary_unit_prefixes) -1);
-            val /= pow(2, index*10);
-            prefix_string = binary_unit_prefixes[index];
-        } else {
-            index = (int) (log10(val)) / 3;
-            index = av_clip(index, 0, FF_ARRAY_ELEMS(decimal_unit_prefixes) -1);
-            val /= pow(10, index*3);
-            prefix_string = decimal_unit_prefixes[index];
-        }
-
-        snprintf(buf, buf_size, "%.3f %s%s", val, prefix_string, show_value_unit ? unit : "");
-    } else {
-        snprintf(buf, buf_size, "%f %s", val, show_value_unit ? unit : "");
-    }
-
-    return buf;
-}
-
-static char *time_value_string(char *buf, int buf_size, int64_t val, const AVRational *time_base)
-{
-    if (val == AV_NOPTS_VALUE) {
-        snprintf(buf, buf_size, "N/A");
-    } else {
-        value_string(buf, buf_size, val * av_q2d(*time_base), unit_second_str);
-    }
-
-    return buf;
-}
-
-static const char *media_type_string(enum AVMediaType media_type)
-{
-    switch (media_type) {
-    case AVMEDIA_TYPE_VIDEO:      return "video";
-    case AVMEDIA_TYPE_AUDIO:      return "audio";
-    case AVMEDIA_TYPE_DATA:       return "data";
-    case AVMEDIA_TYPE_SUBTITLE:   return "subtitle";
-    case AVMEDIA_TYPE_ATTACHMENT: return "attachment";
-    default:                      return "unknown";
-    }
-}
-
-static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
-{
-    AVStream *stream = fmt_ctx->streams[stream_idx];
-    AVCodecContext *dec_ctx;
-    AVCodec *dec;
-    char val_str[128];
-    AVMetadataTag *tag = NULL;
-    char a, b, c, d;
-    AVRational display_aspect_ratio;
-
-    printf("[STREAM]\n");
-
-    printf("index=%d\n",        stream->index);
-
-    if ((dec_ctx = stream->codec)) {
-        if ((dec = dec_ctx->codec)) {
-            printf("codec_name=%s\n",         dec->name);
-            printf("codec_long_name=%s\n",    dec->long_name);
-        } else {
-            printf("codec_name=unknown\n");
-        }
-
-        printf("codec_type=%s\n",         media_type_string(dec_ctx->codec_type));
-        printf("codec_time_base=%d/%d\n", dec_ctx->time_base.num, dec_ctx->time_base.den);
-
-        /* print AVI/FourCC tag */
-        a = dec_ctx->codec_tag     & 0xff;
-        b = dec_ctx->codec_tag>>8  & 0xff;
-        c = dec_ctx->codec_tag>>16 & 0xff;
-        d = dec_ctx->codec_tag>>24 & 0xff;
-        printf("codec_tag_string=");
-        if (isprint(a)) printf("%c", a); else printf("[%d]", a);
-        if (isprint(b)) printf("%c", b); else printf("[%d]", b);
-        if (isprint(c)) printf("%c", c); else printf("[%d]", c);
-        if (isprint(d)) printf("%c", d); else printf("[%d]", d);
-        printf("\ncodec_tag=0x%04x\n", dec_ctx->codec_tag);
-
-        switch (dec_ctx->codec_type) {
-        case AVMEDIA_TYPE_VIDEO:
-            printf("width=%d\n",                   dec_ctx->width);
-            printf("height=%d\n",                  dec_ctx->height);
-            printf("has_b_frames=%d\n",            dec_ctx->has_b_frames);
-            if (dec_ctx->sample_aspect_ratio.num) {
-                printf("sample_aspect_ratio=%d:%d\n", dec_ctx->sample_aspect_ratio.num,
-                                                      dec_ctx->sample_aspect_ratio.den);
-                av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
-                          dec_ctx->width  * dec_ctx->sample_aspect_ratio.num,
-                          dec_ctx->height * dec_ctx->sample_aspect_ratio.den,
-                          1024*1024);
-                printf("display_aspect_ratio=%d:%d\n", display_aspect_ratio.num,
-                                                       display_aspect_ratio.den);
-            }
-            printf("pix_fmt=%s\n",                 dec_ctx->pix_fmt != PIX_FMT_NONE ?
-                   av_pix_fmt_descriptors[dec_ctx->pix_fmt].name : "unknown");
-            break;
-
-        case AVMEDIA_TYPE_AUDIO:
-            printf("sample_rate=%s\n",             value_string(val_str, sizeof(val_str),
-                                                                dec_ctx->sample_rate,
-                                                                unit_hertz_str));
-            printf("channels=%d\n",                dec_ctx->channels);
-            printf("bits_per_sample=%d\n",         av_get_bits_per_sample(dec_ctx->codec_id));
-            break;
-        }
-    } else {
-        printf("codec_type=unknown\n");
-    }
-
-    if (fmt_ctx->iformat->flags & AVFMT_SHOW_IDS)
-        printf("id=0x%x\n", stream->id);
-    printf("r_frame_rate=%d/%d\n",         stream->r_frame_rate.num,   stream->r_frame_rate.den);
-    printf("avg_frame_rate=%d/%d\n",       stream->avg_frame_rate.num, stream->avg_frame_rate.den);
-    printf("time_base=%d/%d\n",            stream->time_base.num,      stream->time_base.den);
-    if (stream->language[0])
-        printf("language=%s\n",            stream->language);
-    printf("start_time=%s\n",   time_value_string(val_str, sizeof(val_str), stream->start_time,
-                                                  &stream->time_base));
-    printf("duration=%s\n",     time_value_string(val_str, sizeof(val_str), stream->duration,
-                                                  &stream->time_base));
-    if (stream->nb_frames)
-        printf("nb_frames=%"PRId64"\n",    stream->nb_frames);
-
-    while ((tag = av_metadata_get(stream->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX)))
-        printf("TAG:%s=%s\n", tag->key, tag->value);
-
-    printf("[/STREAM]\n");
-}
-
-static void show_format(AVFormatContext *fmt_ctx)
-{
-    AVMetadataTag *tag = NULL;
-    char val_str[128];
-
-    printf("[FORMAT]\n");
-
-    printf("filename=%s\n",         fmt_ctx->filename);
-    printf("nb_streams=%d\n",       fmt_ctx->nb_streams);
-    printf("format_name=%s\n",      fmt_ctx->iformat->name);
-    printf("format_long_name=%s\n", fmt_ctx->iformat->long_name);
-    printf("start_time=%s\n",       time_value_string(val_str, sizeof(val_str), fmt_ctx->start_time,
-                                                      &AV_TIME_BASE_Q));
-    printf("duration=%s\n",         time_value_string(val_str, sizeof(val_str), fmt_ctx->duration,
-                                                      &AV_TIME_BASE_Q));
-    printf("size=%s\n",             value_string(val_str, sizeof(val_str), fmt_ctx->file_size,
-                                                 unit_byte_str));
-    printf("bit_rate=%s\n",         value_string(val_str, sizeof(val_str), fmt_ctx->bit_rate,
-                                                 unit_bit_per_second_str));
-
-    if (convert_tags)
-        av_metadata_conv(fmt_ctx, NULL, fmt_ctx->iformat->metadata_conv);
-    while ((tag = av_metadata_get(fmt_ctx->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX)))
-        printf("TAG:%s=%s\n", tag->key, tag->value);
-
-    printf("[/FORMAT]\n");
-}
-
-static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
-{
-    int err, i;
-    AVFormatContext *fmt_ctx;
-
-    fmt_ctx = avformat_alloc_context();
-
-    if ((err = av_open_input_file(&fmt_ctx, filename, iformat, 0, NULL)) < 0) {
-        print_error(filename, err);
-        return err;
-    }
-
-    /* fill the streams in the format context */
-    if ((err = av_find_stream_info(fmt_ctx)) < 0) {
-        print_error(filename, err);
-        return err;
-    }
-
-    dump_format(fmt_ctx, 0, filename, 0);
-
-    /* bind a decoder to each input stream */
-    for (i = 0; i < fmt_ctx->nb_streams; i++) {
-        AVStream *stream = fmt_ctx->streams[i];
-        AVCodec *codec;
-
-        if (!(codec = avcodec_find_decoder(stream->codec->codec_id))) {
-            fprintf(stderr, "Unsupported codec (id=%d) for input stream %d\n",
-                    stream->codec->codec_id, stream->index);
-        } else if (avcodec_open(stream->codec, codec) < 0) {
-            fprintf(stderr, "Error while opening codec for input stream %d\n",
-                    stream->index);
-        }
-    }
-
-    *fmt_ctx_ptr = fmt_ctx;
-    return 0;
-}
-
-static int probe_file(const char *filename)
-{
-    AVFormatContext *fmt_ctx;
-    int ret, i;
-
-    if ((ret = open_input_file(&fmt_ctx, filename)))
-        return ret;
-
-    if (do_show_streams)
-        for (i = 0; i < fmt_ctx->nb_streams; i++)
-            show_stream(fmt_ctx, i);
-
-    if (do_show_format)
-        show_format(fmt_ctx);
-
-    av_close_input_file(fmt_ctx);
-    return 0;
-}
-
-static void show_usage(void)
-{
-    printf("Simple multimedia streams analyzer\n");
-    printf("usage: ffprobe [OPTIONS] [INPUT_FILE]\n");
-    printf("\n");
-}
-
-static void opt_format(const char *arg)
-{
-    iformat = av_find_input_format(arg);
-    if (!iformat) {
-        fprintf(stderr, "Unknown input format: %s\n", arg);
-        exit(1);
-    }
-}
-
-static void opt_input_file(const char *arg)
-{
-    if (input_filename) {
-        fprintf(stderr, "Argument '%s' provided as input filename, but '%s' was already specified.\n",
-                arg, input_filename);
-        exit(1);
-    }
-    if (!strcmp(arg, "-"))
-        arg = "pipe:";
-    input_filename = arg;
-}
-
-static void show_help(void)
-{
-    show_usage();
-    show_help_options(options, "Main options:\n", 0, 0);
-    printf("\n");
-}
-
-static void opt_pretty(void)
-{
-    show_value_unit              = 1;
-    use_value_prefix             = 1;
-    use_byte_value_binary_prefix = 1;
-    use_value_sexagesimal_format = 1;
-}
-
-static const OptionDef options[] = {
-#include "cmdutils_common_opts.h"
-    { "convert_tags", OPT_BOOL, {(void*)&convert_tags}, "convert tag names to the FFmpeg generic tag names" },
-    { "f", HAS_ARG, {(void*)opt_format}, "force format", "format" },
-    { "unit", OPT_BOOL, {(void*)&show_value_unit}, "show unit of the displayed values" },
-    { "prefix", OPT_BOOL, {(void*)&use_value_prefix}, "use SI prefixes for the displayed values" },
-    { "byte_binary_prefix", OPT_BOOL, {(void*)&use_byte_value_binary_prefix},
-      "use binary prefixes for byte units" },
-    { "sexagesimal", OPT_BOOL,  {(void*)&use_value_sexagesimal_format},
-      "use sexagesimal format HOURS:MM:SS.MICROSECONDS for time units" },
-    { "pretty", 0, {(void*)&opt_pretty},
-      "prettify the format of displayed values, make it more human readable" },
-    { "show_format",  OPT_BOOL, {(void*)&do_show_format} , "show format/container info" },
-    { "show_streams", OPT_BOOL, {(void*)&do_show_streams}, "show streams info" },
-    { NULL, },
-};
-
-int main(int argc, char **argv)
-{
-    av_register_all();
-#if CONFIG_AVDEVICE
-    avdevice_register_all();
-#endif
-
-    show_banner();
-    parse_options(argc, argv, options, opt_input_file);
-
-    if (!input_filename) {
-        show_usage();
-        fprintf(stderr, "You have to specify one input file.\n");
-        fprintf(stderr, "Use -h to get full help or, even better, run 'man ffprobe'.\n");
-        exit(1);
-    }
-
-    return probe_file(input_filename);
-}
diff --git a/ffserver.c b/ffserver.c
deleted file mode 100644
index a1bd526..0000000
--- a/ffserver.c
+++ /dev/null
@@ -1,4697 +0,0 @@
-/*
- * Multiple format streaming server
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define _XOPEN_SOURCE 600
-
-#include "config.h"
-#if !HAVE_CLOSESOCKET
-#define closesocket close
-#endif
-#include <string.h>
-#include <strings.h>
-#include <stdlib.h>
-#include "libavformat/avformat.h"
-#include "libavformat/network.h"
-#include "libavformat/os_support.h"
-#include "libavformat/rtpdec.h"
-#include "libavformat/rtsp.h"
-#include "libavutil/avstring.h"
-#include "libavutil/lfg.h"
-#include "libavutil/random_seed.h"
-#include "libavcodec/opt.h"
-#include <stdarg.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#if HAVE_POLL_H
-#include <poll.h>
-#endif
-#include <errno.h>
-#include <sys/time.h>
-#include <time.h>
-#include <sys/wait.h>
-#include <signal.h>
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include "cmdutils.h"
-
-const char program_name[] = "FFserver";
-const int program_birth_year = 2000;
-
-static const OptionDef options[];
-
-enum HTTPState {
-    HTTPSTATE_WAIT_REQUEST,
-    HTTPSTATE_SEND_HEADER,
-    HTTPSTATE_SEND_DATA_HEADER,
-    HTTPSTATE_SEND_DATA,          /* sending TCP or UDP data */
-    HTTPSTATE_SEND_DATA_TRAILER,
-    HTTPSTATE_RECEIVE_DATA,
-    HTTPSTATE_WAIT_FEED,          /* wait for data from the feed */
-    HTTPSTATE_READY,
-
-    RTSPSTATE_WAIT_REQUEST,
-    RTSPSTATE_SEND_REPLY,
-    RTSPSTATE_SEND_PACKET,
-};
-
-static const char *http_state[] = {
-    "HTTP_WAIT_REQUEST",
-    "HTTP_SEND_HEADER",
-
-    "SEND_DATA_HEADER",
-    "SEND_DATA",
-    "SEND_DATA_TRAILER",
-    "RECEIVE_DATA",
-    "WAIT_FEED",
-    "READY",
-
-    "RTSP_WAIT_REQUEST",
-    "RTSP_SEND_REPLY",
-    "RTSP_SEND_PACKET",
-};
-
-#define IOBUFFER_INIT_SIZE 8192
-
-/* timeouts are in ms */
-#define HTTP_REQUEST_TIMEOUT (15 * 1000)
-#define RTSP_REQUEST_TIMEOUT (3600 * 24 * 1000)
-
-#define SYNC_TIMEOUT (10 * 1000)
-
-typedef struct RTSPActionServerSetup {
-    uint32_t ipaddr;
-    char transport_option[512];
-} RTSPActionServerSetup;
-
-typedef struct {
-    int64_t count1, count2;
-    int64_t time1, time2;
-} DataRateData;
-
-/* context associated with one connection */
-typedef struct HTTPContext {
-    enum HTTPState state;
-    int fd; /* socket file descriptor */
-    struct sockaddr_in from_addr; /* origin */
-    struct pollfd *poll_entry; /* used when polling */
-    int64_t timeout;
-    uint8_t *buffer_ptr, *buffer_end;
-    int http_error;
-    int post;
-    int chunked_encoding;
-    int chunk_size;               /* 0 if it needs to be read */
-    struct HTTPContext *next;
-    int got_key_frame; /* stream 0 => 1, stream 1 => 2, stream 2=> 4 */
-    int64_t data_count;
-    /* feed input */
-    int feed_fd;
-    /* input format handling */
-    AVFormatContext *fmt_in;
-    int64_t start_time;            /* In milliseconds - this wraps fairly often */
-    int64_t first_pts;            /* initial pts value */
-    int64_t cur_pts;             /* current pts value from the stream in us */
-    int64_t cur_frame_duration;  /* duration of the current frame in us */
-    int cur_frame_bytes;       /* output frame size, needed to compute
-                                  the time at which we send each
-                                  packet */
-    int pts_stream_index;        /* stream we choose as clock reference */
-    int64_t cur_clock;           /* current clock reference value in us */
-    /* output format handling */
-    struct FFStream *stream;
-    /* -1 is invalid stream */
-    int feed_streams[MAX_STREAMS]; /* index of streams in the feed */
-    int switch_feed_streams[MAX_STREAMS]; /* index of streams in the feed */
-    int switch_pending;
-    AVFormatContext fmt_ctx; /* instance of FFStream for one user */
-    int last_packet_sent; /* true if last data packet was sent */
-    int suppress_log;
-    DataRateData datarate;
-    int wmp_client_id;
-    char protocol[16];
-    char method[16];
-    char url[128];
-    int buffer_size;
-    uint8_t *buffer;
-    int is_packetized; /* if true, the stream is packetized */
-    int packet_stream_index; /* current stream for output in state machine */
-
-    /* RTSP state specific */
-    uint8_t *pb_buffer; /* XXX: use that in all the code */
-    ByteIOContext *pb;
-    int seq; /* RTSP sequence number */
-
-    /* RTP state specific */
-    enum RTSPLowerTransport rtp_protocol;
-    char session_id[32]; /* session id */
-    AVFormatContext *rtp_ctx[MAX_STREAMS];
-
-    /* RTP/UDP specific */
-    URLContext *rtp_handles[MAX_STREAMS];
-
-    /* RTP/TCP specific */
-    struct HTTPContext *rtsp_c;
-    uint8_t *packet_buffer, *packet_buffer_ptr, *packet_buffer_end;
-} HTTPContext;
-
-/* each generated stream is described here */
-enum StreamType {
-    STREAM_TYPE_LIVE,
-    STREAM_TYPE_STATUS,
-    STREAM_TYPE_REDIRECT,
-};
-
-enum IPAddressAction {
-    IP_ALLOW = 1,
-    IP_DENY,
-};
-
-typedef struct IPAddressACL {
-    struct IPAddressACL *next;
-    enum IPAddressAction action;
-    /* These are in host order */
-    struct in_addr first;
-    struct in_addr last;
-} IPAddressACL;
-
-/* description of each stream of the ffserver.conf file */
-typedef struct FFStream {
-    enum StreamType stream_type;
-    char filename[1024];     /* stream filename */
-    struct FFStream *feed;   /* feed we are using (can be null if
-                                coming from file) */
-    AVFormatParameters *ap_in; /* input parameters */
-    AVInputFormat *ifmt;       /* if non NULL, force input format */
-    AVOutputFormat *fmt;
-    IPAddressACL *acl;
-    char dynamic_acl[1024];
-    int nb_streams;
-    int prebuffer;      /* Number of millseconds early to start */
-    int64_t max_time;      /* Number of milliseconds to run */
-    int send_on_key;
-    AVStream *streams[MAX_STREAMS];
-    int feed_streams[MAX_STREAMS]; /* index of streams in the feed */
-    char feed_filename[1024]; /* file name of the feed storage, or
-                                 input file name for a stream */
-    char author[512];
-    char title[512];
-    char copyright[512];
-    char comment[512];
-    pid_t pid;  /* Of ffmpeg process */
-    time_t pid_start;  /* Of ffmpeg process */
-    char **child_argv;
-    struct FFStream *next;
-    unsigned bandwidth; /* bandwidth, in kbits/s */
-    /* RTSP options */
-    char *rtsp_option;
-    /* multicast specific */
-    int is_multicast;
-    struct in_addr multicast_ip;
-    int multicast_port; /* first port used for multicast */
-    int multicast_ttl;
-    int loop; /* if true, send the stream in loops (only meaningful if file) */
-
-    /* feed specific */
-    int feed_opened;     /* true if someone is writing to the feed */
-    int is_feed;         /* true if it is a feed */
-    int readonly;        /* True if writing is prohibited to the file */
-    int truncate;        /* True if feeder connection truncate the feed file */
-    int conns_served;
-    int64_t bytes_served;
-    int64_t feed_max_size;      /* maximum storage size, zero means unlimited */
-    int64_t feed_write_index;   /* current write position in feed (it wraps around) */
-    int64_t feed_size;          /* current size of feed */
-    struct FFStream *next_feed;
-} FFStream;
-
-typedef struct FeedData {
-    long long data_count;
-    float avg_frame_size;   /* frame size averaged over last frames with exponential mean */
-} FeedData;
-
-static struct sockaddr_in my_http_addr;
-static struct sockaddr_in my_rtsp_addr;
-
-static char logfilename[1024];
-static HTTPContext *first_http_ctx;
-static FFStream *first_feed;   /* contains only feeds */
-static FFStream *first_stream; /* contains all streams, including feeds */
-
-static void new_connection(int server_fd, int is_rtsp);
-static void close_connection(HTTPContext *c);
-
-/* HTTP handling */
-static int handle_connection(HTTPContext *c);
-static int http_parse_request(HTTPContext *c);
-static int http_send_data(HTTPContext *c);
-static void compute_status(HTTPContext *c);
-static int open_input_stream(HTTPContext *c, const char *info);
-static int http_start_receive_data(HTTPContext *c);
-static int http_receive_data(HTTPContext *c);
-
-/* RTSP handling */
-static int rtsp_parse_request(HTTPContext *c);
-static void rtsp_cmd_describe(HTTPContext *c, const char *url);
-static void rtsp_cmd_options(HTTPContext *c, const char *url);
-static void rtsp_cmd_setup(HTTPContext *c, const char *url, RTSPMessageHeader *h);
-static void rtsp_cmd_play(HTTPContext *c, const char *url, RTSPMessageHeader *h);
-static void rtsp_cmd_pause(HTTPContext *c, const char *url, RTSPMessageHeader *h);
-static void rtsp_cmd_teardown(HTTPContext *c, const char *url, RTSPMessageHeader *h);
-
-/* SDP handling */
-static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
-                                   struct in_addr my_ip);
-
-/* RTP handling */
-static HTTPContext *rtp_new_connection(struct sockaddr_in *from_addr,
-                                       FFStream *stream, const char *session_id,
-                                       enum RTSPLowerTransport rtp_protocol);
-static int rtp_new_av_stream(HTTPContext *c,
-                             int stream_index, struct sockaddr_in *dest_addr,
-                             HTTPContext *rtsp_c);
-
-static const char *my_program_name;
-static const char *my_program_dir;
-
-static const char *config_filename = "/etc/ffserver.conf";
-
-static int ffserver_debug;
-static int ffserver_daemon;
-static int no_launch;
-static int need_to_start_children;
-
-/* maximum number of simultaneous HTTP connections */
-static unsigned int nb_max_http_connections = 2000;
-static unsigned int nb_max_connections = 5;
-static unsigned int nb_connections;
-
-static uint64_t max_bandwidth = 1000;
-static uint64_t current_bandwidth;
-
-static int64_t cur_time;           // Making this global saves on passing it around everywhere
-
-static AVLFG random_state;
-
-static FILE *logfile = NULL;
-
-/* FIXME: make ffserver work with IPv6 */
-/* resolve host with also IP address parsing */
-static int resolve_host(struct in_addr *sin_addr, const char *hostname)
-{
-
-    if (!ff_inet_aton(hostname, sin_addr)) {
-#if HAVE_GETADDRINFO
-        struct addrinfo *ai, *cur;
-        struct addrinfo hints;
-        memset(&hints, 0, sizeof(hints));
-        hints.ai_family = AF_INET;
-        if (getaddrinfo(hostname, NULL, &hints, &ai))
-            return -1;
-        /* getaddrinfo returns a linked list of addrinfo structs.
-         * Even if we set ai_family = AF_INET above, make sure
-         * that the returned one actually is of the correct type. */
-        for (cur = ai; cur; cur = cur->ai_next) {
-            if (cur->ai_family == AF_INET) {
-                *sin_addr = ((struct sockaddr_in *)cur->ai_addr)->sin_addr;
-                freeaddrinfo(ai);
-                return 0;
-            }
-        }
-        freeaddrinfo(ai);
-        return -1;
-#else
-        struct hostent *hp;
-        hp = gethostbyname(hostname);
-        if (!hp)
-            return -1;
-        memcpy(sin_addr, hp->h_addr_list[0], sizeof(struct in_addr));
-#endif
-    }
-    return 0;
-}
-
-static char *ctime1(char *buf2)
-{
-    time_t ti;
-    char *p;
-
-    ti = time(NULL);
-    p = ctime(&ti);
-    strcpy(buf2, p);
-    p = buf2 + strlen(p) - 1;
-    if (*p == '\n')
-        *p = '\0';
-    return buf2;
-}
-
-static void http_vlog(const char *fmt, va_list vargs)
-{
-    static int print_prefix = 1;
-    if (logfile) {
-        if (print_prefix) {
-            char buf[32];
-            ctime1(buf);
-            fprintf(logfile, "%s ", buf);
-        }
-        print_prefix = strstr(fmt, "\n") != NULL;
-        vfprintf(logfile, fmt, vargs);
-        fflush(logfile);
-    }
-}
-
-static void __attribute__ ((format (printf, 1, 2))) http_log(const char *fmt, ...)
-{
-    va_list vargs;
-    va_start(vargs, fmt);
-    http_vlog(fmt, vargs);
-    va_end(vargs);
-}
-
-static void http_av_log(void *ptr, int level, const char *fmt, va_list vargs)
-{
-    static int print_prefix = 1;
-    AVClass *avc = ptr ? *(AVClass**)ptr : NULL;